ai优化,删除未使用代码,提取重复代码。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user