12345678910111213141516171819202122232425 |
- package llm
- import "time"
- // UserChatRecord 定义用户聊天记录结构体
- type UserChatRecord struct {
- Id int `gorm:"primaryKey;autoIncrement;comment:主键"`
- ChatId int `gorm:"comment:会话id"`
- ChatUserType string `gorm:"type:enum('user','assistant');comment:用户方"`
- Content string `gorm:"content:内容"`
- SendTime time.Time `gorm:"comment:发送时间"`
- CreatedTime time.Time `gorm:"comment:创建时间"`
- UpdateTime time.Time `gorm:"autoUpdateTime;comment:更新时间"`
- }
- type UserChatRecordRedis struct {
- Id int
- ChatId int
- ChatUserType string
- Content string
- SendTime string
- }
- func (u *UserChatRecord) TableName() string {
- return "user_chat_record"
- }
|