Skip to content

Commit

Permalink
Merge pull request #17 from sigam-Zq/main
Browse files Browse the repository at this point in the history
fix:修复模板关键字
  • Loading branch information
LyricTian authored Jan 22, 2024
2 parents e4be9cc + 20b70aa commit 1512a55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build

RELEASE_VERSION = v10.3.3
RELEASE_VERSION = v10.3.4

APP = gin-admin-cli
BIN = ${APP}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 5 additions & 5 deletions tpls/default/api.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"))
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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"))
Expand Down

0 comments on commit 1512a55

Please sign in to comment.