增加删除配置接口

This commit is contained in:
2021-12-01 14:15:05 +08:00
parent 9eb2fccd67
commit bf6d8adc4c
4 changed files with 87 additions and 0 deletions

View File

@ -97,6 +97,15 @@ func (b *base) Detail(dbInstance *gorm.DB, condition interface{}, result interfa
return dbInstance.First(result, condition).Error
}
// Delete 删除数据
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 12:24 下午 2021/12/1
func (b *base) Delete(dbInstance *gorm.DB, table string, primaryID int64, model interface{}) error {
return dbInstance.Table(table).Where("id = ?", primaryID).Delete(model).Error
}
// Count 查询数量
//
// Author : go_developer@163.com<白茶清欢>