File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
server/resource/autocode_template/server Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Con
54
54
return
55
55
}
56
56
{ {- end } }
57
- if err := { {.Abbreviation} }Service.Create{ {.StructName} }({ {.Abbreviation} }); err != nil {
57
+ if err := { {.Abbreviation} }Service.Create{ {.StructName} }(& { {.Abbreviation} }); err != nil {
58
58
global.GVA_LOG.Error(" 创建失败!" , zap.Error(err))
59
59
response.FailWithMessage(" 创建失败" , c)
60
60
} else {
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ type {{.StructName}}Service struct {
22
22
23
23
// Create{ {.StructName} } 创建{ {.StructName} }记录
24
24
// Author [piexlmax](https://github.com/piexlmax)
25
- func ({ {.Abbreviation} }Service *{ {.StructName} }Service) Create{ {.StructName} }({ {.Abbreviation} } { {.Package} }.{ {.StructName} }) (err error) {
26
- err = {{$db } }.Create(& { {.Abbreviation} }).Error
25
+ func ({ {.Abbreviation} }Service *{ {.StructName} }Service) Create{ {.StructName} }({ {.Abbreviation} } * { {.Package} }.{ {.StructName} }) (err error) {
26
+ err = {{$db } }.Create({ {.Abbreviation} }).Error
27
27
return err
28
28
}
29
29
You can’t perform that action at this time.
0 commit comments