From 875c40f4a9900ca63beebc28ef1abd075579693c Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 7 Nov 2024 19:39:26 +0800 Subject: [PATCH] update --- .../public_platoon/hdl_basic.go | 16 +++-- docs/docs.go | 67 ++++++++++++++++++- docs/swagger.json | 67 ++++++++++++++++++- docs/swagger.yaml | 46 ++++++++++++- 4 files changed, 181 insertions(+), 15 deletions(-) diff --git a/app/hdl/institutional_management/public_platoon/hdl_basic.go b/app/hdl/institutional_management/public_platoon/hdl_basic.go index 0d0ae76..efb3e12 100644 --- a/app/hdl/institutional_management/public_platoon/hdl_basic.go +++ b/app/hdl/institutional_management/public_platoon/hdl_basic.go @@ -16,7 +16,7 @@ import ( // @Accept json // @Produce json // @param Authorization header string true "验证参数Bearer和token空格拼接" -// @Success 200 {object} map[string]interface{} "用户数据" +// @Success 200 {object} public_platoon.GetPublicPlatoonBasicResp "具体数据" // @Failure 400 {object} md.Response "具体错误" // @Router /api/publicPlatoon/getBasic [get] func GetPublicPlatoonBasic(c *gin.Context) { @@ -27,7 +27,8 @@ func GetPublicPlatoonBasic(c *gin.Context) { return } - resp := public_platoon.GetPublicPlatoonBasicResp{ + var resp public_platoon.GetPublicPlatoonBasicResp + resp = public_platoon.GetPublicPlatoonBasicResp{ IsOpen: publicPlatoonBasic.IsOpen, OriginatorUid: publicPlatoonBasic.OriginatorUid, SeveralTimes: publicPlatoonBasic.SeveralTimes, @@ -48,7 +49,7 @@ func GetPublicPlatoonBasic(c *gin.Context) { // @Produce json // @param Authorization header string true "验证参数Bearer和token空格拼接" // @Param req body interface{} true "公排设置表单内容" -// @Success 200 {object} map[string]interface{} "修改数据条数" +// @Success 200 {string} "success" // @Failure 400 {object} md.Response "具体错误" // @Router /api/publicPlatoon/getBasic [post] func UpdatePublicPlatoonBasic(c *gin.Context) { @@ -72,11 +73,14 @@ func UpdatePublicPlatoonBasic(c *gin.Context) { } publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) - update, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(1, setting, "") + updateAffected, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(1, setting, "") if err != nil { e.OutErr(c, e.ERR_DB_ORM, err) return } - - e.OutSuc(c, update, nil) + if updateAffected <= 0 { + e.OutErr(c, e.ERR_DB_ORM, "更新数据表失败") + return + } + e.OutSuc(c, "success", nil) } diff --git a/docs/docs.go b/docs/docs.go index ad32c86..bd02e32 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -105,6 +105,42 @@ const docTemplate = `{ }, "/api/publicPlatoon/getBasic": { "get": { + "description": "公排基础设置(获取)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公排管理" + ], + "summary": "制度中心-公排管理-公排基础设置(获取)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体数据", + "schema": { + "$ref": "#/definitions/public_platoon.GetPublicPlatoonBasicResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + }, + "post": { "description": "公排基础设置(修改)", "consumes": [ "application/json" @@ -134,10 +170,9 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "修改数据条数", + "description": "success", "schema": { - "type": "object", - "additionalProperties": true + "type": "string" } }, "400": { @@ -195,6 +230,32 @@ const docTemplate = `{ "example": "具体错误原因" } } + }, + "public_platoon.GetPublicPlatoonBasicResp": { + "type": "object", + "properties": { + "is_open": { + "type": "integer" + }, + "is_self_active_get_team_revenue": { + "type": "integer" + }, + "originator_uid": { + "type": "integer" + }, + "several_rows": { + "type": "integer" + }, + "several_times": { + "type": "integer" + }, + "system_punish_replace": { + "type": "integer" + }, + "system_punish_replace_value": { + "type": "integer" + } + } } }, "securityDefinitions": { diff --git a/docs/swagger.json b/docs/swagger.json index 879222f..5aa60b0 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -98,6 +98,42 @@ }, "/api/publicPlatoon/getBasic": { "get": { + "description": "公排基础设置(获取)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公排管理" + ], + "summary": "制度中心-公排管理-公排基础设置(获取)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体数据", + "schema": { + "$ref": "#/definitions/public_platoon.GetPublicPlatoonBasicResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + }, + "post": { "description": "公排基础设置(修改)", "consumes": [ "application/json" @@ -127,10 +163,9 @@ ], "responses": { "200": { - "description": "修改数据条数", + "description": "success", "schema": { - "type": "object", - "additionalProperties": true + "type": "string" } }, "400": { @@ -188,6 +223,32 @@ "example": "具体错误原因" } } + }, + "public_platoon.GetPublicPlatoonBasicResp": { + "type": "object", + "properties": { + "is_open": { + "type": "integer" + }, + "is_self_active_get_team_revenue": { + "type": "integer" + }, + "originator_uid": { + "type": "integer" + }, + "several_rows": { + "type": "integer" + }, + "several_times": { + "type": "integer" + }, + "system_punish_replace": { + "type": "integer" + }, + "system_punish_replace_value": { + "type": "integer" + } + } } }, "securityDefinitions": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 7ae7cf6..4836563 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -30,6 +30,23 @@ definitions: example: 具体错误原因 type: string type: object + public_platoon.GetPublicPlatoonBasicResp: + properties: + is_open: + type: integer + is_self_active_get_team_revenue: + type: integer + originator_uid: + type: integer + several_rows: + type: integer + several_times: + type: integer + system_punish_replace: + type: integer + system_punish_replace_value: + type: integer + type: object host: localhost:4001 info: contact: @@ -98,6 +115,30 @@ paths: - 登录 /api/publicPlatoon/getBasic: get: + consumes: + - application/json + description: 公排基础设置(获取) + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体数据 + schema: + $ref: '#/definitions/public_platoon.GetPublicPlatoonBasicResp' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 制度中心-公排管理-公排基础设置(获取) + tags: + - 公排管理 + post: consumes: - application/json description: 公排基础设置(修改) @@ -116,10 +157,9 @@ paths: - application/json responses: "200": - description: 修改数据条数 + description: success schema: - additionalProperties: true - type: object + type: string "400": description: 具体错误 schema: