feat: model expert catalog categories

This commit is contained in:
2026-07-23 14:07:13 +08:00
parent 51ee510112
commit 6844af321e
6 changed files with 126 additions and 26 deletions

View File

@@ -96,10 +96,17 @@ func (m *SenlinAgentAISession) BeforeCreate(tx *gorm.DB) error {
return resolveOptionalIdentity(tx, &SenlinAgentAIExpert{}, m.ExpertID, &m.ExpertIdentity)
}
func (m *SenlinAgentAIExpert) BeforeCreate(_ *gorm.DB) error {
func (m *SenlinAgentAIExpertCategory) BeforeCreate(_ *gorm.DB) error {
return ensureIdentity(&m.Identity)
}
func (m *SenlinAgentAIExpert) BeforeCreate(tx *gorm.DB) error {
if err := ensureIdentity(&m.Identity); err != nil {
return err
}
return resolveIdentity(tx, &SenlinAgentAIExpertCategory{}, m.CategoryID, &m.CategoryIdentity)
}
func (m *SenlinAgentTag) BeforeCreate(tx *gorm.DB) error {
if err := ensureIdentity(&m.Identity); err != nil {
return err