feat: integrate NOFXi agent into dev

This commit is contained in:
lky-spec
2026-04-18 16:06:42 +08:00
parent 851f152c50
commit 5c4e7502d7
76 changed files with 17714 additions and 1082 deletions

View File

@@ -303,3 +303,16 @@ func (s *AIModelStore) Create(userID, id, name, provider string, enabled bool, a
// Use FirstOrCreate to ignore if already exists
return s.db.Where("id = ?", id).FirstOrCreate(model).Error
}
// Delete removes a user-owned AI model configuration.
func (s *AIModelStore) Delete(userID, id string) error {
result := s.db.Where("user_id = ? AND id = ?", userID, id).Delete(&AIModel{})
if result.Error != nil {
return result.Error
}
if result.RowsAffected == 0 {
return fmt.Errorf("ai model not found: id=%s, userID=%s", id, userID)
}
logger.Infof("🗑️ Deleted AI model: id=%s, userID=%s", id, userID)
return nil
}