@@ -6,67 +6,43 @@ import (
66 "gin-vue-admin/model/request"
77)
88
9- //@author: [piexlmax](https://github.com/piexlmax)
10- //@function: Create{ {.StructName} }
11- //@description: 创建{ {.StructName} }记录
12- //@param: { {.Abbreviation} } model.{ {.StructName} }
13- //@return: err error
14-
9+ // Create{ {.StructName} } 创建{ {.StructName} }记录
10+ // Author [piexlmax](https://github.com/piexlmax)
1511func Create{ {.StructName} }({ {.Abbreviation} } model.{ {.StructName} }) (err error) {
1612 err = global.GVA_DB.Create(&{{.Abbreviation} }).Error
1713 return err
1814}
1915
20- //@author: [piexlmax](https://github.com/piexlmax)
21- //@function: Delete{ {.StructName} }
22- //@description: 删除{ {.StructName} }记录
23- //@param: { {.Abbreviation} } model.{ {.StructName} }
24- //@return: err error
25-
16+ // Delete{ {.StructName} } 删除{ {.StructName} }记录
17+ // Author [piexlmax](https://github.com/piexlmax)
2618func Delete{ {.StructName} }({ {.Abbreviation} } model.{ {.StructName} }) (err error) {
2719 err = global.GVA_DB.Delete(&{{.Abbreviation} }).Error
2820 return err
2921}
3022
31- //@author: [piexlmax](https://github.com/piexlmax)
32- //@function: Delete{ {.StructName} }ByIds
33- //@description: 批量删除{ {.StructName} }记录
34- //@param: ids request.IdsReq
35- //@return: err error
36-
23+ // Delete{ {.StructName} }ByIds 批量删除{ {.StructName} }记录
24+ // Author [piexlmax](https://github.com/piexlmax)
3725func Delete{ {.StructName} }ByIds(ids request.IdsReq) (err error) {
3826 err = global.GVA_DB.Delete(&[]model.{{.StructName} }{ } ,"id in ?",ids.Ids).Error
3927 return err
4028}
4129
42- //@author: [piexlmax](https://github.com/piexlmax)
43- //@function: Update{ {.StructName} }
44- //@description: 更新{ {.StructName} }记录
45- //@param: { {.Abbreviation} } *model.{ {.StructName} }
46- //@return: err error
47-
30+ // Update{ {.StructName} } 更新{ {.StructName} }记录
31+ // Author [piexlmax](https://github.com/piexlmax)
4832func Update{ {.StructName} }({ {.Abbreviation} } model.{ {.StructName} }) (err error) {
4933 err = global.GVA_DB.Save(&{{.Abbreviation} }).Error
5034 return err
5135}
5236
53- //@author: [piexlmax](https://github.com/piexlmax)
54- //@function: Get{ {.StructName} }
55- //@description: 根据id获取{ {.StructName} }记录
56- //@param: id uint
57- //@return: err error, { {.Abbreviation} } model.{ {.StructName} }
58-
37+ // Get{ {.StructName} } 根据id获取{ {.StructName} }记录
38+ // Author [piexlmax](https://github.com/piexlmax)
5939func Get{ {.StructName} }(id uint) (err error, { {.Abbreviation} } model.{ {.StructName} }) {
6040 err = global.GVA_DB.Where(" id = ?" , id).First(&{{.Abbreviation} }).Error
6141 return
6242}
6343
64- //@author: [piexlmax](https://github.com/piexlmax)
65- //@function: Get{ {.StructName} }InfoList
66- //@description: 分页获取{ {.StructName} }记录
67- //@param: info request.{ {.StructName} }Search
68- //@return: err error, list interface{ } , total int64
69-
44+ // Get{ {.StructName} }InfoList 分页获取{ {.StructName} }记录
45+ // Author [piexlmax](https://github.com/piexlmax)
7046func Get{ {.StructName} }InfoList(info request.{ {.StructName} }Search) (err error, list interface{ } , total int64) {
7147 limit := info.PageSize
7248 offset := info.PageSize * (info.Page - 1)
@@ -102,4 +78,4 @@ func Get{{.StructName}}InfoList(info request.{{.StructName}}Search) (err error,
10278 err = db.Count(&total).Error
10379 err = db.Limit(limit).Offset(offset).Find(& { {.Abbreviation} }s).Error
10480 return err, { {.Abbreviation} }s, total
105- }
81+ }
0 commit comments