zhou.xiaoning 3 سال پیش
والد
کامیت
8874e4fc8f
16فایلهای تغییر یافته به همراه834 افزوده شده و 17 حذف شده
  1. 1 0
      api/v1/guangzuan/goods.go
  2. 1 0
      api/v1/guangzuan/trade.go
  3. 1 0
      core/rabbitmq.go
  4. 31 5
      global/client.go
  5. 4 3
      global/global.go
  6. 100 0
      global/rabbitmq.go
  7. 2 1
      go.mod
  8. 3 0
      go.sum
  9. 14 6
      middleware/jwt.go
  10. 1 0
      model/guangzuan/trade.go
  11. 2 0
      res/pb/generate_go.bat
  12. 608 0
      res/pb/mtp2.pb.go
  13. 51 0
      res/pb/mtp2.proto
  14. BIN
      res/pb/protoc-gen-go.exe
  15. BIN
      res/pb/protoc.exe
  16. 15 2
      service/account/login.go

+ 1 - 0
api/v1/guangzuan/goods.go

@@ -0,0 +1 @@
+package guangzuan

+ 1 - 0
api/v1/guangzuan/trade.go

@@ -0,0 +1 @@
+package guangzuan

+ 1 - 0
core/rabbitmq.go

@@ -0,0 +1 @@
+package core

+ 31 - 5
global/client.go

@@ -6,7 +6,6 @@ import (
 	"fmt"
 	"sync"
 
-	"github.com/gorilla/websocket"
 	"github.com/mitchellh/mapstructure"
 )
 
