rabbitmq.go 35 KB

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