Bladeren bron

修改“QueryArbitrageStrategy”接口传入参数

Simon Zhou 5 jaren geleden
bovenliggende
commit
7cabf574e8
4 gewijzigde bestanden met toevoegingen van 10 en 9 verwijderingen
  1. 4 3
      controllers/erms2/erms2.go
  2. 2 2
      docs/docs.go
  3. 2 2
      docs/swagger.json
  4. 2 2
      docs/swagger.yaml

+ 4 - 3
controllers/erms2/erms2.go

@@ -130,7 +130,8 @@ func QueryInnerTradeDetail(c *gin.Context) {
 
 // QueryArbitrageStrategyReq 查询期现套利策略表信息请求参数
 type QueryArbitrageStrategyReq struct {
-	AccountID    int `form:"accountid" binding:"required"`
+	// AccountID    int `form:"accountid" binding:"required"`
+	UserID       int `form:"userid" binding:"required"`
 	GoodsGroupID int `form:"goodsgroupid"`
 }
 
@@ -182,7 +183,7 @@ type QueryArbitrageStrategyRsp struct {
 // @Summary 查询期现套利策略表信息(指定资金账户、未结束的)
 // @Produce json
 // @Security ApiKeyAuth
-// @Param accountid query int true "资金账户"
+// @Param userid query int true "账户ID"
 // @Param goodsgroupid query string false "商品组ID(品种ID)"
 // @Success 200 {object} QueryArbitrageStrategyRsp
 // @Failure 500 {object} app.Response
@@ -245,7 +246,7 @@ func QueryArbitrageStrategy(c *gin.Context) {
 							t.UpdateTime
 						from ERMS2_ArbitrageStrategy t
 						left join ERMS2_ASAccount a on t.asapplyid = a.asapplyid
-						where t.StrategyStatus = 0 and a.accountid = %d`, req.AccountID)
+						where t.StrategyStatus = 0 and t.userid = %d`, req.UserID)
 	if req.GoodsGroupID > 0 {
 		sql += fmt.Sprintf(" and t.GoodsGroupID = %d", req.GoodsGroupID)
 	}

+ 2 - 2
docs/docs.go

@@ -436,8 +436,8 @@ var doc = `{
                 "parameters": [
                     {
                         "type": "integer",
-                        "description": "资金账户",
-                        "name": "accountid",
+                        "description": "账户ID",
+                        "name": "userid",
                         "in": "query",
                         "required": true
                     },

+ 2 - 2
docs/swagger.json

@@ -420,8 +420,8 @@
                 "parameters": [
                     {
                         "type": "integer",
-                        "description": "资金账户",
-                        "name": "accountid",
+                        "description": "账户ID",
+                        "name": "userid",
                         "in": "query",
                         "required": true
                     },

+ 2 - 2
docs/swagger.yaml

@@ -1336,9 +1336,9 @@ paths:
   /Erms2/QueryArbitrageStrategy:
     get:
       parameters:
-      - description: 资金账户
+      - description: 账户ID
         in: query
-        name: accountid
+        name: userid
         required: true
         type: integer
       - description: 商品组ID(品种ID)