refactor: rename AI expert item model

This commit is contained in:
2026-07-23 14:11:17 +08:00
parent 6844af321e
commit f248cfd79e
9 changed files with 34 additions and 34 deletions

View File

@@ -92,10 +92,10 @@ func seedAIExperts(tx *gorm.DB) (map[string]int, error) {
if err != nil {
return nil, err
}
records := make([]SenlinAgentAIExpert, 0, len(catalog.Experts))
records := make([]SenlinAgentAIExpertItem, 0, len(catalog.Experts))
for _, expert := range catalog.Experts {
category := categories[expert.Category]
records = append(records, SenlinAgentAIExpert{
records = append(records, SenlinAgentAIExpertItem{
Slug: expert.Slug, CategoryID: category.ID, CategoryIdentity: category.Identity,
Category: expert.Category, CategoryName: expert.CategoryName,
Name: expert.Name, Description: expert.Description, Emoji: expert.Emoji,
@@ -120,7 +120,7 @@ func normalizeAIExpertCategories(tx *gorm.DB) (map[string]int, error) {
linked := 0
for _, expert := range catalog.Experts {
category := categories[expert.Category]
result := tx.Model(&SenlinAgentAIExpert{}).Where("slug = ?", expert.Slug).Updates(map[string]any{
result := tx.Model(&SenlinAgentAIExpertItem{}).Where("slug = ?", expert.Slug).Updates(map[string]any{
"category_id": category.ID,
"category_identity": category.Identity,
"reference": catalog.Reference,