修复生成的结构体 tag 字段错误以及其它注释和尾部空格问题 (#1968)
* 修复生成的结构体 tag 字段错误 * 移除字段注释多余尾部空格 * 文件模板注释 `@accept` 保持规范
This commit is contained in:
@@ -27,7 +27,7 @@ type {{.StructName}}Api struct {}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 创建{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body {{.Package}}.{{.StructName}} true "创建{{.Description}}"
|
||||
// @Success 200 {object} response.Response{msg=string} "创建成功"
|
||||
@@ -55,7 +55,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Con
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 删除{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body {{.Package}}.{{.StructName}} true "删除{{.Description}}"
|
||||
// @Success 200 {object} response.Response{msg=string} "删除成功"
|
||||
@@ -78,7 +78,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}(c *gin.Con
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 批量删除{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Success 200 {object} response.Response{msg=string} "批量删除成功"
|
||||
// @Router /{{.Abbreviation}}/delete{{.StructName}}ByIds [delete]
|
||||
@@ -100,7 +100,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}ByIds(c *gi
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 更新{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body {{.Package}}.{{.StructName}} true "更新{{.Description}}"
|
||||
// @Success 200 {object} response.Response{msg=string} "更新成功"
|
||||
@@ -128,7 +128,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 用id查询{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query {{.PrimaryField.FieldType}} true "用id查询{{.Description}}"
|
||||
// @Success 200 {object} response.Response{data={{.Package}}.{{.StructName}},msg=string} "查询成功"
|
||||
@@ -149,7 +149,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 分页获取{{.Description}}列表
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "获取成功"
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}List [get]
|
||||
@@ -167,7 +167,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Co
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 分页获取{{.Description}}列表
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表"
|
||||
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "获取成功"
|
||||
@@ -198,7 +198,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Co
|
||||
// Get{{.StructName}}DataSource 获取{{.StructName}}的数据源
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 获取{{.StructName}}的数据源
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Success 200 {object} response.Response{data=object,msg=string} "查询成功"
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}DataSource [get]
|
||||
@@ -219,7 +219,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}DataSource(c *
|
||||
// Get{{.StructName}}Public 不需要鉴权的{{.Description}}接口
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 不需要鉴权的{{.Description}}接口
|
||||
// @accept application/json
|
||||
// @Accept application/json
|
||||
// @Produce application/json
|
||||
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}Public [get]
|
||||
|
||||
Reference in New Issue
Block a user