diff --git a/server/admin/flow_apply/flow_apply_ctl.go b/server/admin/flow_apply/flow_apply_ctl.go index c51b1b4..f7a62b3 100644 --- a/server/admin/flow_apply/flow_apply_ctl.go +++ b/server/admin/flow_apply/flow_apply_ctl.go @@ -46,7 +46,7 @@ func (hd FlowApplyHandler) List(c *gin.Context) { // @Tags flow_apply-申请流程 // @Produce json // @Param Token header string true "token" -// @Param id query int false "" +// @Param id query int false "申请id" // @Success 200 {object} FlowApplyResp "成功" // @Router /api/flow_apply/detail [get] func (hd FlowApplyHandler) Detail(c *gin.Context) { @@ -92,7 +92,7 @@ func (hd FlowApplyHandler) Add(c *gin.Context) { // @Tags flow_apply-申请流程 // @Produce json // @Param Token header string true "token" -// @Param id body int false "" +// @Param id body int false "申请id" // @Param templateId body int false "模板" // @Param applyUserId body int false "申请人id" // @Param applyUserNickname body string false "申请人昵称" @@ -116,7 +116,7 @@ func (hd FlowApplyHandler) Edit(c *gin.Context) { // @Tags flow_apply-申请流程 // @Produce json // @Param Token header string true "token" -// @Param id body int false "" +// @Param id body int false "申请id" // @Success 200 {object} response.RespType "成功" // @Router /api/flow_apply/del [post] func (hd FlowApplyHandler) Del(c *gin.Context) { diff --git a/server/admin/flow_template/flow_template_ctl.go b/server/admin/flow_template/flow_template_ctl.go index c209e5d..3229d94 100644 --- a/server/admin/flow_template/flow_template_ctl.go +++ b/server/admin/flow_template/flow_template_ctl.go @@ -49,7 +49,7 @@ func (hd FlowTemplateHandler) ListAll(c *gin.Context) { // @Tags flow_template-流程模板 // @Produce json // @Param Token header string true "token" -// @Param id query int false "" +// @Param id query int false "历史id" // @Success 200 {object} FlowTemplateResp "成功" // @Router /api/flow_template/detail [get] func (hd FlowTemplateHandler) Detail(c *gin.Context) { @@ -84,7 +84,7 @@ func (hd FlowTemplateHandler) Add(c *gin.Context) { // @Tags flow_template-流程模板 // @Produce json // @Param Token header string true "token" -// @Param id body int false "" +// @Param id body int false "." // @Param flowName body string false "流程名称" // @Param flowGroup body int false "流程分类" // @Param flowRemark body string false "流程描述" @@ -104,7 +104,7 @@ func (hd FlowTemplateHandler) Edit(c *gin.Context) { // @Tags flow_template-流程模板 // @Produce json // @Param Token header string true "token" -// @Param id body int false "" +// @Param id body int false "历史id" // @Success 200 {object} response.RespType "成功" // @Router /api/flow_template/del [post] func (hd FlowTemplateHandler) Del(c *gin.Context) { diff --git a/server/generator/tpl_utils/templates/gocode/controller.go.tpl b/server/generator/tpl_utils/templates/gocode/controller.go.tpl index c568ee5..fe327bc 100644 --- a/server/generator/tpl_utils/templates/gocode/controller.go.tpl +++ b/server/generator/tpl_utils/templates/gocode/controller.go.tpl @@ -18,7 +18,7 @@ type {{{ title (toCamelCase .ModuleName) }}}Handler struct {} // @Param PageSize query int true "每页数量" {{{- range .Columns }}} {{{- if .IsQuery }}} -// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}" +// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- end }}} {{{- end }}} // @Success 200 {object} []{{{ title (toCamelCase .EntityName) }}}Resp "成功" @@ -53,7 +53,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ListAll(c *gin.Context // @Param Token header string true "token" {{{- range .Columns }}} {{{- if .IsPk }}} -// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}" +// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- end }}} {{{- end }}} // @Success 200 {object} {{{ title (toCamelCase .EntityName) }}}Resp "成功" @@ -74,7 +74,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Detail(c *gin.Context) // @Param Token header string true "token" {{{- range .Columns }}} {{{- if .IsInsert }}} -// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}" +// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- end }}} {{{- end }}} // @Success 200 {object} response.RespType "成功" @@ -92,7 +92,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Add(c *gin.Context) { // @Param Token header string true "token" {{{- range .Columns }}} {{{- if .IsEdit }}} -// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}" +// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- end }}} {{{- end }}} // @Success 200 {object} response.RespType "成功" @@ -110,7 +110,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Edit(c *gin.Context) { // @Param Token header string true "token" {{{- range .Columns }}} {{{- if .IsPk }}} -// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}" +// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- end }}} {{{- end }}} // @Success 200 {object} response.RespType "成功" diff --git a/server/main.go b/server/main.go index 4fc9187..269cf56 100644 --- a/server/main.go +++ b/server/main.go @@ -99,6 +99,10 @@ func main() { // 初始化router router := initRouter() router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) + + fmt.Println("格式化文档注释:", "swag fmt") + fmt.Println("生成文档:", "swag init") + fmt.Println("文档:", "http://localhost:8001/swagger/index.html") // 初始化server s := initServer(router)