rabbitmq.go 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  1. package initialize
  2. import (
  3. "encoding/base64"
  4. "fmt"
  5. "mtp20access/client"
  6. "mtp20access/global"
  7. rsp "mtp20access/model/mq/response"
  8. "mtp20access/packet"
  9. "mtp20access/publish"
  10. "mtp20access/rabbitmq"
  11. "mtp20access/res/pb"
  12. accountSrv "mtp20access/service/account"
  13. "mtp20access/utils"
  14. "strconv"
  15. // "github.com/golang/protobuf/proto"
  16. "github.com/streadway/amqp"
  17. "go.uber.org/zap"
  18. "google.golang.org/protobuf/encoding/protojson"
  19. "google.golang.org/protobuf/proto"
  20. )
  21. func RabbitMQ() *global.RabbitMQ {
  22. url := global.M2A_CONFIG.Rabbitmq.Url
  23. connection, err := amqp.Dial(url)
  24. if err != nil {
  25. global.M2A_LOG.Error("rabbitmq connect failed, err:", zap.Error(err))
  26. return nil
  27. }
  28. channel, err := connection.Channel()
  29. if err != nil {
  30. global.M2A_LOG.Error("rabbitmq open channel failed, err:", zap.Error(err))
  31. return nil
  32. }
  33. global.M2A_LOG.Info("rabbitmq connect successed.")
  34. return &global.RabbitMQ{
  35. Connection: connection,
  36. Channel: channel,
  37. }
  38. }
  39. // MQProc 消息处理对象
  40. type MQProc struct{}
  41. // process 消息处理接口
  42. func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
  43. // info := fmt.Sprintf("rabbitmq receive message from: topic[%s] queue[%s] contentLen[%d]",
  44. // topic,
  45. // queuename,
  46. // len(string(*msg)))
  47. // global.M2A_LOG.Info(info)
  48. if funcode, sessionId, bytes, serialNumber, err := t.getRspProtobuf(msg); err == nil && bytes != nil {
  49. if sessionId == 0 || funcode == uint32(global.LogoutRsp) || funcode == uint32(global.LoginRsp) {
  50. // 通知类 或 特殊处理
  51. t.onNtf(funcode, sessionId, bytes)
  52. } else {
  53. // 请求回复W
  54. // 尝试获取对应异步任务
  55. if client, exists := client.Clients[int(sessionId)]; exists {
  56. key := fmt.Sprintf("%v_%v_%v", sessionId, funcode, serialNumber)
  57. // 银行服务相关的回复流水号是错误的,所以需要特殊处理
  58. if int(funcode) == global.T2bBankSignRsp ||
  59. int(funcode) == global.T2bBankCancelSignRsp ||
  60. int(funcode) == global.T2bBankWithdrawRsp ||
  61. int(funcode) == global.T2bBankDepositRsp {
  62. key = fmt.Sprintf("%v_%v", sessionId, funcode)
  63. }
  64. asyncTask := client.GetAsyncTask(key)
  65. if asyncTask != nil {
  66. rspData := string(*bytes)
  67. // 判断是否要加密
  68. if asyncTask.IsEncrypted {
  69. if b, err := packet.Encrypt(*bytes, packet.AESKey, true); err != nil {
  70. global.M2A_LOG.Error("总线回复数据加密失败", zap.Error(err))
  71. return
  72. } else {
  73. rspData = base64.StdEncoding.EncodeToString(b)
  74. }
  75. }
  76. // 给客户端回调
  77. global.M2A_LOG.Info("[S->C]", zap.Any("rsp", funcode), zap.Any("sessionId", sessionId), zap.Any("data", string(rspData)))
  78. r := rsp.MQBodyRsp{
  79. FunCode: funcode,
  80. IsEncrypted: asyncTask.IsEncrypted,
  81. Data: rspData,
  82. }
  83. asyncTask.Rsp <- r
  84. } else {
  85. global.M2A_LOG.Info("找不到对应KEY的异步任务", zap.Any("key", key), zap.Any("AsyncMap", client.GetAllAsyncTask()))
  86. }
  87. } else {
  88. global.M2A_LOG.Info("找不到对应的client", zap.Any("sessionId", sessionId))
  89. }
  90. }
  91. }
  92. }
  93. func (t *MQProc) onNtf(funcode uint32, sessionId uint32, bytes *[]byte) {
  94. var clients []*client.Client
  95. var err error
  96. var sendBytes *[]byte
  97. switch int(funcode) {
  98. case global.LoginRsp: // 用户登录应答 - 主要记录旧Token
  99. var p pb.LoginRsp
  100. if err = proto.Unmarshal(*bytes, &p); err != nil {
  101. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  102. return
  103. }
  104. // if bs, e := protojson.Marshal(&p); e != nil {
  105. // global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  106. // return
  107. // } else {
  108. // sendBytes = &bs
  109. // }
  110. // 获取目标客户
  111. for i := range client.Clients {
  112. c := client.Clients[i]
  113. if strconv.Itoa(int(p.GetUserID())) == c.UserID &&
  114. strconv.Itoa(int(sessionId)) == c.SessionID {
  115. // 主要记录旧Token
  116. c.OldToken = p.GetToken()
  117. }
  118. }
  119. case global.LogoutRsp: // 用户登出应答 - 主要用于接收管理端踢上线
  120. var p pb.LogoutRsp
  121. if err = proto.Unmarshal(*bytes, &p); err != nil {
  122. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  123. return
  124. }
  125. if bs, e := protojson.Marshal(&p); e != nil {
  126. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  127. return
  128. } else {
  129. sendBytes = &bs
  130. }
  131. // 获取目标客户
  132. clients = make([]*client.Client, 0)
  133. for i := range client.Clients {
  134. c := client.Clients[i]
  135. if strconv.Itoa(int(p.GetHeader().GetUserID())) == c.UserID {
  136. clients = append(clients, c)
  137. }
  138. }
  139. case global.MoneyChangedNtf: // 资金变化通知
  140. var p pb.MoneyChangedNtf
  141. if err = proto.Unmarshal(*bytes, &p); err != nil {
  142. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  143. return
  144. }
  145. if bs, e := protojson.Marshal(&p); e != nil {
  146. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  147. return
  148. } else {
  149. sendBytes = &bs
  150. }
  151. // 获取目标客户
  152. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  153. if err != nil {
  154. return
  155. }
  156. case global.PosChangedNtf: // 头寸变化通知
  157. var p pb.PosChangedNtf
  158. if err = proto.Unmarshal(*bytes, &p); err != nil {
  159. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  160. return
  161. }
  162. if bs, e := protojson.Marshal(&p); e != nil {
  163. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  164. return
  165. } else {
  166. sendBytes = &bs
  167. }
  168. // 获取目标客户
  169. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  170. if err != nil {
  171. global.M2A_LOG.Info(fmt.Sprintf("接收头寸变化通知时获取不到对应Client,AccountID:%v", *p.AccountID))
  172. return
  173. }
  174. case global.OrderDealedNtf: // 委托单成交通知
  175. var p pb.OrderDealedNtf
  176. if err = proto.Unmarshal(*bytes, &p); err != nil {
  177. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  178. return
  179. }
  180. if bs, e := protojson.Marshal(&p); e != nil {
  181. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  182. return
  183. } else {
  184. sendBytes = &bs
  185. }
  186. // 获取目标客户
  187. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  188. if err != nil {
  189. return
  190. }
  191. case global.MarketStatusChangeNtf: // 市场状态变更通知
  192. var p pb.MarketStatusChangeNtf
  193. if err = proto.Unmarshal(*bytes, &p); err != nil {
  194. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  195. return
  196. }
  197. if bs, e := protojson.Marshal(&p); e != nil {
  198. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  199. return
  200. } else {
  201. sendBytes = &bs
  202. }
  203. // 获取目标客户
  204. clients = make([]*client.Client, 0)
  205. for i := range client.Clients {
  206. c := client.Clients[i]
  207. clients = append(clients, c)
  208. }
  209. case global.ListingOrderChangeNtf: // 挂牌委托变更广播通知
  210. var p pb.ListingOrderChangeNtf
  211. if err = proto.Unmarshal(*bytes, &p); err != nil {
  212. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  213. return
  214. }
  215. if bs, e := protojson.Marshal(&p); e != nil {
  216. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  217. return
  218. } else {
  219. sendBytes = &bs
  220. }
  221. // 获取目标客户
  222. clients = make([]*client.Client, 0)
  223. for i := range client.Clients {
  224. c := client.Clients[i]
  225. clients = append(clients, c)
  226. }
  227. }
  228. if err == nil && len(clients) > 0 {
  229. // 组装待发送给客户端的5.0报文包
  230. b, err := packet.BuildPacket(funcode, 0, 0, *sendBytes, true)
  231. if err != nil {
  232. global.M2A_LOG.Error("组装5.0报文失败", zap.Error(err))
  233. return
  234. }
  235. // 发送信息
  236. for _, item := range clients {
  237. // c := clients[i]
  238. // sessionId, _ := strconv.Atoi(item.SessionID)
  239. // c := client.Clients[sessionId]
  240. // c.WriteTradeWsBuf(b)
  241. // 分发给订阅者
  242. m := make(map[string][]byte)
  243. m[item.SessionID] = b
  244. global.M2A_Publish.Publish(publish.Topic_Trading, m)
  245. // 给客户端通知
  246. // global.M2A_LOG.Info("[S->C]给客户端通知", zap.Any("ntf", funcode), zap.Any("clients", c.LoginID), zap.Any("SessionID", c.SessionID), zap.Any("len", len(b)))
  247. }
  248. }
  249. }
  250. // getRspProtobuf 将总线回复的数据反序列化为Protobuf
  251. func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32, bytes *[]byte, serialNumber uint32, err error) {
  252. // 分解总线包信息
  253. funcode = utils.BytesToUint32((*msg)[0:4])
  254. sessionId = utils.BytesToUint32((*msg)[4:8])
  255. b := (*msg)[8:]
  256. global.M2A_LOG.Info("收到总线消息", zap.Any("funcode", funcode), zap.Any("sessionId", sessionId), zap.Any("len", len(b)))
  257. switch int(funcode) {
  258. case global.PosChangedNtf,
  259. global.MoneyChangedNtf,
  260. global.OrderDealedNtf,
  261. global.MarketStatusChangeNtf,
  262. global.LoginRsp,
  263. global.LogoutRsp,
  264. global.ListingOrderChangeNtf: // 资金变化通知等
  265. bytes = &b
  266. case global.ModifyPwdRsp: // 修改账户密码应答
  267. var p pb.ModifyPwdRsp
  268. if err = proto.Unmarshal(b, &p); err != nil {
  269. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  270. return
  271. }
  272. if bs, e := protojson.Marshal(&p); e != nil {
  273. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  274. return
  275. } else {
  276. bytes = &bs
  277. serialNumber = p.GetHeader().GetRequestID()
  278. }
  279. case global.UserReceiveInfoRsp: // 新增修改收货地址请求响应
  280. var p pb.UserReceiveInfoRsp
  281. if err = proto.Unmarshal(b, &p); err != nil {
  282. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  283. return
  284. }
  285. if bs, e := protojson.Marshal(&p); e != nil {
  286. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  287. return
  288. } else {
  289. bytes = &bs
  290. serialNumber = p.GetHeader().GetRequestID()
  291. }
  292. case global.DelUserReceiveInfoRsp: // 删除收货地址请求响应
  293. var p pb.DelUserReceiveInfoRsp
  294. if err = proto.Unmarshal(b, &p); err != nil {
  295. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  296. return
  297. }
  298. if bs, e := protojson.Marshal(&p); e != nil {
  299. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  300. return
  301. } else {
  302. bytes = &bs
  303. serialNumber = p.GetHeader().GetRequestID()
  304. }
  305. case global.UserReceiveIsDefaultRsp:
  306. var p pb.UserReceiveIsDefaultRsp
  307. if err = proto.Unmarshal(b, &p); err != nil {
  308. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  309. return
  310. }
  311. if bs, e := protojson.Marshal(&p); e != nil {
  312. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  313. return
  314. } else {
  315. bytes = &bs
  316. serialNumber = p.GetHeader().GetRequestID()
  317. }
  318. case global.UserReceiptInfoRsp: // 新增修改用户发票信息请求响应
  319. var p pb.UserReceiptInfoRsp
  320. if err = proto.Unmarshal(b, &p); err != nil {
  321. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  322. return
  323. }
  324. if bs, e := protojson.Marshal(&p); e != nil {
  325. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  326. return
  327. } else {
  328. bytes = &bs
  329. serialNumber = p.GetHeader().GetRequestID()
  330. }
  331. case global.DelUserReceiptInfoRsp: // 删除用户发票信息请求响应
  332. var p pb.DelUserReceiptInfoRsp
  333. if err = proto.Unmarshal(b, &p); err != nil {
  334. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  335. return
  336. }
  337. if bs, e := protojson.Marshal(&p); e != nil {
  338. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  339. return
  340. } else {
  341. bytes = &bs
  342. serialNumber = p.GetHeader().GetRequestID()
  343. }
  344. case global.T2bBankSignRsp: // 签约应答
  345. var p pb.T2BBankSignRsp
  346. if err = proto.Unmarshal(b, &p); err != nil {
  347. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  348. return
  349. }
  350. if bs, e := protojson.Marshal(&p); e != nil {
  351. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  352. return
  353. } else {
  354. bytes = &bs
  355. serialNumber = p.GetHeader().GetRequestID()
  356. }
  357. case global.T2bBankCancelSignRsp: // 解约应答
  358. var p pb.T2BBankCancelSignRsp
  359. if err = proto.Unmarshal(b, &p); err != nil {
  360. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  361. return
  362. }
  363. if bs, e := protojson.Marshal(&p); e != nil {
  364. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  365. return
  366. } else {
  367. bytes = &bs
  368. serialNumber = p.GetHeader().GetRequestID()
  369. }
  370. case global.T2bBankWithdrawRsp: // 出金应答
  371. var p pb.T2BBankWithdrawRsp
  372. if err = proto.Unmarshal(b, &p); err != nil {
  373. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  374. return
  375. }
  376. if bs, e := protojson.Marshal(&p); e != nil {
  377. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  378. return
  379. } else {
  380. bytes = &bs
  381. serialNumber = p.GetHeader().GetRequestID()
  382. }
  383. case global.T2bBankDepositRsp: // 入金应答
  384. var p pb.T2BBankDepositRsp
  385. if err = proto.Unmarshal(b, &p); err != nil {
  386. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  387. return
  388. }
  389. if bs, e := protojson.Marshal(&p); e != nil {
  390. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  391. return
  392. } else {
  393. bytes = &bs
  394. serialNumber = p.GetHeader().GetRequestID()
  395. }
  396. case global.WarehouseApplyRsp: // 仓库申请应答
  397. var p pb.WarehouseApplyRsp
  398. if err = proto.Unmarshal(b, &p); err != nil {
  399. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  400. return
  401. }
  402. if bs, e := protojson.Marshal(&p); e != nil {
  403. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  404. return
  405. } else {
  406. bytes = &bs
  407. serialNumber = p.GetHeader().GetRequestID()
  408. }
  409. case global.PerformanceContractedApplyRsp: // 违约申请应答
  410. var p pb.PerformanceContractedApplyRsp
  411. if err = proto.Unmarshal(b, &p); err != nil {
  412. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  413. return
  414. }
  415. if bs, e := protojson.Marshal(&p); e != nil {
  416. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  417. return
  418. } else {
  419. bytes = &bs
  420. serialNumber = p.GetHeader().GetRequestID()
  421. }
  422. case global.PerformanceDelayApplyRsp: // 延期申请应答
  423. var p pb.PerformanceDelayApplyRsp
  424. if err = proto.Unmarshal(b, &p); err != nil {
  425. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  426. return
  427. }
  428. if bs, e := protojson.Marshal(&p); e != nil {
  429. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  430. return
  431. } else {
  432. bytes = &bs
  433. serialNumber = p.GetHeader().GetRequestID()
  434. }
  435. case global.PerformanceManualConfirmRsp: // 履约手动确认应答
  436. var p pb.PerformanceManualConfirmRsp
  437. if err = proto.Unmarshal(b, &p); err != nil {
  438. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  439. return
  440. }
  441. if bs, e := protojson.Marshal(&p); e != nil {
  442. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  443. return
  444. } else {
  445. bytes = &bs
  446. serialNumber = p.GetHeader().GetRequestID()
  447. }
  448. case global.PerformanceModifyContactRsp: // 履约修改联络信息回应
  449. var p pb.PerformanceModifyContactRsp
  450. if err = proto.Unmarshal(b, &p); err != nil {
  451. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  452. return
  453. }
  454. if bs, e := protojson.Marshal(&p); e != nil {
  455. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  456. return
  457. } else {
  458. bytes = &bs
  459. serialNumber = p.GetHeader().GetRequestID()
  460. }
  461. case global.GoodsFavoriteOperateRsp: // 商品收藏操作接口应答
  462. var p pb.GoodsFavoriteOperateRsp
  463. if err = proto.Unmarshal(b, &p); err != nil {
  464. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  465. return
  466. }
  467. if bs, e := protojson.Marshal(&p); e != nil {
  468. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  469. return
  470. } else {
  471. bytes = &bs
  472. serialNumber = p.GetHeader().GetRequestID()
  473. }
  474. case global.ZSBuyOrderListingRsp: // 钻石买挂牌接口应答
  475. var p pb.ZSBuyOrderListingRsp
  476. if err = proto.Unmarshal(b, &p); err != nil {
  477. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  478. return
  479. }
  480. if bs, e := protojson.Marshal(&p); e != nil {
  481. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  482. return
  483. } else {
  484. bytes = &bs
  485. serialNumber = p.GetHeader().GetRequestID()
  486. }
  487. case global.ZSSellOrderListingRsp: // 钻石卖挂牌接口响应
  488. var p pb.ZSSellOrderListingRsp
  489. if err = proto.Unmarshal(b, &p); err != nil {
  490. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  491. return
  492. }
  493. if bs, e := protojson.Marshal(&p); e != nil {
  494. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  495. return
  496. } else {
  497. bytes = &bs
  498. serialNumber = p.GetHeader().GetRequestID()
  499. }
  500. case global.ZSBuyOrderDestingRsp: // 钻石卖摘牌申请接口响应
  501. var p pb.ZSBuyOrderDestingRsp
  502. if err = proto.Unmarshal(b, &p); err != nil {
  503. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  504. return
  505. }
  506. if bs, e := protojson.Marshal(&p); e != nil {
  507. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  508. return
  509. } else {
  510. bytes = &bs
  511. serialNumber = p.GetHeader().GetRequestID()
  512. }
  513. case global.ZSSellOrderDestingApplyOperateRsp: // 钻石卖摘牌申请操作接口应答
  514. var p pb.ZSSellOrderDestingApplyOperateRsp
  515. if err = proto.Unmarshal(b, &p); err != nil {
  516. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  517. return
  518. }
  519. if bs, e := protojson.Marshal(&p); e != nil {
  520. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  521. return
  522. } else {
  523. bytes = &bs
  524. serialNumber = p.GetHeader().GetRequestID()
  525. }
  526. case global.ZSBuyOrderDestingNegPriceRsp: // 买摘牌询价接口应答
  527. var p pb.ZSBuyOrderDestingNegPriceRsp
  528. if err = proto.Unmarshal(b, &p); err != nil {
  529. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  530. return
  531. }
  532. if bs, e := protojson.Marshal(&p); e != nil {
  533. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  534. return
  535. } else {
  536. bytes = &bs
  537. serialNumber = p.GetHeader().GetRequestID()
  538. }
  539. case global.ZSBuyOrderDestingNegPriceOperateRsp: // 买摘牌询价操作接口应答
  540. var p pb.ZSBuyOrderDestingNegPriceOperateRsp
  541. if err = proto.Unmarshal(b, &p); err != nil {
  542. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  543. return
  544. }
  545. if bs, e := protojson.Marshal(&p); e != nil {
  546. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  547. return
  548. } else {
  549. bytes = &bs
  550. serialNumber = p.GetHeader().GetRequestID()
  551. }
  552. case global.WRListingCancelOrderRsp: // 挂牌撤单应答
  553. var p pb.WRListingCancelOrderRsp
  554. if err = proto.Unmarshal(b, &p); err != nil {
  555. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  556. return
  557. }
  558. if bs, e := protojson.Marshal(&p); e != nil {
  559. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  560. return
  561. } else {
  562. bytes = &bs
  563. serialNumber = p.GetHeader().GetRequestID()
  564. }
  565. case global.HdWROrderRsp:
  566. var p pb.HdWROrderRsp
  567. if err = proto.Unmarshal(b, &p); err != nil {
  568. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  569. return
  570. }
  571. if bs, e := protojson.Marshal(&p); e != nil {
  572. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  573. return
  574. } else {
  575. bytes = &bs
  576. serialNumber = p.GetHeader().GetRequestID()
  577. }
  578. case global.WROutApplyRsp:
  579. var p pb.WROutApplyRsp
  580. if err = proto.Unmarshal(b, &p); err != nil {
  581. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  582. return
  583. }
  584. if bs, e := protojson.Marshal(&p); e != nil {
  585. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  586. return
  587. } else {
  588. bytes = &bs
  589. serialNumber = p.GetHeader().GetRequestID()
  590. }
  591. case global.ReceiptZSOutApplyRsp: // 钻石出库申请接口响应
  592. var p pb.ReceiptZSOutApplyRsp
  593. if err = proto.Unmarshal(b, &p); err != nil {
  594. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  595. return
  596. }
  597. if bs, e := protojson.Marshal(&p); e != nil {
  598. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  599. return
  600. } else {
  601. bytes = &bs
  602. serialNumber = p.GetHeader().GetRequestID()
  603. }
  604. case global.SpotPresaleListingOrderRsp: // 铁合金现货预售挂牌接口应答
  605. var p pb.SpotPresaleListingOrderRsp
  606. if err = proto.Unmarshal(b, &p); err != nil {
  607. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  608. return
  609. }
  610. if bs, e := protojson.Marshal(&p); e != nil {
  611. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  612. return
  613. } else {
  614. bytes = &bs
  615. serialNumber = p.GetHeader().GetRequestID()
  616. }
  617. case global.CJJCMemberOperateRsp: // 出境检测会员操作响应
  618. var p pb.CJJCMemberOperateRsp
  619. if err = proto.Unmarshal(b, &p); err != nil {
  620. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  621. return
  622. }
  623. if bs, e := protojson.Marshal(&p); e != nil {
  624. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  625. return
  626. } else {
  627. bytes = &bs
  628. serialNumber = p.GetHeader().GetRequestID()
  629. }
  630. case global.BSFWMemberOperateRsp: // 保税服务会员操作响应
  631. var p pb.BSFWMemberOperateRsp
  632. if err = proto.Unmarshal(b, &p); err != nil {
  633. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  634. return
  635. }
  636. if bs, e := protojson.Marshal(&p); e != nil {
  637. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  638. return
  639. } else {
  640. bytes = &bs
  641. serialNumber = p.GetHeader().GetRequestID()
  642. }
  643. case global.AccountFundInfoRsp: // 账户资金信息响应
  644. var p pb.AccountFundInfoRsp
  645. if err = proto.Unmarshal(b, &p); err != nil {
  646. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  647. return
  648. }
  649. if bs, e := protojson.Marshal(&p); e != nil {
  650. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  651. return
  652. } else {
  653. bytes = &bs
  654. serialNumber = p.GetHeader().GetRequestID()
  655. }
  656. case global.GZPresaleApplyRsp: // 广钻预售申请响应
  657. var p pb.GZPresaleApplyRsp
  658. if err = proto.Unmarshal(b, &p); err != nil {
  659. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  660. return
  661. }
  662. if bs, e := protojson.Marshal(&p); e != nil {
  663. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  664. return
  665. } else {
  666. bytes = &bs
  667. serialNumber = p.GetHeader().GetRequestID()
  668. }
  669. case global.GZPresaleOrderRsp: // 广钻预售认购下单响应
  670. var p pb.GZPresaleOrderRsp
  671. if err = proto.Unmarshal(b, &p); err != nil {
  672. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  673. return
  674. }
  675. if bs, e := protojson.Marshal(&p); e != nil {
  676. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  677. return
  678. } else {
  679. bytes = &bs
  680. serialNumber = p.GetHeader().GetRequestID()
  681. }
  682. case global.GZCenterPurchaseApplyRsp: // 广钻集采申请响应
  683. var p pb.GZCenterPurchaseApplyRsp
  684. if err = proto.Unmarshal(b, &p); err != nil {
  685. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  686. return
  687. }
  688. if bs, e := protojson.Marshal(&p); e != nil {
  689. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  690. return
  691. } else {
  692. bytes = &bs
  693. serialNumber = p.GetHeader().GetRequestID()
  694. }
  695. case global.GZCenterPurchaseOrderRsp: // 广钻集采认购下单响应
  696. var p pb.GZCenterPurchaseOrderRsp
  697. if err = proto.Unmarshal(b, &p); err != nil {
  698. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  699. return
  700. }
  701. if bs, e := protojson.Marshal(&p); e != nil {
  702. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  703. return
  704. } else {
  705. bytes = &bs
  706. serialNumber = p.GetHeader().GetRequestID()
  707. }
  708. case global.BSWMSReckonPayRsp: // WMS结算单支付接口响应
  709. var p pb.BSWMSReckonPayRsp
  710. if err = proto.Unmarshal(b, &p); err != nil {
  711. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  712. return
  713. }
  714. if bs, e := protojson.Marshal(&p); e != nil {
  715. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  716. return
  717. } else {
  718. bytes = &bs
  719. serialNumber = p.GetHeader().GetRequestID()
  720. }
  721. case global.OrderRsp:
  722. var p pb.OrderRsp
  723. if err = proto.Unmarshal(b, &p); err != nil {
  724. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  725. return
  726. }
  727. if bs, e := protojson.Marshal(&p); e != nil {
  728. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  729. return
  730. } else {
  731. bytes = &bs
  732. serialNumber = p.GetHeader().GetRequestID()
  733. }
  734. case global.CancelOrderRsp:
  735. var p pb.CancelOrderRsp
  736. if err = proto.Unmarshal(b, &p); err != nil {
  737. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  738. return
  739. }
  740. if bs, e := protojson.Marshal(&p); e != nil {
  741. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  742. return
  743. } else {
  744. bytes = &bs
  745. serialNumber = p.GetHeader().GetRequestID()
  746. }
  747. case global.HolderCloseRsp:
  748. var p pb.HolderCloseRsp
  749. if err = proto.Unmarshal(b, &p); err != nil {
  750. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  751. return
  752. }
  753. if bs, e := protojson.Marshal(&p); e != nil {
  754. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  755. return
  756. } else {
  757. bytes = &bs
  758. serialNumber = p.GetHeader().GetRequestID()
  759. }
  760. case global.DeliveryOrderRsp:
  761. var p pb.DeliveryOrderRsp
  762. if err = proto.Unmarshal(b, &p); err != nil {
  763. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  764. return
  765. }
  766. if bs, e := protojson.Marshal(&p); e != nil {
  767. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  768. return
  769. } else {
  770. bytes = &bs
  771. serialNumber = p.GetHeader().GetRequestID()
  772. }
  773. case global.MakeUpDepositRsp:
  774. var p pb.MakeUpDepositRsp
  775. if err = proto.Unmarshal(b, &p); err != nil {
  776. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  777. return
  778. }
  779. if bs, e := protojson.Marshal(&p); e != nil {
  780. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  781. return
  782. } else {
  783. bytes = &bs
  784. serialNumber = p.GetHeader().GetRequestID()
  785. }
  786. case global.HoldAppendDepositRsp:
  787. var p pb.HoldAppendDepositRsp
  788. if err = proto.Unmarshal(b, &p); err != nil {
  789. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  790. return
  791. }
  792. if bs, e := protojson.Marshal(&p); e != nil {
  793. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  794. return
  795. } else {
  796. bytes = &bs
  797. serialNumber = p.GetHeader().GetRequestID()
  798. }
  799. case global.OfflineDeliveryRsp:
  800. var p pb.OfflineDeliveryRsp
  801. if err = proto.Unmarshal(b, &p); err != nil {
  802. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  803. return
  804. }
  805. if bs, e := protojson.Marshal(&p); e != nil {
  806. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  807. return
  808. } else {
  809. bytes = &bs
  810. serialNumber = p.GetHeader().GetRequestID()
  811. }
  812. case global.HdWRDealOrderRsp:
  813. var p pb.HdWRDealOrderRsp
  814. if err = proto.Unmarshal(b, &p); err != nil {
  815. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  816. return
  817. }
  818. if bs, e := protojson.Marshal(&p); e != nil {
  819. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  820. return
  821. } else {
  822. bytes = &bs
  823. serialNumber = p.GetHeader().GetRequestID()
  824. }
  825. case global.SupplementDepositRsp:
  826. var p pb.SupplementDepositRsp
  827. if err = proto.Unmarshal(b, &p); err != nil {
  828. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  829. return
  830. }
  831. if bs, e := protojson.Marshal(&p); e != nil {
  832. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  833. return
  834. } else {
  835. bytes = &bs
  836. serialNumber = p.GetHeader().GetRequestID()
  837. }
  838. case global.RefundedDepositRsp:
  839. var p pb.RefundedDepositRsp
  840. if err = proto.Unmarshal(b, &p); err != nil {
  841. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  842. return
  843. }
  844. if bs, e := protojson.Marshal(&p); e != nil {
  845. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  846. return
  847. } else {
  848. bytes = &bs
  849. serialNumber = p.GetHeader().GetRequestID()
  850. }
  851. case global.MarketOrderDeliveryApplyRsp:
  852. var p pb.MarketOrderDeliveryApplyRsp
  853. if err = proto.Unmarshal(b, &p); err != nil {
  854. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  855. return
  856. }
  857. if bs, e := protojson.Marshal(&p); e != nil {
  858. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  859. return
  860. } else {
  861. bytes = &bs
  862. serialNumber = p.GetHeader().GetRequestID()
  863. }
  864. case global.DeliveryClientOperatorRsp:
  865. var p pb.DeliveryClientOperatorRsp
  866. if err = proto.Unmarshal(b, &p); err != nil {
  867. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  868. return
  869. }
  870. if bs, e := protojson.Marshal(&p); e != nil {
  871. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  872. return
  873. } else {
  874. bytes = &bs
  875. serialNumber = p.GetHeader().GetRequestID()
  876. }
  877. }
  878. return
  879. }
  880. // RabbitMQSubscribeTopic 订阅主题
  881. func RabbitMQSubscribeTopic() (err error) {
  882. // 订阅需要的总线响应主题
  883. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_USER); err != nil {
  884. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  885. return
  886. }
  887. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_NTF); err != nil {
  888. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  889. return
  890. }
  891. if err = rabbitmq.SubscribeTopic(global.TOPIC_CLIENT_NTF); err != nil {
  892. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  893. return
  894. }
  895. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_QKERNEL); err != nil {
  896. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  897. return
  898. }
  899. if err = rabbitmq.SubscribeTopic(global.TOPIC_MANAGE_RSP); err != nil {
  900. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  901. return
  902. }
  903. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_BANK); err != nil {
  904. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  905. return
  906. }
  907. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_MONEY); err != nil {
  908. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  909. return
  910. }
  911. if err = rabbitmq.SubscribeTopic(global.TOPIC_PERFORMANCE_RSP); err != nil {
  912. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  913. return
  914. }
  915. if err = rabbitmq.SubscribeTopic(global.TOPIC_WAREHOUSE_RECIEPT_RSP); err != nil {
  916. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  917. return
  918. }
  919. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE); err != nil {
  920. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  921. return
  922. }
  923. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE_GZ); err != nil {
  924. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  925. return
  926. }
  927. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_CJBS_TRADE_GZ); err != nil {
  928. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  929. return
  930. }
  931. // 铁合金
  932. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_PRESALE_THJ); err != nil {
  933. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  934. return
  935. }
  936. if err = rabbitmq.SubscribeTopic(global.TOPIC_MANAGER_THJ_NTF); err != nil {
  937. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  938. return
  939. }
  940. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_PRESALE_GZ); err != nil {
  941. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  942. return
  943. }
  944. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_CENTERPURCHASE_GZ); err != nil {
  945. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  946. return
  947. }
  948. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_ORDER); err != nil {
  949. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  950. return
  951. }
  952. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_DELIVERY_TRADE); err != nil {
  953. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  954. return
  955. }
  956. global.M2A_LOG.Info("rabbitmq subscribe topic successed.")
  957. return
  958. }
  959. // StartRabbitMQReceive 开始接收总线消息
  960. func StartRabbitMQReceive() {
  961. t := &MQProc{}
  962. go func() {
  963. for _, subinfo := range rabbitmq.SubInfos {
  964. rabbitmq.Receive(subinfo.Topic, subinfo.QueueName, t)
  965. }
  966. }()
  967. }
  968. // InitFuncodeTopic 初始化功能码主题MAP
  969. func InitFuncodeTopic() {
  970. if global.M2A_FuncodeTopic == nil {
  971. global.M2A_FuncodeTopic = make(map[string][]int)
  972. }
  973. global.M2A_FuncodeTopic[global.TOPIC_REQ_QKERNEL] = []int{
  974. global.ModifyPwdReq,
  975. }
  976. global.M2A_FuncodeTopic[global.TOPIC_MANAGE_REQ] = []int{
  977. global.UserReceiveInfoReq,
  978. global.DelUserReceiveInfoReq,
  979. global.UserReceiveIsDefaultReq,
  980. global.UserReceiptInfoReq,
  981. global.DelUserReceiptInfoReq,
  982. global.WarehouseApplyReq,
  983. global.WROutApplyReq,
  984. }
  985. global.M2A_FuncodeTopic[global.TOPIC_REQ_BANK] = []int{
  986. global.T2bBankSignReq,
  987. global.T2bBankCancelSignReq,
  988. global.T2bBankWithdrawReq,
  989. global.T2bBankDepositReq,
  990. }
  991. global.M2A_FuncodeTopic[global.TOPIC_REQ_MONEY] = []int{
  992. global.AccountFundInfoReq,
  993. }
  994. global.M2A_FuncodeTopic[global.TOPIC_PERFORMANCE_REQ] = []int{
  995. global.PerformanceContractedApplyReq,
  996. global.PerformanceDelayApplyReq,
  997. global.PerformanceManualConfirmReq,
  998. global.PerformanceModifyContactReq,
  999. }
  1000. global.M2A_FuncodeTopic[global.TOPIC_WAREHOUSE_RECIEPT] = []int{
  1001. global.ReceiptZSOutApplyReq,
  1002. }
  1003. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE] = []int{
  1004. global.WRListingCancelOrderReq,
  1005. global.HdWROrderReq,
  1006. global.HdWRDealOrderReq,
  1007. }
  1008. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE_GZ] = []int{
  1009. global.GoodsFavoriteOperateReq,
  1010. global.ZSBuyOrderListingReq,
  1011. global.ZSSellOrderListingReq,
  1012. global.ZSBuyOrderDestingReq,
  1013. global.ZSSellOrderDestingApplyReq,
  1014. global.ZSSellOrderDestingApplyOperateReq,
  1015. global.ZSBuyOrderDestingNegPriceReq,
  1016. global.ZSBuyOrderDestingNegPriceOperateReq,
  1017. }
  1018. global.M2A_FuncodeTopic[global.TOPIC_REQ_CJBS_TRADE_GZ] = []int{
  1019. global.CJJCMemberOperateReq,
  1020. global.BSFWMemberOperateReq,
  1021. global.BSWMSReckonPayReq,
  1022. }
  1023. // 铁合金
  1024. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_THJ] = []int{
  1025. global.SpotPresaleListingOrderReq,
  1026. }
  1027. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_GZ] = []int{
  1028. global.GZPresaleApplyReq,
  1029. global.GZPresaleOrderReq,
  1030. }
  1031. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_CENTERPURCHASE_GZ] = []int{
  1032. global.GZCenterPurchaseApplyReq,
  1033. global.GZCenterPurchaseOrderReq,
  1034. }
  1035. global.M2A_FuncodeTopic[global.TOPIC_REQ_ORDER] = []int{
  1036. global.OrderReq,
  1037. global.CancelOrderReq,
  1038. global.HolderCloseReq,
  1039. global.MakeUpDepositReq,
  1040. global.HoldAppendDepositReq,
  1041. global.OfflineDeliveryReq,
  1042. global.SupplementDepositReq,
  1043. global.RefundedDepositReq,
  1044. global.MarketOrderDeliveryApplyReq,
  1045. global.DeliveryClientOperatorReq,
  1046. }
  1047. global.M2A_FuncodeTopic[global.TOPIC_REQ_DELIVERY_TRADE] = []int{
  1048. global.DeliveryOrderReq,
  1049. }
  1050. global.M2A_FuncodeTopic[global.TOPIC_REQ_USER] = []int{
  1051. global.LoginReq,
  1052. }
  1053. }