zhou.xiaoning пре 2 година
родитељ
комит
bcd889c335
5 измењених фајлова са 70 додато и 45 уклоњено
  1. 4 4
      controllers/guangzuan/tradeService.go
  2. 7 8
      controllers/user/user.go
  3. 22 12
      docs/docs.go
  4. 22 12
      docs/swagger.json
  5. 15 9
      docs/swagger.yaml

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 7 - 8
controllers/user/user.go

@@ -247,7 +247,7 @@ type LoginQueryRsp struct {
 // @Security ApiKeyAuth
 // @Param    loginID query    int true "登录账号"
 // @Success  200     {object} LoginQueryRsp
-// @Failure  500     {object} app.Response
+// @Failure  500  {object} app.Response
 // @Router   /User/LoginQuery [get]
 // @Tags     用户信息
 func LoginQuery(c *gin.Context) {
@@ -432,7 +432,7 @@ type UpdateUserFavoriteGoodsReq struct {
 // @Security ApiKeyAuth
 // @Param    userID  query    int true "用户ID"
 // @Param    goodsID query    int true "商品ID"
-// @Success  200     {object} app.Response
+// @Success  200  {object} app.Response
 // @Failure  500     {object} app.Response
 // @Router   /User/AddUserFavoriteGoods [post]
 // @Tags     用户信息
@@ -581,7 +581,7 @@ type UpdateUserAccountStatusReq struct {
 // @Summary  更新用户状态
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    userID  query    int    true "用户ID"
+// @Param    userID        query    int true "用户ID"
 // @Param    accountStatus query    int true "账户状态 -  4:正常 6:注销(停用)"
 // @Success  200     {object} app.Response
 // @Failure  500     {object} app.Response
@@ -612,16 +612,15 @@ func UpdateUserAccountStatus(c *gin.Context) {
 
 // UpdateUserHeadUrlReq 更新用户头像请求参数
 type UpdateUserHeadUrlReq struct {
-	UserID  int    `form:"userID" binding:"required"`
-	Headurl string `form:"headurl" binding:"required"`
+	UserID  int    `json:"userID" binding:"required"`
+	Headurl string `json:"headurl" binding:"required"`
 }
 
 // UpdateUserHeadUrl 更新用户头像
 // @Summary  更新用户头像
 // @Produce json
 // @Security ApiKeyAuth
-// @Param    userID        query    int true "用户ID"
-// @Param    headurl query    string true "头像地址"
+// @Param    data body     UpdateUserHeadUrlReq true "入参"
 // @Success  200           {object} app.Response
 // @Failure  500           {object} app.Response
 // @Router   /User/UpdateUserHeadUrl [post]
@@ -631,7 +630,7 @@ func UpdateUserHeadUrl(c *gin.Context) {
 
 	// 获取请求参数
 	var req UpdateUserHeadUrlReq
-	if err := appG.C.ShouldBind(&req); err != nil {
+	if err := appG.C.ShouldBindJSON(&req); err != nil {
 		logger.GetLogger().Errorf("UpdateUserHeadUrlReq failed: %s", err.Error())
 		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
 		return

+ 22 - 12
docs/docs.go

@@ -16526,18 +16526,13 @@ const docTemplate = `{
                 "summary": "更新用户头像",
                 "parameters": [
                     {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userID",
-                        "in": "query",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "头像地址",
-                        "name": "headurl",
-                        "in": "query",
-                        "required": true
+                        "description": "入参",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/user.UpdateUserHeadUrlReq"
+                        }
                     }
                 ],
                 "responses": {
@@ -54149,6 +54144,21 @@ const docTemplate = `{
                     "type": "string"
                 }
             }
+        },
+        "user.UpdateUserHeadUrlReq": {
+            "type": "object",
+            "required": [
+                "headurl",
+                "userID"
+            ],
+            "properties": {
+                "headurl": {
+                    "type": "string"
+                },
+                "userID": {
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 22 - 12
docs/swagger.json

@@ -16517,18 +16517,13 @@
                 "summary": "更新用户头像",
                 "parameters": [
                     {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userID",
-                        "in": "query",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "头像地址",
-                        "name": "headurl",
-                        "in": "query",
-                        "required": true
+                        "description": "入参",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/user.UpdateUserHeadUrlReq"
+                        }
                     }
                 ],
                 "responses": {
@@ -54140,6 +54135,21 @@
                     "type": "string"
                 }
             }
+        },
+        "user.UpdateUserHeadUrlReq": {
+            "type": "object",
+            "required": [
+                "headurl",
+                "userID"
+            ],
+            "properties": {
+                "headurl": {
+                    "type": "string"
+                },
+                "userID": {
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 15 - 9
docs/swagger.yaml

@@ -25951,6 +25951,16 @@ definitions:
         description: 用户姓名
         type: string
     type: object
+  user.UpdateUserHeadUrlReq:
+    properties:
+      headurl:
+        type: string
+      userID:
+        type: integer
+    required:
+    - headurl
+    - userID
+    type: object
 info:
   contact: {}
   description: 新的查询服务,替代原通用查询服务。游客Token:c886a057f3d820d4dbc41473686c7c2d
@@ -36350,16 +36360,12 @@ paths:
   /User/UpdateUserHeadUrl:
     post:
       parameters:
-      - description: 用户ID
-        in: query
-        name: userID
-        required: true
-        type: integer
-      - description: 头像地址
-        in: query
-        name: headurl
+      - description: 入参
+        in: body
+        name: data
         required: true
-        type: string
+        schema:
+          $ref: '#/definitions/user.UpdateUserHeadUrlReq'
       produces:
       - application/json
       responses: