From eaa135e2ad90a5e7819477b2a5beacfcbf3dc469 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Dec 2020 22:04:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor=F0=9F=8E=A8=20=EF=BC=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v3/dto.go.template | 2 +- template/v3/no_actions/apis.go.template | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/template/v3/dto.go.template b/template/v3/dto.go.template index 33b2c54b..5287afce 100644 --- a/template/v3/dto.go.template +++ b/template/v3/dto.go.template @@ -45,7 +45,7 @@ type {{.ClassName}}Control struct { {{ range .Columns -}} {{$x := .Pk}} {{- if ($x) }} - {{.GoField}} uint `uri:"{{.JsonField}}" comment:"{{.ColumnComment}}"` // {{.ColumnComment}} + {{.GoField}} {{.GoType}} `uri:"{{.JsonField}}" comment:"{{.ColumnComment}}"` // {{.ColumnComment}} {{- else if eq .GoField "CreatedAt" -}} {{- else if eq .GoField "UpdatedAt" -}} {{- else if eq .GoField "DeletedAt" -}} diff --git a/template/v3/no_actions/apis.go.template b/template/v3/no_actions/apis.go.template index 3966ab35..70437f5d 100644 --- a/template/v3/no_actions/apis.go.template +++ b/template/v3/no_actions/apis.go.template @@ -109,7 +109,7 @@ func (e *{{.ClassName}}) Insert{{.ClassName}}(c *gin.Context) { return } // 设置创建人 - object.SetCreateBy(tools.GetUserIdUint(c)) + object.SetCreateBy(tools.GetUserId(c)) service{{.ClassName}} := service.{{.ClassName}}{} service{{.ClassName}}.Orm = db @@ -146,7 +146,7 @@ func (e *{{.ClassName}}) Update{{.ClassName}}(c *gin.Context) { e.Error(c, http.StatusInternalServerError, err, "模型生成失败") return } - object.SetUpdateBy(tools.GetUserIdUint(c)) + object.SetUpdateBy(tools.GetUserId(c)) //数据权限检查 p := actions.GetPermissionFromContext(c) @@ -187,7 +187,7 @@ func (e *{{.ClassName}}) Delete{{.ClassName}}(c *gin.Context) { } // 设置编辑人 - object.SetUpdateBy(tools.GetUserIdUint(c)) + object.SetUpdateBy(tools.GetUserId(c)) // 数据权限检查 p := actions.GetPermissionFromContext(c)