You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
1019 B

package model
import "time"
// AIConversation AI对话
type AIConversation struct {
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
UserId int64 `gorm:"column:user_id;index;not null" json:"userId"`
Title string `gorm:"column:title;type:varchar(200);default:'新对话'" json:"title"`
ModelId string `gorm:"column:model_id;type:varchar(100)" json:"modelId"`
ProviderId int64 `gorm:"column:provider_id;default:0" json:"providerId"`
TotalTokens int64 `gorm:"column:total_tokens;default:0" json:"totalTokens"`
TotalCost float64 `gorm:"column:total_cost;type:decimal(10,6);default:0" json:"totalCost"`
IsArchived bool `gorm:"column:is_archived;default:false" json:"isArchived"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
}
// TableName 指定表名
func (AIConversation) TableName() string {
return "ai_conversation"
}