完成重构数据库操作代码

This commit is contained in:
dushixiang
2021-03-19 20:22:04 +08:00
parent 25b8381a4f
commit 2eb4dc3969
37 changed files with 294 additions and 329 deletions

View File

@ -169,7 +169,7 @@ func (r AssetRepository) DeleteById(id string) error {
return r.DB.Where("id = ?", id).Delete(&model.Asset{}).Error
}
func (r AssetRepository) CountAsset() (total int64, err error) {
func (r AssetRepository) Count() (total int64, err error) {
err = r.DB.Find(&model.Asset{}).Count(&total).Error
return
}