Help us shape the future of Go! Take the 2026 Go Developer Survey

models

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConvKey = "_chat_history_conv_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ID             uint64 `gorm:"primaryKey;column:id"`
	AttachID       string `gorm:"uniqueIndex;column:attach_id;type:varchar(255)"`
	MessageID      string `gorm:"column:message_id;type:varchar(255)"`
	AttachmentType string `gorm:"column:attachment_type;type:varchar(20)"`
	FileName       string `gorm:"column:file_name;type:varchar(255)"`
	FileSize       int64  `gorm:"column:file_size"`
	StorageType    string `gorm:"column:storage_type;type:varchar(20)"`
	StoragePath    string `gorm:"column:storage_path;type:varchar(1024)"`
	Thumbnail      []byte `gorm:"column:thumbnail;type:mediumblob"`
	Vectorized     bool   `gorm:"column:vectorized;default:0"`
	DataSummary    string `gorm:"column:data_summary;type:text"`
	MimeType       string `gorm:"column:mime_type;type:varchar(255)"`
	CreatedAt      int64  `gorm:"column:created_at"`
}

Attachment 附件表

func (Attachment) TableName

func (Attachment) TableName() string

TableName 设置表名

type Conversation

type Conversation struct {
	ID         uint64          `gorm:"primaryKey;column:id"`
	ConvID     string          `gorm:"uniqueIndex;column:conv_id;type:varchar(255)"`
	Title      string          `gorm:"column:title;type:varchar(255)"`
	CreatedAt  int64           `gorm:"column:created_at"`
	UpdatedAt  int64           `gorm:"column:updated_at"`
	Settings   json.RawMessage `gorm:"column:settings;type:json"`
	IsArchived bool            `gorm:"column:is_archived;default:0"`
	IsPinned   bool            `gorm:"column:is_pinned;default:0"`
}

Conversation 对话表

func (Conversation) TableName

func (Conversation) TableName() string

TableName 设置表名

type Message

type Message struct {
	ID             uint64          `gorm:"primaryKey;column:id"`
	MsgID          string          `gorm:"uniqueIndex;column:msg_id;type:varchar(255)"`
	ConversationID string          `gorm:"column:conversation_id;type:varchar(255)"`
	ParentID       string          `gorm:"column:parent_id;type:varchar(255);default:''"`
	Role           string          `gorm:"column:role;type:varchar(50);default:'user'"`
	Content        string          `gorm:"column:content;type:text"`
	CreatedAt      int64           `gorm:"column:created_at"`
	OrderSeq       int             `gorm:"column:order_seq;default:0"`
	TokenCount     int             `gorm:"column:token_count;default:0"`
	Status         string          `gorm:"column:status;type:varchar(20);default:'sent'"`
	Metadata       json.RawMessage `gorm:"column:metadata;type:json"`
	IsContextEdge  bool            `gorm:"column:is_context_edge;default:0"`
	IsVariant      bool            `gorm:"column:is_variant;default:0"`
}

Message 消息表

func (Message) TableName

func (Message) TableName() string

TableName 设置表名

type MessageAttachment

type MessageAttachment struct {
	ID           uint64 `gorm:"primaryKey;column:id"`
	MessageID    string `gorm:"column:message_id;type:varchar(255)"`
	AttachmentID string `gorm:"column:attachment_id;type:varchar(255)"`
}

MessageAttachment 消息附件关联表

func (MessageAttachment) TableName

func (MessageAttachment) TableName() string

TableName 设置表名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL