Files
goodBaby/api/rule/tool.go
T
2026-04-05 22:28:38 +08:00

18 lines
349 B
Go

package rule
import (
"github.com/ssdomei232/goodBaby/handler/db"
"github.com/ssdomei232/goodBaby/model"
)
// 根据 ID 删除规则
func DeleteRuleByID(id uint, uid uint) error {
gormDB, err := db.GetGormDB()
if err != nil {
return err
}
result := gormDB.Where("id = ? AND uid = ?", id, uid).Delete(&model.Rule{})
return result.Error
}