包容网关 流转参数模式设定
This commit is contained in:
@@ -78,7 +78,7 @@ func Delete{{.StructName}}ByIds(c *gin.Context) {
|
||||
func Update{{.StructName}}(c *gin.Context) {
|
||||
var {{.Abbreviation}} model.{{.StructName}}
|
||||
_ = c.ShouldBindJSON(&{{.Abbreviation}})
|
||||
if err := service.Update{{.StructName}}(&{{.Abbreviation}}); err != nil {
|
||||
if err := service.Update{{.StructName}}({{.Abbreviation}}); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("更新失败", c)
|
||||
} else {
|
||||
|
||||
@@ -45,8 +45,8 @@ func Delete{{.StructName}}ByIds(ids request.IdsReq) (err error) {
|
||||
//@param: {{.Abbreviation}} *model.{{.StructName}}
|
||||
//@return: err error
|
||||
|
||||
func Update{{.StructName}}({{.Abbreviation}} *model.{{.StructName}}) (err error) {
|
||||
err = global.GVA_DB.Save({{.Abbreviation}}).Error
|
||||
func Update{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) {
|
||||
err = global.GVA_DB.Save(&{{.Abbreviation}}).Error
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user