user_llm_chat.go 654 B

12345678910111213141516171819202122232425
  1. package llm
  2. import (
  3. "eta/eta_api/global"
  4. "eta/eta_api/utils"
  5. "time"
  6. )
  7. type UserLlmChat struct {
  8. Id int `gorm:"primaryKey;autoIncrement;comment:会话主键"`
  9. UserId int `gorm:"comment:用户id"`
  10. ChatTitle string `gorm:"comment:会话标题"`
  11. IsDeleted int `gorm:"comment:是否删除"`
  12. CreatedTime time.Time `gorm:"comment:创建时间"`
  13. UpdateTime time.Time `gorm:"autoUpdateTime;comment:更新时间"`
  14. }
  15. func (u *UserLlmChat) TableName() string {
  16. return "user_llm_chat"
  17. }
  18. func (u *UserLlmChat) CreateChatSession() (err error) {
  19. o := global.DbMap[utils.DbNameAI]
  20. err = o.Create(u).Error
  21. return
  22. }