15 lines
584 B
Go
15 lines
584 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type ChatMessagesNew struct {
|
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
|
SessionID string `json:"session_id" gorm:"type:varchar;not null;index"`
|
|
MessageType string `json:"message_type" gorm:"type:varchar;not null;check:message_type IN ('user', 'assistant')"`
|
|
Content string `json:"content" gorm:"type:text;not null"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
|
Session *ChatSessions `json:"session" gorm:"foreignKey:SessionID;references:SessionID"`
|
|
}
|