diff --git a/Makefile b/Makefile index ad451bc..6c4075d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: build -RELEASE_VERSION = v10.3.3 +RELEASE_VERSION = v10.3.4 APP = gin-admin-cli BIN = ${APP} diff --git a/main.go b/main.go index 3285ce3..ccd267c 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( //go:embed tpls var f embed.FS -var VERSION = "v10.3.3" +var VERSION = "v10.3.4" func main() { defer func() { diff --git a/tpls/default/api.go.tpl b/tpls/default/api.go.tpl index 0bd0d47..7a2d5c9 100644 --- a/tpls/default/api.go.tpl +++ b/tpls/default/api.go.tpl @@ -31,7 +31,7 @@ type {{$name}} struct { // @Success 200 {object} util.ResponseResult{data=[]schema.{{$name}}} // @Failure 401 {object} util.ResponseResult // @Failure 500 {object} util.ResponseResult -// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .ModuleName}}/{{end}}{{lowerHyphensPlural .Name}} [get] +// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .Module}}/{{end}}{{lowerHyphensPlural .Name}} [get] func (a *{{$name}}) Query(c *gin.Context) { ctx := c.Request.Context() var params schema.{{$name}}QueryParam @@ -55,7 +55,7 @@ func (a *{{$name}}) Query(c *gin.Context) { // @Success 200 {object} util.ResponseResult{data=schema.{{$name}}} // @Failure 401 {object} util.ResponseResult // @Failure 500 {object} util.ResponseResult -// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .ModuleName}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [get] +// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .Module}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [get] func (a *{{$name}}) Get(c *gin.Context) { ctx := c.Request.Context() item, err := a.{{$name}}BIZ.Get(ctx, c.Param("id")) @@ -74,7 +74,7 @@ func (a *{{$name}}) Get(c *gin.Context) { // @Failure 400 {object} util.ResponseResult // @Failure 401 {object} util.ResponseResult // @Failure 500 {object} util.ResponseResult -// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .ModuleName}}/{{end}}{{lowerHyphensPlural .Name}} [post] +// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .Module}}/{{end}}{{lowerHyphensPlural .Name}} [post] func (a *{{$name}}) Create(c *gin.Context) { ctx := c.Request.Context() item := new(schema.{{$name}}Form) @@ -103,7 +103,7 @@ func (a *{{$name}}) Create(c *gin.Context) { // @Failure 400 {object} util.ResponseResult // @Failure 401 {object} util.ResponseResult // @Failure 500 {object} util.ResponseResult -// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .ModuleName}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [put] +// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .Module}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [put] func (a *{{$name}}) Update(c *gin.Context) { ctx := c.Request.Context() item := new(schema.{{$name}}Form) @@ -130,7 +130,7 @@ func (a *{{$name}}) Update(c *gin.Context) { // @Success 200 {object} util.ResponseResult // @Failure 401 {object} util.ResponseResult // @Failure 500 {object} util.ResponseResult -// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .ModuleName}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [delete] +// @Router /api/v1/{{if .FillRouterPrefix}}{{lower .Module}}/{{end}}{{lowerHyphensPlural .Name}}/{id} [delete] func (a *{{$name}}) Delete(c *gin.Context) { ctx := c.Request.Context() err := a.{{$name}}BIZ.Delete(ctx, c.Param("id"))