Browse Source

接口“QueryInnerTradeDetail” 增加 “Updatetime”字段

Simon Zhou 5 years ago
parent
commit
b752a47c0d
4 changed files with 21 additions and 8 deletions
  1. 10 8
      controllers/erms2/erms2.go
  2. 4 0
      docs/docs.go
  3. 4 0
      docs/swagger.json
  4. 3 0
      docs/swagger.yaml

+ 10 - 8
controllers/erms2/erms2.go

@@ -32,13 +32,14 @@ type QueryInnerTradeDetailRsp struct {
 	Closetype         int64     `json:"closetype"  xorm:"'CLOSETYPE'"`                    // 平仓方式 - 0:无 1:平今 2:平昨
 	Relatedouttradeid int64     `json:"relatedouttradeid"  xorm:"'RELATEDOUTTRADEID'"`    // 关联外部成交单ID
 
-	Asapplyid      int64  `json:"asapplyid"  xorm:"'ASAPPLYID'" binding:"required"` // 策略申请ID
-	Detailtype     int64  `json:"detailtype"  xorm:"'DETAILTYPE'"`                  // 明细类型 - 1:套利对冲 2:期货换月 3:期货仓位调整
-	Spotcontractid int64  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`          // 现货合同ID [1:套利对冲 为合同ID,2:期货换月\3:期货仓位调整时为0]
-	Asno           string `json:"asno"  xorm:"'ASNO'"`                              // 策略编号
-	Asname         string `json:"asname"  xorm:"'ASNAME'"`                          // 策略名称
-	Spotcontractno string `json:"spotcontractno"  xorm:"'SPOTCONTRACTNO'"`          // 现货合同编号
-	Remark         string `json:"remark"  xorm:"'REMARK'"`                          // 备注
+	Asapplyid      int64     `json:"asapplyid"  xorm:"'ASAPPLYID'" binding:"required"` // 策略申请ID
+	Detailtype     int64     `json:"detailtype"  xorm:"'DETAILTYPE'"`                  // 明细类型 - 1:套利对冲 2:期货换月 3:期货仓位调整
+	Spotcontractid int64     `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`          // 现货合同ID [1:套利对冲 为合同ID,2:期货换月\3:期货仓位调整时为0]
+	Asno           string    `json:"asno"  xorm:"'ASNO'"`                              // 策略编号
+	Asname         string    `json:"asname"  xorm:"'ASNAME'"`                          // 策略名称
+	Spotcontractno string    `json:"spotcontractno"  xorm:"'SPOTCONTRACTNO'"`          // 现货合同编号
+	Remark         string    `json:"remark"  xorm:"'REMARK'"`                          // 备注
+	Updatetime     time.Time `json:"updatetime"  xorm:"'UPDATETIME'"`                  // 更新时间
 
 	Goodscode      string  `json:"goodscode"  xorm:"'GOODSCODE'" binding:"required"`           // 商品代码(合约)
 	Goodsname      string  `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"`           // 商品名称(合约)
@@ -75,7 +76,7 @@ func QueryInnerTradeDetail(c *gin.Context) {
 	// 查询数据
 	engine := db.GetEngine()
 	datas := make([]QueryInnerTradeDetailRsp, 0)
-	sql := fmt.Sprintf(`sselect
+	sql := fmt.Sprintf(`select
 							t.Tradeid,
 							t.Buyorsell,
 							t.Orderid,
@@ -92,6 +93,7 @@ func QueryInnerTradeDetail(c *gin.Context) {
 							ast.Detailtype,
 							ast.Spotcontractid,
 							ast.Remark,
+							ast.Updatetime,
 							asd.Asno,
 							asd.ASName,
 							sc.contractno Spotcontractno,

+ 4 - 0
docs/docs.go

@@ -1834,6 +1834,10 @@ var doc = `{
                 "tradetime": {
                     "description": "成交时间",
                     "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
                 }
             }
         },

+ 4 - 0
docs/swagger.json

@@ -1818,6 +1818,10 @@
                 "tradetime": {
                     "description": "成交时间",
                     "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
                 }
             }
         },

+ 3 - 0
docs/swagger.yaml

@@ -931,6 +931,9 @@ definitions:
       tradetime:
         description: 成交时间
         type: string
+      updatetime:
+        description: 更新时间
+        type: string
     required:
     - asapplyid
     - buyorsell