Explorar o código

增加订单查询接口出参

zhou.xiaoning %!s(int64=2) %!d(string=hai) anos
pai
achega
c95ac5d188
Modificáronse 7 ficheiros con 61 adicións e 36 borrados
  1. 4 4
      controllers/guangzuan/tradeService.go
  2. 4 0
      docs/docs.go
  3. 4 0
      docs/swagger.json
  4. 3 0
      docs/swagger.yaml
  5. 2 0
      models/sbyj.go
  6. 43 32
      pb/mtp2.pb.go
  7. 1 0
      pb/mtp2.proto

+ 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]

+ 4 - 0
docs/docs.go

@@ -52245,6 +52245,10 @@ const docTemplate = `{
                     "type": "string",
                     "example": "0"
                 },
+                "tradeTime": {
+                    "description": "交易时间",
+                    "type": "string"
+                },
                 "userID": {
                     "description": "用户ID",
                     "type": "integer"

+ 4 - 0
docs/swagger.json

@@ -52236,6 +52236,10 @@
                     "type": "string",
                     "example": "0"
                 },
+                "tradeTime": {
+                    "description": "交易时间",
+                    "type": "string"
+                },
                 "userID": {
                     "description": "用户ID",
                     "type": "integer"

+ 3 - 0
docs/swagger.yaml

@@ -22855,6 +22855,9 @@ definitions:
         description: 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
         example: "0"
         type: string
+      tradeTime:
+        description: 交易时间
+        type: string
       userID:
         description: 用户ID
         type: integer

+ 2 - 0
models/sbyj.go

@@ -112,6 +112,7 @@ type TradeHolderDetailEx struct {
 	FloatPL           float64 `json:"floatPL"`           // 浮动盈亏
 	DepositRate       float64 `json:"depositRate"`       // 订单定金率
 	RefundableDeposit float64 `json:"refundableDeposit"` // 可退定金
+	TradeTime         string  `json:"tradeTime"`         // 交易时间
 }
 
 // RedisTradeHolderDetailEx redis存储交易持仓扩展表
@@ -214,6 +215,7 @@ func (r *RedisTradeHolderDetailEx) ParseFromProto(p *pb.RedisTradeHolderDetailEx
 		FloatPL:           p.GetTHDetailEx().GetFloatPL(),
 		DepositRate:       p.GetTHDetailEx().GetDepositRate(),
 		RefundableDeposit: p.GetTHDetailEx().GetRefundableDeposit(),
+		TradeTime:         p.GetTHDetailEx().GetTradeTime().GetDateStr(),
 	}
 
 	// 单位

+ 43 - 32
pb/mtp2.pb.go

@@ -2095,6 +2095,7 @@ type TradeHolderDetailEx struct {
 	FloatPL           *float64 `protobuf:"fixed64,30,opt,name=FloatPL" json:"FloatPL,omitempty"`                     // 浮动盈亏
 	DepositRate       *float64 `protobuf:"fixed64,31,opt,name=DepositRate" json:"DepositRate,omitempty"`             // 订单定金率
 	RefundableDeposit *float64 `protobuf:"fixed64,32,opt,name=RefundableDeposit" json:"RefundableDeposit,omitempty"` // 可退定金
+	TradeTime         *Date    `protobuf:"bytes,34,opt,name=TradeTime" json:"TradeTime,omitempty"`                   //交易时间
 }
 
 func (x *TradeHolderDetailEx) Reset() {
@@ -2353,6 +2354,13 @@ func (x *TradeHolderDetailEx) GetRefundableDeposit() float64 {
 	return 0
 }
 
+func (x *TradeHolderDetailEx) GetTradeTime() *Date {
+	if x != nil {
+		return x.TradeTime
+	}
+	return nil
+}
+
 // RedisTradeHolderDetailEx redis存储交易持仓扩展表
 type RedisTradeHolderDetailEx struct {
 	state         protoimpl.MessageState
@@ -2923,7 +2931,7 @@ var file_mtp2_proto_rawDesc = []byte{
 	0x61, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4d, 0x69, 0x64, 0x64, 0x6c,
 	0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x47, 0x6f,
 	0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0d, 0x52,
-	0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x22, 0xb1, 0x08, 0x0a,
+	0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x22, 0xd9, 0x08, 0x0a,
 	0x13, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
 	0x69, 0x6c, 0x45, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x64, 0x65, 0x49, 0x44, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x54, 0x72, 0x61, 0x64, 0x65, 0x49, 0x44, 0x12, 0x1c,
@@ -2991,31 +2999,33 @@ var file_mtp2_proto_rawDesc = []byte{
 	0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65,
 	0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x52,
 	0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
-	0x22, 0x81, 0x03, 0x0a, 0x18, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48,
-	0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x37, 0x0a,
-	0x0a, 0x54, 0x48, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64,
-	0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x52, 0x0a, 0x54, 0x48, 0x44, 0x65,
-	0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50,
-	0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50, 0x4c,
-	0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61,
-	0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65,
-	0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x52,
-	0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
-	0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c,
-	0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b,
-	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28,
-	0x0d, 0x52, 0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x12, 0x1c,
-	0x0a, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
-	0x01, 0x52, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c,
-	0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01,
-	0x28, 0x0d, 0x52, 0x0c, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x63, 0x65,
-	0x12, 0x22, 0x0a, 0x0c, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x4d, 0x69, 0x6e, 0x55, 0x6e, 0x69, 0x74,
-	0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x4d, 0x69, 0x6e,
-	0x55, 0x6e, 0x69, 0x74,
+	0x12, 0x26, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x64, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x22, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x09, 0x54,
+	0x72, 0x61, 0x64, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x81, 0x03, 0x0a, 0x18, 0x52, 0x65, 0x64,
+	0x69, 0x73, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74,
+	0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x37, 0x0a, 0x0a, 0x54, 0x48, 0x44, 0x65, 0x74, 0x61, 0x69,
+	0x6c, 0x45, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x54,
+	0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
+	0x45, 0x78, 0x52, 0x0a, 0x54, 0x48, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x18,
+	0x0a, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52,
+	0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50, 0x4c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6f,
+	0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x44,
+	0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x52, 0x65,
+	0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c,
+	0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64,
+	0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f,
+	0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e,
+	0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73,
+	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69,
+	0x74, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73,
+	0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65, 0x55,
+	0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65,
+	0x55, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50,
+	0x6c, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x44, 0x65, 0x63, 0x69,
+	0x6d, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x51, 0x75, 0x6f, 0x74,
+	0x65, 0x4d, 0x69, 0x6e, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c,
+	0x51, 0x75, 0x6f, 0x74, 0x65, 0x4d, 0x69, 0x6e, 0x55, 0x6e, 0x69, 0x74,
 }
 
 var (
@@ -3065,12 +3075,13 @@ var file_mtp2_proto_depIdxs = []int32{
 	8,  // 13: pb.Ermcp2HedgedItemInfo.hedgeditemext:type_name -> pb.Ermcp2HedgedItemExt
 	10, // 14: pb.Ermcp2HedgedItemInfo.himiddlegoodsext:type_name -> pb.Ermcp2HIMiddleGoodsExt
 	2,  // 15: pb.Ermcp2AreaExposure.UpdateTime:type_name -> pb.Date
-	13, // 16: pb.RedisTradeHolderDetailEx.THDetailEx:type_name -> pb.TradeHolderDetailEx
-	17, // [17:17] is the sub-list for method output_type
-	17, // [17:17] is the sub-list for method input_type
-	17, // [17:17] is the sub-list for extension type_name
-	17, // [17:17] is the sub-list for extension extendee
-	0,  // [0:17] is the sub-list for field type_name
+	2,  // 16: pb.TradeHolderDetailEx.TradeTime:type_name -> pb.Date
+	13, // 17: pb.RedisTradeHolderDetailEx.THDetailEx:type_name -> pb.TradeHolderDetailEx
+	18, // [18:18] is the sub-list for method output_type
+	18, // [18:18] is the sub-list for method input_type
+	18, // [18:18] is the sub-list for extension type_name
+	18, // [18:18] is the sub-list for extension extendee
+	0,  // [0:18] is the sub-list for field type_name
 }
 
 func init() { file_mtp2_proto_init() }

+ 1 - 0
pb/mtp2.proto

@@ -295,6 +295,7 @@ message TradeHolderDetailEx
   optional double FloatPL = 30;    // 浮动盈亏
   optional double DepositRate = 31;    // 订单定金率
   optional double RefundableDeposit = 32;    // 可退定金
+  optional Date   TradeTime = 34;  //交易时间
 }
 
 // RedisTradeHolderDetailEx redis存储交易持仓扩展表