@@ -16,7 +16,7 @@ import ( | |||||
// @Accept json | // @Accept json | ||||
// @Produce json | // @Produce json | ||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | // @param Authorization header string true "验证参数Bearer和token空格拼接" | ||||
// @Success 200 {object} map[string]interface{} "用户数据" | |||||
// @Success 200 {object} public_platoon.GetPublicPlatoonBasicResp "具体数据" | |||||
// @Failure 400 {object} md.Response "具体错误" | // @Failure 400 {object} md.Response "具体错误" | ||||
// @Router /api/publicPlatoon/getBasic [get] | // @Router /api/publicPlatoon/getBasic [get] | ||||
func GetPublicPlatoonBasic(c *gin.Context) { | func GetPublicPlatoonBasic(c *gin.Context) { | ||||
@@ -27,7 +27,8 @@ func GetPublicPlatoonBasic(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
resp := public_platoon.GetPublicPlatoonBasicResp{ | |||||
var resp public_platoon.GetPublicPlatoonBasicResp | |||||
resp = public_platoon.GetPublicPlatoonBasicResp{ | |||||
IsOpen: publicPlatoonBasic.IsOpen, | IsOpen: publicPlatoonBasic.IsOpen, | ||||
OriginatorUid: publicPlatoonBasic.OriginatorUid, | OriginatorUid: publicPlatoonBasic.OriginatorUid, | ||||
SeveralTimes: publicPlatoonBasic.SeveralTimes, | SeveralTimes: publicPlatoonBasic.SeveralTimes, | ||||
@@ -48,7 +49,7 @@ func GetPublicPlatoonBasic(c *gin.Context) { | |||||
// @Produce json | // @Produce json | ||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | // @param Authorization header string true "验证参数Bearer和token空格拼接" | ||||
// @Param req body interface{} true "公排设置表单内容" | // @Param req body interface{} true "公排设置表单内容" | ||||
// @Success 200 {object} map[string]interface{} "修改数据条数" | |||||
// @Success 200 {string} "success" | |||||
// @Failure 400 {object} md.Response "具体错误" | // @Failure 400 {object} md.Response "具体错误" | ||||
// @Router /api/publicPlatoon/getBasic [post] | // @Router /api/publicPlatoon/getBasic [post] | ||||
func UpdatePublicPlatoonBasic(c *gin.Context) { | func UpdatePublicPlatoonBasic(c *gin.Context) { | ||||
@@ -72,11 +73,14 @@ func UpdatePublicPlatoonBasic(c *gin.Context) { | |||||
} | } | ||||
publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) | publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) | ||||
update, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(1, setting, "") | |||||
updateAffected, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(1, setting, "") | |||||
if err != nil { | if err != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err) | e.OutErr(c, e.ERR_DB_ORM, err) | ||||
return | return | ||||
} | } | ||||
e.OutSuc(c, update, nil) | |||||
if updateAffected <= 0 { | |||||
e.OutErr(c, e.ERR_DB_ORM, "更新数据表失败") | |||||
return | |||||
} | |||||
e.OutSuc(c, "success", nil) | |||||
} | } |
@@ -105,6 +105,42 @@ const docTemplate = `{ | |||||
}, | }, | ||||
"/api/publicPlatoon/getBasic": { | "/api/publicPlatoon/getBasic": { | ||||
"get": { | "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": "公排基础设置(修改)", | "description": "公排基础设置(修改)", | ||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
@@ -134,10 +170,9 @@ const docTemplate = `{ | |||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "修改数据条数", | |||||
"description": "success", | |||||
"schema": { | "schema": { | ||||
"type": "object", | |||||
"additionalProperties": true | |||||
"type": "string" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -195,6 +230,32 @@ const docTemplate = `{ | |||||
"example": "具体错误原因" | "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": { | "securityDefinitions": { | ||||
@@ -98,6 +98,42 @@ | |||||
}, | }, | ||||
"/api/publicPlatoon/getBasic": { | "/api/publicPlatoon/getBasic": { | ||||
"get": { | "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": "公排基础设置(修改)", | "description": "公排基础设置(修改)", | ||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
@@ -127,10 +163,9 @@ | |||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "修改数据条数", | |||||
"description": "success", | |||||
"schema": { | "schema": { | ||||
"type": "object", | |||||
"additionalProperties": true | |||||
"type": "string" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -188,6 +223,32 @@ | |||||
"example": "具体错误原因" | "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": { | "securityDefinitions": { | ||||
@@ -30,6 +30,23 @@ definitions: | |||||
example: 具体错误原因 | example: 具体错误原因 | ||||
type: string | type: string | ||||
type: object | 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 | host: localhost:4001 | ||||
info: | info: | ||||
contact: | contact: | ||||
@@ -98,6 +115,30 @@ paths: | |||||
- 登录 | - 登录 | ||||
/api/publicPlatoon/getBasic: | /api/publicPlatoon/getBasic: | ||||
get: | 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: | consumes: | ||||
- application/json | - application/json | ||||
description: 公排基础设置(修改) | description: 公排基础设置(修改) | ||||
@@ -116,10 +157,9 @@ paths: | |||||
- application/json | - application/json | ||||
responses: | responses: | ||||
"200": | "200": | ||||
description: 修改数据条数 | |||||
description: success | |||||
schema: | schema: | ||||
additionalProperties: true | |||||
type: object | |||||
type: string | |||||
"400": | "400": | ||||
description: 具体错误 | description: 具体错误 | ||||
schema: | schema: | ||||