refactor: shorten model and table prefixes

This commit is contained in:
2026-07-23 14:30:17 +08:00
parent 6e7be2f3a4
commit 0ca2898ac0
71 changed files with 707 additions and 638 deletions

View File

@@ -2,29 +2,29 @@ package models
import "time"
// SenlinAgentAIExpertItem 是本地专家库中的可选 AI 角色。
type SenlinAgentAIExpertItem struct {
ID uint `gorm:"primaryKey"`
Identity string `gorm:"type:char(36);uniqueIndex"`
Slug string `gorm:"size:160;uniqueIndex;not null"`
CategoryID uint `gorm:"index"`
CategoryIdentity string `gorm:"type:char(36);index"`
ExpertCategory SenlinAgentAIExpertCategory `gorm:"foreignKey:CategoryID"`
Category string `gorm:"size:80;index;not null"`
CategoryName string `gorm:"size:120;not null"`
Name string `gorm:"size:160;index;not null"`
Description string `gorm:"type:text;not null"`
Emoji string `gorm:"size:32"`
Color string `gorm:"size:32"`
SystemPrompt string `gorm:"type:text;not null"`
Source string `gorm:"size:255;not null"`
Reference string `gorm:"size:255"`
SourceLicense string `gorm:"size:32;not null"`
Enabled bool `gorm:"not null;default:true;index"`
// SaAIExpertItem 是本地专家库中的可选 AI 角色。
type SaAIExpertItem struct {
ID uint `gorm:"primaryKey"`
Identity string `gorm:"type:char(36);uniqueIndex"`
Slug string `gorm:"size:160;uniqueIndex;not null"`
CategoryID uint `gorm:"index"`
CategoryIdentity string `gorm:"type:char(36);index"`
ExpertCategory SaAIExpertCategory `gorm:"foreignKey:CategoryID"`
Category string `gorm:"size:80;index;not null"`
CategoryName string `gorm:"size:120;not null"`
Name string `gorm:"size:160;index;not null"`
Description string `gorm:"type:text;not null"`
Emoji string `gorm:"size:32"`
Color string `gorm:"size:32"`
SystemPrompt string `gorm:"type:text;not null"`
Source string `gorm:"size:255;not null"`
Reference string `gorm:"size:255"`
SourceLicense string `gorm:"size:32;not null"`
Enabled bool `gorm:"not null;default:true;index"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (SenlinAgentAIExpertItem) TableName() string {
return "senlin_agent_ai_experts"
func (SaAIExpertItem) TableName() string {
return "sa_ai_experts"
}