refactor: rename AI expert item model
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user