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)