ai优化,删除未使用代码,提取重复代码。

This commit is contained in:
2026-08-12 11:12:23 +08:00
parent 043bf8773b
commit 60869ec214
10 changed files with 108 additions and 201 deletions
-6
View File
@@ -201,12 +201,6 @@ func SetOptionValue(db *gorm.DB, name string, userID uint, value string) error {
return db.Create(&option).Error
}
// DeleteOption 删除配置项
func DeleteOption(db *gorm.DB, name string, userID uint) error {
result := db.Where("name = ? AND user_id = ?", name, userID).Delete(&Option{})
return result.Error
}
// GetOptionsByUser 获取用户的所有配置
func GetOptionsByUser(db *gorm.DB, userID uint) (map[string]string, error) {
var options []Option