user_chat_record.go 751 B

12345678910111213141516171819202122232425
  1. package llm
  2. import "time"
  3. // UserChatRecord 定义用户聊天记录结构体
  4. type UserChatRecord struct {
  5. Id int `gorm:"primaryKey;autoIncrement;comment:主键"`
  6. ChatId int `gorm:"comment:会话id"`
  7. ChatUserType string `gorm:"type:enum('user','assistant');comment:用户方"`
  8. Content string `gorm:"content:内容"`
  9. SendTime time.Time `gorm:"comment:发送时间"`
  10. CreatedTime time.Time `gorm:"comment:创建时间"`
  11. UpdateTime time.Time `gorm:"autoUpdateTime;comment:更新时间"`
  12. }
  13. type UserChatRecordRedis struct {
  14. Id int
  15. ChatId int
  16. ChatUserType string
  17. Content string
  18. SendTime string
  19. }
  20. func (u *UserChatRecord) TableName() string {
  21. return "user_chat_record"
  22. }