@@ -46,8 +45,35 @@ func (r *LoginRedis) ToMap() (val map[string]interface{}, err error) {
 type Client struct {
 	LoginRedis
 
-	wsConn    *websocket.Conn // websocket 连接
-	writeChan chan []byte     // 推送队列
-	closeChan chan struct{}   // 关闭信号
-	doClose   sync.Once       // 仅关闭通道一次
+	CurSerialNumber uint32 // 当前业务流水号
 }
+
+// MQPacket 与总线交互的数据体
+type MQPacket struct {
+	FunCode   uint32 // 功能码
+	SessionId uint32 // 数据包的sid
+	Data      []byte // 业务数据体
+}
+
+// AsyncTask 异步任务结构体
+type AsyncTask struct {
+	Packet       chan MQPacket // 总线数据处理通道
+	SerialNumber uint32        // 通信流水号
+	doClose      sync.Once     // 仅关闭通道一次
+}
+
+// Run 启动异步任务
+func (r *AsyncTask) Run() (p *MQPacket, isTimeOut bool) {
+	select {}
+
+	return
+}
+
+// close 结束异步任务的方法
+// func (r *AsyncTask) close() {
+// 	r.doClose.Do(
+// 		func() {
+// 			close(r.C) // FIXME: - 注意这里是否可以close,后期处理
+// 		}
+// 	)
+// }

+ 4 - 3
global/global.go

@@ -22,9 +22,10 @@ var (
 	M2A_CONFIG              config.Server
 	M2A_VP                  *viper.Viper
 	M2A_LOG                 *zap.Logger
-	M2A_RABBITMQ            *RabbitMQ
 	M2A_Concurrency_Control = &singleflight.Group{}
-	M2A_Clients             map[int]*Client
 
-	// BlackCache              local_cache.Cache
+	M2A_RABBITMQ *RabbitMQ
+
+	M2A_Clients    map[int]*Client    // key:LoginID
+	M2A_AsyncTasks map[int]*AsyncTask // key:SessionId
 )

+ 100 - 0
global/rabbitmq.go

@@ -0,0 +1,100 @@
+package global
+
+import (
+	"encoding/binary"
+	"errors"
+	"fmt"
+
+	"github.com/streadway/amqp"
+	"go.uber.org/zap"
+)
+
+// SubscribeInfo 订阅信息结构
+type SubscribeInfo struct {
+	Topic     string
+	QueueName string
+}
+
+// SubInfos 订阅信息数组
+var SubInfos []SubscribeInfo
+
+// MsgProcesser 消息处理者接口定义
+type MsgProcesser interface {
+	process(string, string, *[]byte)
+}
+
+// SubscribeTopic 订阅主题
+func SubscribeTopic(topic string) (err error) {
+	// 创建队列名称
+	queuename := fmt.Sprintf("mtp20_access_%s", topic)
+
+	// 申明队列
+	if _, err = M2A_RABBITMQ.Channel.QueueDeclare(queuename, true, false, false, true, nil); err != nil {
+		M2A_LOG.Error("rabbitmq declear queue failed, err:", zap.Error(err))
+		return
+	}
+
+	// 绑定队列
+	if err = M2A_RABBITMQ.Channel.QueueBind(queuename, topic, "entry", false, nil); err != nil {
+		M2A_LOG.Error("rabbitmq bind queue failed, err:", zap.Error(err))
+		return
+	}
+
+	// 添加订阅信息
+	SubInfos = append(SubInfos, SubscribeInfo{Topic: topic, QueueName: queuename})
+
+	return
+}
+
+// Publish 发送消息
+func Publish(topic string, msg MQPacket) (err error) {
+	if M2A_RABBITMQ == nil || M2A_RABBITMQ.Connection.IsClosed() {
+		err = errors.New("rabbitmq is not connected")
+		M2A_LOG.Error("rabbitmq publish failed, err:", zap.Error(err))
+		return
+	}
+
+	// 组织发送数据
+	data := []byte{}
+	funCode := make([]byte, 4)
+	binary.LittleEndian.PutUint32(funCode, msg.FunCode)
+	data = append(data, funCode...)
+	sessionId := make([]byte, 4)
+	binary.LittleEndian.PutUint32(funCode, msg.SessionId)
+	data = append(data, sessionId...)
+	data = append(data, msg.Data...)
+
+	if err = M2A_RABBITMQ.Channel.Publish("entry", topic, false, false, amqp.Publishing{
+		ContentType: "text/plain",
+		Body:        data,
+	}); err != nil {
+		M2A_LOG.Error("rabbitmq publish failed, err:", zap.Error(err))
+		return
+	}
+
+	return
+}
+
+// Receive 接收消息
+func Receive(topic, queuename string, processer MsgProcesser) (err error) {
+	if M2A_RABBITMQ == nil || M2A_RABBITMQ.Connection.IsClosed() {
+		err = errors.New("rabbitmq is not connected")
+		M2A_LOG.Error("rabbitmq receive failed, err:", zap.Error(err))
+		return
+	}
+
+	msgList, err := M2A_RABBITMQ.Channel.Consume(queuename, "", false, false, false, false, nil)
+	if err != nil {
+		M2A_LOG.Error("rabbitmq receive failed, err:", zap.Error(err))
+		return
+	}
+
+	go func() {
+		for msg := range msgList {
+			processer.process(topic, queuename, &msg.Body)
+			msg.Ack(false)
+		}
+	}()
+
+	return
+}

+ 2 - 1
go.mod

@@ -7,6 +7,7 @@ require (
 	github.com/gin-gonic/gin v1.8.1
 	github.com/go-redis/redis/v8 v8.11.5
 	github.com/golang-jwt/jwt/v4 v4.4.2
+	github.com/golang/protobuf v1.5.2
 	github.com/gorilla/websocket v1.4.2
 	github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
 	github.com/mattn/go-oci8 v0.1.1
@@ -17,6 +18,7 @@ require (
 	github.com/swaggo/swag v1.8.4
 	go.uber.org/zap v1.21.0
 	golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
+	google.golang.org/protobuf v1.28.0
 	xorm.io/xorm v1.3.1
 )
 
@@ -62,7 +64,6 @@ require (
 	golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
 	golang.org/x/text v0.3.7 // indirect
 	golang.org/x/tools v0.1.12 // indirect
-	google.golang.org/protobuf v1.28.0 // indirect
 	gopkg.in/ini.v1 v1.66.4 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect

+ 3 - 0
go.sum

@@ -212,6 +212,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
+github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
@@ -967,6 +969,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
 google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
 google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=

+ 14 - 6
middleware/jwt.go

@@ -32,12 +32,20 @@ func JWTAuth() gin.HandlerFunc {
 			return
 		}
 		// 从Redis获取登录信息
-		// loginMap, err := j.GetRedisLogin(claims.LoginID, claims.Group)
-		// if err != nil {
-		// 	response.FailWithDetailed(gin.H{"reload": true}, "您的帐户异地登陆或令牌失效", c)
-		// 	c.Abort()
-		// 	return
-		// }
+		loginMap, err := j.GetRedisLogin(claims.LoginID, claims.Group)
+		if err != nil {
+			response.FailWithDetailed(gin.H{"reload": true}, "您的帐户异地登陆或令牌失效", c)
+			c.Abort()
+			return
+		}
+		// 判断Token是否有效
+		if redisToken, isHas := loginMap["token"]; isHas {
+			if redisToken != token {
+				response.FailWithDetailed(gin.H{"reload": true}, "您的帐户异地登陆或令牌失效", c)
+				c.Abort()
+				return
+			}
+		}
 
 		// 判断是否需要自动续约
 		// if claims.ExpiresAt.Unix()-time.Now().Unix() < claims.BufferTime {

+ 1 - 0
model/guangzuan/trade.go

@@ -0,0 +1 @@
+package guangzuan

+ 2 - 0
res/pb/generate_go.bat

@@ -0,0 +1,2 @@
+protoc.exe --proto_path=./ -I=./ --go_out=./  *.proto
+pause

+ 608 - 0
res/pb/mtp2.pb.go

@@ -0,0 +1,608 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.25.0
+// 	protoc        v3.11.4
+// source: mtp2.proto
+
+package pb
+
+import (
+	proto "github.com/golang/protobuf/proto"
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// This is a compile-time assertion that a sufficiently up-to-date version
+// of the legacy proto package is being used.
+const _ = proto.ProtoPackageIsVersion4
+
+// 消息头
+type MessageHead struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	FunCode       *uint32 `protobuf:"varint,1,opt,name=FunCode" json:"FunCode,omitempty"`             // 功能号
+	RequestID     *uint32 `protobuf:"varint,2,opt,name=RequestID" json:"RequestID,omitempty"`         // 客户端的流水ID
+	AccountID     *uint64 `protobuf:"varint,3,opt,name=AccountID" json:"AccountID,omitempty"`         // 账号ID
+	AccessID      *uint32 `protobuf:"varint,4,opt,name=AccessID" json:"AccessID,omitempty"`           //二级分配给客户端的接入ID
+	ClientTime    *int64  `protobuf:"varint,5,opt,name=ClientTime" json:"ClientTime,omitempty"`       //消息发起时间
+	GoodsID       *uint32 `protobuf:"varint,6,opt,name=GoodsID" json:"GoodsID,omitempty"`             //商品ID
+	UUID          *string `protobuf:"bytes,7,opt,name=UUID" json:"UUID,omitempty"`                    // 消息唯一ID
+	MarketID      *uint32 `protobuf:"varint,8,opt,name=MarketID" json:"MarketID,omitempty"`           // 所属市场ID
+	UserID        *uint32 `protobuf:"varint,9,opt,name=UserID" json:"UserID,omitempty"`               // 用户ID
+	ResponseTopic *string `protobuf:"bytes,10,opt,name=ResponseTopic" json:"ResponseTopic,omitempty"` // 应答消息所属主题
+	AccountID2    *uint64 `protobuf:"varint,11,opt,name=AccountID2" json:"AccountID2,omitempty"`      // 账号ID-币币交易使用
+}
+
+func (x *MessageHead) Reset() {
+	*x = MessageHead{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *MessageHead) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MessageHead) ProtoMessage() {}
+
+func (x *MessageHead) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use MessageHead.ProtoReflect.Descriptor instead.
+func (*MessageHead) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *MessageHead) GetFunCode() uint32 {
+	if x != nil && x.FunCode != nil {
+		return *x.FunCode
+	}
+	return 0
+}
+
+func (x *MessageHead) GetRequestID() uint32 {
+	if x != nil && x.RequestID != nil {
+		return *x.RequestID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetAccessID() uint32 {
+	if x != nil && x.AccessID != nil {
+		return *x.AccessID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetClientTime() int64 {
+	if x != nil && x.ClientTime != nil {
+		return *x.ClientTime
+	}
+	return 0
+}
+
+func (x *MessageHead) GetGoodsID() uint32 {
+	if x != nil && x.GoodsID != nil {
+		return *x.GoodsID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetUUID() string {
+	if x != nil && x.UUID != nil {
+		return *x.UUID
+	}
+	return ""
+}
+
+func (x *MessageHead) GetMarketID() uint32 {
+	if x != nil && x.MarketID != nil {
+		return *x.MarketID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetUserID() uint32 {
+	if x != nil && x.UserID != nil {
+		return *x.UserID
+	}
+	return 0
+}
+
+func (x *MessageHead) GetResponseTopic() string {
+	if x != nil && x.ResponseTopic != nil {
+		return *x.ResponseTopic
+	}
+	return ""
+}
+
+func (x *MessageHead) GetAccountID2() uint64 {
+	if x != nil && x.AccountID2 != nil {
+		return *x.AccountID2
+	}
+	return 0
+}
+
+// 钻石卖挂牌接口请求
+type ZSSellOrderListingReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Header                *MessageHead `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`
+	UserID                *uint64      `protobuf:"varint,2,opt,name=UserID" json:"UserID,omitempty"`                               // 用户ID,必填
+	AccountID             *uint64      `protobuf:"varint,3,opt,name=AccountID" json:"AccountID,omitempty"`                         // 资金账户ID,必填
+	WRStandardID          *uint64      `protobuf:"varint,4,opt,name=WRStandardID" json:"WRStandardID,omitempty"`                   // 现货商品ID,必填
+	WRFactorTypeID        *uint64      `protobuf:"varint,5,opt,name=WRFactorTypeID" json:"WRFactorTypeID,omitempty"`               // 仓单要素类型ID,必填
+	OrderQty              *float64     `protobuf:"fixed64,6,opt,name=OrderQty" json:"OrderQty,omitempty"`                          // 挂牌数量,必填2位小数,为WeigthAvg的整数倍
+	LadingBillID          *uint64      `protobuf:"varint,7,opt,name=LadingBillID" json:"LadingBillID,omitempty"`                   // 提单ID,必填
+	SubNum                *uint32      `protobuf:"varint,8,opt,name=SubNum" json:"SubNum,omitempty"`                               // 提单子单号,必填
+	PerformanceTemplateID *int64       `protobuf:"varint,9,opt,name=PerformanceTemplateID" json:"PerformanceTemplateID,omitempty"` // 履约计划模板ID
+	TimevalidType         *uint32      `protobuf:"varint,10,opt,name=TimevalidType" json:"TimevalidType,omitempty"`                // 时间有效类型
+	ValidTime             *string      `protobuf:"bytes,11,opt,name=ValidTime" json:"ValidTime,omitempty"`                         // 有效期限
+	OrderSrc              *uint32      `protobuf:"varint,12,opt,name=OrderSrc" json:"OrderSrc,omitempty"`                          // 委托来源
+	ClientSerialNo        *string      `protobuf:"bytes,13,opt,name=ClientSerialNo" json:"ClientSerialNo,omitempty"`               // 客户端流水号
+	ClientOrderTime       *string      `protobuf:"bytes,14,opt,name=ClientOrderTime" json:"ClientOrderTime,omitempty"`             // 客户端委托时间
+	ClientType            *uint32      `protobuf:"varint,15,opt,name=ClientType" json:"ClientType,omitempty"`                      // 终端类型
+	MarketID              *uint64      `protobuf:"varint,16,opt,name=MarketID" json:"MarketID,omitempty"`                          // 市场ID,必填
+}
+
+func (x *ZSSellOrderListingReq) Reset() {
+	*x = ZSSellOrderListingReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ZSSellOrderListingReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ZSSellOrderListingReq) ProtoMessage() {}
+
+func (x *ZSSellOrderListingReq) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ZSSellOrderListingReq.ProtoReflect.Descriptor instead.
+func (*ZSSellOrderListingReq) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ZSSellOrderListingReq) GetHeader() *MessageHead {
+	if x != nil {
+		return x.Header
+	}
+	return nil
+}
+
+func (x *ZSSellOrderListingReq) GetUserID() uint64 {
+	if x != nil && x.UserID != nil {
+		return *x.UserID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetWRStandardID() uint64 {
+	if x != nil && x.WRStandardID != nil {
+		return *x.WRStandardID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetWRFactorTypeID() uint64 {
+	if x != nil && x.WRFactorTypeID != nil {
+		return *x.WRFactorTypeID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetOrderQty() float64 {
+	if x != nil && x.OrderQty != nil {
+		return *x.OrderQty
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetLadingBillID() uint64 {
+	if x != nil && x.LadingBillID != nil {
+		return *x.LadingBillID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetSubNum() uint32 {
+	if x != nil && x.SubNum != nil {
+		return *x.SubNum
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetPerformanceTemplateID() int64 {
+	if x != nil && x.PerformanceTemplateID != nil {
+		return *x.PerformanceTemplateID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetTimevalidType() uint32 {
+	if x != nil && x.TimevalidType != nil {
+		return *x.TimevalidType
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetValidTime() string {
+	if x != nil && x.ValidTime != nil {
+		return *x.ValidTime
+	}
+	return ""
+}
+
+func (x *ZSSellOrderListingReq) GetOrderSrc() uint32 {
+	if x != nil && x.OrderSrc != nil {
+		return *x.OrderSrc
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetClientSerialNo() string {
+	if x != nil && x.ClientSerialNo != nil {
+		return *x.ClientSerialNo
+	}
+	return ""
+}
+
+func (x *ZSSellOrderListingReq) GetClientOrderTime() string {
+	if x != nil && x.ClientOrderTime != nil {
+		return *x.ClientOrderTime
+	}
+	return ""
+}
+
+func (x *ZSSellOrderListingReq) GetClientType() uint32 {
+	if x != nil && x.ClientType != nil {
+		return *x.ClientType
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingReq) GetMarketID() uint64 {
+	if x != nil && x.MarketID != nil {
+		return *x.MarketID
+	}
+	return 0
+}
+
+// 钻石卖挂牌接口响应
+type ZSSellOrderListingRsp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Header         *MessageHead `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`                  // 消息头
+	RetCode        *int32       `protobuf:"varint,2,opt,name=RetCode" json:"RetCode,omitempty"`               // 返回码
+	RetDesc        *string      `protobuf:"bytes,3,opt,name=RetDesc" json:"RetDesc,omitempty"`                // 描述信息
+	UserID         *uint32      `protobuf:"varint,4,opt,name=UserID" json:"UserID,omitempty"`                 // 用户ID
+	AccountID      *uint64      `protobuf:"varint,5,opt,name=AccountID" json:"AccountID,omitempty"`           // 资金账号
+	WRTradeOrderID *uint64      `protobuf:"varint,6,opt,name=WRTradeOrderID" json:"WRTradeOrderID,omitempty"` // 仓单贸易委托单ID
+	FreezeQty      *uint64      `protobuf:"varint,7,opt,name=FreezeQty" json:"FreezeQty,omitempty"`           // 冻结数量
+	OrderTime      *string      `protobuf:"bytes,8,opt,name=OrderTime" json:"OrderTime,omitempty"`            // 接收委托交易的时间
+	ClientSerialNo *string      `protobuf:"bytes,9,opt,name=ClientSerialNo" json:"ClientSerialNo,omitempty"`  // 客户端流水号
+}
+
+func (x *ZSSellOrderListingRsp) Reset() {
+	*x = ZSSellOrderListingRsp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ZSSellOrderListingRsp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ZSSellOrderListingRsp) ProtoMessage() {}
+
+func (x *ZSSellOrderListingRsp) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ZSSellOrderListingRsp.ProtoReflect.Descriptor instead.
+func (*ZSSellOrderListingRsp) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ZSSellOrderListingRsp) GetHeader() *MessageHead {
+	if x != nil {
+		return x.Header
+	}
+	return nil
+}
+
+func (x *ZSSellOrderListingRsp) GetRetCode() int32 {
+	if x != nil && x.RetCode != nil {
+		return *x.RetCode
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingRsp) GetRetDesc() string {
+	if x != nil && x.RetDesc != nil {
+		return *x.RetDesc
+	}
+	return ""
+}
+
+func (x *ZSSellOrderListingRsp) GetUserID() uint32 {
+	if x != nil && x.UserID != nil {
+		return *x.UserID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingRsp) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingRsp) GetWRTradeOrderID() uint64 {
+	if x != nil && x.WRTradeOrderID != nil {
+		return *x.WRTradeOrderID
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingRsp) GetFreezeQty() uint64 {
+	if x != nil && x.FreezeQty != nil {
+		return *x.FreezeQty
+	}
+	return 0
+}
+
+func (x *ZSSellOrderListingRsp) GetOrderTime() string {
+	if x != nil && x.OrderTime != nil {
+		return *x.OrderTime
+	}
+	return ""
+}
+
+func (x *ZSSellOrderListingRsp) GetClientSerialNo() string {
+	if x != nil && x.ClientSerialNo != nil {
+		return *x.ClientSerialNo
+	}
+	return ""
+}
+
+var File_mtp2_proto protoreflect.FileDescriptor
+
+var file_mtp2_proto_rawDesc = []byte{
+	0x0a, 0x0a, 0x6d, 0x74, 0x70, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
+	0x22, 0xc7, 0x02, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64,
+	0x12, 0x18, 0x0a, 0x07, 0x46, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x07, 0x46, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x52, 0x65,
+	0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63, 0x63, 0x6f,
+	0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41, 0x63, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
+	0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
+	0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69,
+	0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04,
+	0x55, 0x55, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x55, 0x49, 0x44,
+	0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x0d, 0x52, 0x08, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x55, 0x73,
+	0x65, 0x72, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+	0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x73,
+	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a,
+	0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x32, 0x22, 0xbe, 0x04, 0x0a, 0x15, 0x5a,
+	0x53, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e,
+	0x67, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a,
+	0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x55,
+	0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+	0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x57, 0x52, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+	0x64, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x57, 0x52, 0x53, 0x74, 0x61,
+	0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x57, 0x52, 0x46, 0x61, 0x63,
+	0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52,
+	0x0e, 0x57, 0x52, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x49, 0x44, 0x12,
+	0x1a, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x51, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x01, 0x52, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x51, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x4c,
+	0x61, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x0c, 0x4c, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x12,
+	0x16, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x4e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52,
+	0x06, 0x53, 0x75, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x15, 0x50, 0x65, 0x72, 0x66, 0x6f,
+	0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x44,
+	0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+	0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x44, 0x12, 0x24, 0x0a,
+	0x0d, 0x54, 0x69, 0x6d, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a,
+	0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x54, 0x69, 0x6d, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x54,
+	0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65,
+	0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x69, 0x6d,
+	0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x72, 0x63, 0x18, 0x0c, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x72, 0x63, 0x12, 0x26, 0x0a,
+	0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x6f, 0x18,
+	0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72,
+	0x69, 0x61, 0x6c, 0x4e, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f,
+	0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
+	0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12,
+	0x1e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12,
+	0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x18, 0x10, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x08, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x22, 0xb6, 0x02, 0x0a, 0x15,
+	0x5a, 0x53, 0x53, 0x65, 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x69,
+	0x6e, 0x67, 0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18,
+	0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
+	0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x44,
+	0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x74, 0x44, 0x65,
+	0x73, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x0d, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41,
+	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x57, 0x52, 0x54, 0x72,
+	0x61, 0x64, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04,
+	0x52, 0x0e, 0x57, 0x52, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x44,
+	0x12, 0x1c, 0x0a, 0x09, 0x46, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x51, 0x74, 0x79, 0x18, 0x07, 0x20,
+	0x01, 0x28, 0x04, 0x52, 0x09, 0x46, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x51, 0x74, 0x79, 0x12, 0x1c,
+	0x0a, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e,
+	0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x6f, 0x18, 0x09,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x69,
+	0x61, 0x6c, 0x4e, 0x6f,
+}
+
+var (
+	file_mtp2_proto_rawDescOnce sync.Once
+	file_mtp2_proto_rawDescData = file_mtp2_proto_rawDesc
+)
+
+func file_mtp2_proto_rawDescGZIP() []byte {
+	file_mtp2_proto_rawDescOnce.Do(func() {
+		file_mtp2_proto_rawDescData = protoimpl.X.CompressGZIP(file_mtp2_proto_rawDescData)
+	})
+	return file_mtp2_proto_rawDescData
+}
+
+var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_mtp2_proto_goTypes = []interface{}{
+	(*MessageHead)(nil),           // 0: pb.MessageHead
+	(*ZSSellOrderListingReq)(nil), // 1: pb.ZSSellOrderListingReq
+	(*ZSSellOrderListingRsp)(nil), // 2: pb.ZSSellOrderListingRsp
+}
+var file_mtp2_proto_depIdxs = []int32{
+	0, // 0: pb.ZSSellOrderListingReq.Header:type_name -> pb.MessageHead
+	0, // 1: pb.ZSSellOrderListingRsp.Header:type_name -> pb.MessageHead
+	2, // [2:2] is the sub-list for method output_type
+	2, // [2:2] is the sub-list for method input_type
+	2, // [2:2] is the sub-list for extension type_name
+	2, // [2:2] is the sub-list for extension extendee
+	0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_mtp2_proto_init() }
+func file_mtp2_proto_init() {
+	if File_mtp2_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_mtp2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*MessageHead); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_mtp2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ZSSellOrderListingReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_mtp2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ZSSellOrderListingRsp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_mtp2_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   3,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_mtp2_proto_goTypes,
+		DependencyIndexes: file_mtp2_proto_depIdxs,
+		MessageInfos:      file_mtp2_proto_msgTypes,
+	}.Build()
+	File_mtp2_proto = out.File
+	file_mtp2_proto_rawDesc = nil
+	file_mtp2_proto_goTypes = nil
+	file_mtp2_proto_depIdxs = nil
+}

+ 51 - 0
res/pb/mtp2.proto

@@ -0,0 +1,51 @@
+syntax = "proto2";
+
+package pb;
+
+// 消息头
+message MessageHead {
+	optional uint32 FunCode = 1; // 功能号
+	optional uint32 RequestID = 2; // 客户端的流水ID
+	optional uint64 AccountID = 3; // 账号ID
+	optional uint32 AccessID = 4; //二级分配给客户端的接入ID
+	optional int64 ClientTime = 5; //消息发起时间
+	optional uint32 GoodsID = 6; //商品ID
+	optional string UUID = 7; // 消息唯一ID
+	optional uint32 MarketID = 8; // 所属市场ID
+	optional uint32 UserID = 9; // 用户ID
+	optional string ResponseTopic = 10; // 应答消息所属主题
+	optional uint64 AccountID2 = 11; // 账号ID-币币交易使用
+}
+
+// 钻石卖挂牌接口请求
+message ZSSellOrderListingReq {
+	optional MessageHead Header = 1;
+		optional uint64 UserID = 2; // 用户ID,必填
+		optional uint64 AccountID = 3; // 资金账户ID,必填
+		optional uint64 WRStandardID = 4; // 现货商品ID,必填
+		optional uint64 WRFactorTypeID = 5; // 仓单要素类型ID,必填
+		optional double OrderQty = 6; // 挂牌数量,必填2位小数,为WeigthAvg的整数倍
+		optional uint64 LadingBillID = 7; // 提单ID,必填
+		optional uint32 SubNum = 8; // 提单子单号,必填
+		optional int64 PerformanceTemplateID = 9; // 履约计划模板ID
+		optional uint32 TimevalidType = 10; // 时间有效类型
+		optional string ValidTime = 11; // 有效期限
+		optional uint32 OrderSrc = 12; // 委托来源
+		optional string ClientSerialNo = 13; // 客户端流水号
+		optional string ClientOrderTime = 14; // 客户端委托时间
+		optional uint32 ClientType = 15; // 终端类型
+		optional uint64 MarketID = 16; // 市场ID,必填
+}
+
+// 钻石卖挂牌接口响应
+message ZSSellOrderListingRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional uint32 UserID = 4; // 用户ID
+		optional uint64 AccountID = 5; // 资金账号
+		optional uint64 WRTradeOrderID = 6; // 仓单贸易委托单ID
+		optional uint64 FreezeQty = 7; // 冻结数量
+		optional string OrderTime = 8; // 接收委托交易的时间
+		optional string ClientSerialNo = 9; // 客户端流水号
+}

BIN
res/pb/protoc-gen-go.exe


BIN
res/pb/protoc.exe


+ 15 - 2
service/account/login.go

@@ -109,9 +109,11 @@ func getLoginAccount(userName string, password string) (loginaccount *accountMod
 
 // newSessionID 获取
 func newSessionID() int {
-	mtx.Lock()
+	mtx.RLock()
+	defer func() {
+		mtx.RUnlock()
+	}()
 	curSessionID += 1
-	mtx.Unlock()
 
 	return curSessionID
 }
@@ -166,5 +168,16 @@ func buildRedisLoginInfo(loginaccount accountModel.Loginaccount, addr string, gr
 	// 	return
 	// }
 
+	// 记录用户信息
+	mtx.Lock()
+	defer func() {
+		mtx.Unlock()
+	}()
+	if global.M2A_Clients == nil {
+		global.M2A_Clients = make(map[int]*global.Client, 0)
+	}
+	delete(global.M2A_Clients, int(loginaccount.LOGINID))
+	global.M2A_Clients[int(loginaccount.LOGINID)] = &global.Client{LoginRedis: loginLogin, CurSerialNumber: 1}
+
 	return
 }