rabbitmq.go 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  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("总线数据反序列化失败", 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("总线数据反序列化失败", 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.OrderDealedNtf: // 委托单成交通知
  156. var p pb.OrderDealedNtf
  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("总线数据反序列化失败", zap.Error(err))
  163. return
  164. } else {
  165. sendBytes = &bs
  166. }
  167. // 获取目标客户
  168. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  169. if err != nil {
  170. return
  171. }
  172. case global.MarketStatusChangeNtf: // 市场状态变更通知
  173. var p pb.MarketStatusChangeNtf
  174. if err = proto.Unmarshal(*bytes, &p); err != nil {
  175. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  176. return
  177. }
  178. if bs, e := protojson.Marshal(&p); e != nil {
  179. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  180. return
  181. } else {
  182. sendBytes = &bs
  183. }
  184. // 获取目标客户
  185. clients = make([]*client.Client, 0)
  186. for i := range client.Clients {
  187. c := client.Clients[i]
  188. clients = append(clients, c)
  189. }
  190. case global.ListingOrderChangeNtf: // 挂牌委托变更广播通知
  191. var p pb.ListingOrderChangeNtf
  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("总线数据反序列化失败", 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. }
  209. if err == nil && len(clients) > 0 {
  210. // 组装待发送给客户端的5.0报文包
  211. b, err := packet.BuildPacket(funcode, 0, 0, *sendBytes, true)
  212. if err != nil {
  213. global.M2A_LOG.Error("组装5.0报文失败", zap.Error(err))
  214. return
  215. }
  216. // 发送信息
  217. for i := range clients {
  218. c := clients[i]
  219. c.WriteTradeWsBuf(b)
  220. }
  221. }
  222. }
  223. // getRspProtobuf 将总线回复的数据反序列化为Protobuf
  224. func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32, bytes *[]byte, serialNumber uint32, err error) {
  225. // 分解总线包信息
  226. funcode = utils.BytesToUint32((*msg)[0:4])
  227. sessionId = utils.BytesToUint32((*msg)[4:8])
  228. b := (*msg)[8:]
  229. global.M2A_LOG.Info("收到总线消息", zap.Any("funcode", funcode), zap.Any("sessionId", sessionId), zap.Any("len", len(b)))
  230. switch int(funcode) {
  231. case global.MoneyChangedNtf,
  232. global.OrderDealedNtf,
  233. global.MarketStatusChangeNtf,
  234. global.LoginRsp,
  235. global.LogoutRsp,
  236. global.ListingOrderChangeNtf: // 资金变化通知等
  237. bytes = &b
  238. case global.ModifyPwdRsp: // 修改账户密码应答
  239. var p pb.ModifyPwdRsp
  240. if err = proto.Unmarshal(b, &p); err != nil {
  241. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  242. return
  243. }
  244. if bs, e := protojson.Marshal(&p); e != nil {
  245. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  246. return
  247. } else {
  248. bytes = &bs
  249. serialNumber = p.GetHeader().GetRequestID()
  250. }
  251. case global.UserReceiveInfoRsp: // 新增修改收货地址请求响应
  252. var p pb.UserReceiveInfoRsp
  253. if err = proto.Unmarshal(b, &p); err != nil {
  254. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  255. return
  256. }
  257. if bs, e := protojson.Marshal(&p); e != nil {
  258. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  259. return
  260. } else {
  261. bytes = &bs
  262. serialNumber = p.GetHeader().GetRequestID()
  263. }
  264. case global.DelUserReceiveInfoRsp: // 删除收货地址请求响应
  265. var p pb.DelUserReceiveInfoRsp
  266. if err = proto.Unmarshal(b, &p); err != nil {
  267. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  268. return
  269. }
  270. if bs, e := protojson.Marshal(&p); e != nil {
  271. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  272. return
  273. } else {
  274. bytes = &bs
  275. serialNumber = p.GetHeader().GetRequestID()
  276. }
  277. case global.UserReceiveIsDefaultRsp:
  278. var p pb.UserReceiveIsDefaultRsp
  279. if err = proto.Unmarshal(b, &p); err != nil {
  280. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  281. return
  282. }
  283. if bs, e := protojson.Marshal(&p); e != nil {
  284. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  285. return
  286. } else {
  287. bytes = &bs
  288. serialNumber = p.GetHeader().GetRequestID()
  289. }
  290. case global.UserReceiptInfoRsp: // 新增修改用户发票信息请求响应
  291. var p pb.UserReceiptInfoRsp
  292. if err = proto.Unmarshal(b, &p); err != nil {
  293. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  294. return
  295. }
  296. if bs, e := protojson.Marshal(&p); e != nil {
  297. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  298. return
  299. } else {
  300. bytes = &bs
  301. serialNumber = p.GetHeader().GetRequestID()
  302. }
  303. case global.DelUserReceiptInfoRsp: // 删除用户发票信息请求响应
  304. var p pb.DelUserReceiptInfoRsp
  305. if err = proto.Unmarshal(b, &p); err != nil {
  306. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  307. return
  308. }
  309. if bs, e := protojson.Marshal(&p); e != nil {
  310. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  311. return
  312. } else {
  313. bytes = &bs
  314. serialNumber = p.GetHeader().GetRequestID()
  315. }
  316. case global.T2bBankSignRsp: // 签约应答
  317. var p pb.T2BBankSignRsp
  318. if err = proto.Unmarshal(b, &p); err != nil {
  319. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  320. return
  321. }
  322. if bs, e := protojson.Marshal(&p); e != nil {
  323. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  324. return
  325. } else {
  326. bytes = &bs
  327. serialNumber = p.GetHeader().GetRequestID()
  328. }
  329. case global.T2bBankCancelSignRsp: // 解约应答
  330. var p pb.T2BBankCancelSignRsp
  331. if err = proto.Unmarshal(b, &p); err != nil {
  332. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  333. return
  334. }
  335. if bs, e := protojson.Marshal(&p); e != nil {
  336. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  337. return
  338. } else {
  339. bytes = &bs
  340. serialNumber = p.GetHeader().GetRequestID()
  341. }
  342. case global.T2bBankWithdrawRsp: // 出金应答
  343. var p pb.T2BBankWithdrawRsp
  344. if err = proto.Unmarshal(b, &p); err != nil {
  345. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  346. return
  347. }
  348. if bs, e := protojson.Marshal(&p); e != nil {
  349. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  350. return
  351. } else {
  352. bytes = &bs
  353. serialNumber = p.GetHeader().GetRequestID()
  354. }
  355. case global.T2bBankDepositRsp: // 入金应答
  356. var p pb.T2BBankDepositRsp
  357. if err = proto.Unmarshal(b, &p); err != nil {
  358. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  359. return
  360. }
  361. if bs, e := protojson.Marshal(&p); e != nil {
  362. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  363. return
  364. } else {
  365. bytes = &bs
  366. serialNumber = p.GetHeader().GetRequestID()
  367. }
  368. case global.WarehouseApplyRsp: // 仓库申请应答
  369. var p pb.WarehouseApplyRsp
  370. if err = proto.Unmarshal(b, &p); err != nil {
  371. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  372. return
  373. }
  374. if bs, e := protojson.Marshal(&p); e != nil {
  375. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  376. return
  377. } else {
  378. bytes = &bs
  379. serialNumber = p.GetHeader().GetRequestID()
  380. }
  381. case global.PerformanceContractedApplyRsp: // 违约申请应答
  382. var p pb.PerformanceContractedApplyRsp
  383. if err = proto.Unmarshal(b, &p); err != nil {
  384. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  385. return
  386. }
  387. if bs, e := protojson.Marshal(&p); e != nil {
  388. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  389. return
  390. } else {
  391. bytes = &bs
  392. serialNumber = p.GetHeader().GetRequestID()
  393. }
  394. case global.PerformanceDelayApplyRsp: // 延期申请应答
  395. var p pb.PerformanceDelayApplyRsp
  396. if err = proto.Unmarshal(b, &p); err != nil {
  397. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  398. return
  399. }
  400. if bs, e := protojson.Marshal(&p); e != nil {
  401. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  402. return
  403. } else {
  404. bytes = &bs
  405. serialNumber = p.GetHeader().GetRequestID()
  406. }
  407. case global.PerformanceManualConfirmRsp: // 履约手动确认应答
  408. var p pb.PerformanceManualConfirmRsp
  409. if err = proto.Unmarshal(b, &p); err != nil {
  410. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  411. return
  412. }
  413. if bs, e := protojson.Marshal(&p); e != nil {
  414. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  415. return
  416. } else {
  417. bytes = &bs
  418. serialNumber = p.GetHeader().GetRequestID()
  419. }
  420. case global.PerformanceModifyContactRsp: // 履约修改联络信息回应
  421. var p pb.PerformanceModifyContactRsp
  422. if err = proto.Unmarshal(b, &p); err != nil {
  423. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  424. return
  425. }
  426. if bs, e := protojson.Marshal(&p); e != nil {
  427. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  428. return
  429. } else {
  430. bytes = &bs
  431. serialNumber = p.GetHeader().GetRequestID()
  432. }
  433. case global.GoodsFavoriteOperateRsp: // 商品收藏操作接口应答
  434. var p pb.GoodsFavoriteOperateRsp
  435. if err = proto.Unmarshal(b, &p); err != nil {
  436. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  437. return
  438. }
  439. if bs, e := protojson.Marshal(&p); e != nil {
  440. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  441. return
  442. } else {
  443. bytes = &bs
  444. serialNumber = p.GetHeader().GetRequestID()
  445. }
  446. case global.ZSBuyOrderListingRsp: // 钻石买挂牌接口应答
  447. var p pb.ZSBuyOrderListingRsp
  448. if err = proto.Unmarshal(b, &p); err != nil {
  449. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  450. return
  451. }
  452. if bs, e := protojson.Marshal(&p); e != nil {
  453. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  454. return
  455. } else {
  456. bytes = &bs
  457. serialNumber = p.GetHeader().GetRequestID()
  458. }
  459. case global.ZSSellOrderListingRsp: // 钻石卖挂牌接口响应
  460. var p pb.ZSSellOrderListingRsp
  461. if err = proto.Unmarshal(b, &p); err != nil {
  462. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  463. return
  464. }
  465. if bs, e := protojson.Marshal(&p); e != nil {
  466. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  467. return
  468. } else {
  469. bytes = &bs
  470. serialNumber = p.GetHeader().GetRequestID()
  471. }
  472. case global.ZSBuyOrderDestingRsp: // 钻石卖摘牌申请接口响应
  473. var p pb.ZSBuyOrderDestingRsp
  474. if err = proto.Unmarshal(b, &p); err != nil {
  475. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  476. return
  477. }
  478. if bs, e := protojson.Marshal(&p); e != nil {
  479. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  480. return
  481. } else {
  482. bytes = &bs
  483. serialNumber = p.GetHeader().GetRequestID()
  484. }
  485. case global.ZSSellOrderDestingApplyOperateRsp: // 钻石卖摘牌申请操作接口应答
  486. var p pb.ZSSellOrderDestingApplyOperateRsp
  487. if err = proto.Unmarshal(b, &p); err != nil {
  488. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  489. return
  490. }
  491. if bs, e := protojson.Marshal(&p); e != nil {
  492. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  493. return
  494. } else {
  495. bytes = &bs
  496. serialNumber = p.GetHeader().GetRequestID()
  497. }
  498. case global.ZSBuyOrderDestingNegPriceRsp: // 买摘牌询价接口应答
  499. var p pb.ZSBuyOrderDestingNegPriceRsp
  500. if err = proto.Unmarshal(b, &p); err != nil {
  501. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  502. return
  503. }
  504. if bs, e := protojson.Marshal(&p); e != nil {
  505. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  506. return
  507. } else {
  508. bytes = &bs
  509. serialNumber = p.GetHeader().GetRequestID()
  510. }
  511. case global.ZSBuyOrderDestingNegPriceOperateRsp: // 买摘牌询价操作接口应答
  512. var p pb.ZSBuyOrderDestingNegPriceOperateRsp
  513. if err = proto.Unmarshal(b, &p); err != nil {
  514. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  515. return
  516. }
  517. if bs, e := protojson.Marshal(&p); e != nil {
  518. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  519. return
  520. } else {
  521. bytes = &bs
  522. serialNumber = p.GetHeader().GetRequestID()
  523. }
  524. case global.WRListingCancelOrderRsp: // 挂牌撤单应答
  525. var p pb.WRListingCancelOrderRsp
  526. if err = proto.Unmarshal(b, &p); err != nil {
  527. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  528. return
  529. }
  530. if bs, e := protojson.Marshal(&p); e != nil {
  531. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  532. return
  533. } else {
  534. bytes = &bs
  535. serialNumber = p.GetHeader().GetRequestID()
  536. }
  537. case global.HdWROrderRsp:
  538. var p pb.HdWROrderRsp
  539. if err = proto.Unmarshal(b, &p); err != nil {
  540. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  541. return
  542. }
  543. if bs, e := protojson.Marshal(&p); e != nil {
  544. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  545. return
  546. } else {
  547. bytes = &bs
  548. serialNumber = p.GetHeader().GetRequestID()
  549. }
  550. case global.WROutApplyRsp:
  551. var p pb.WROutApplyRsp
  552. if err = proto.Unmarshal(b, &p); err != nil {
  553. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  554. return
  555. }
  556. if bs, e := protojson.Marshal(&p); e != nil {
  557. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  558. return
  559. } else {
  560. bytes = &bs
  561. serialNumber = p.GetHeader().GetRequestID()
  562. }
  563. case global.ReceiptZSOutApplyRsp: // 钻石出库申请接口响应
  564. var p pb.ReceiptZSOutApplyRsp
  565. if err = proto.Unmarshal(b, &p); err != nil {
  566. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  567. return
  568. }
  569. if bs, e := protojson.Marshal(&p); e != nil {
  570. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  571. return
  572. } else {
  573. bytes = &bs
  574. serialNumber = p.GetHeader().GetRequestID()
  575. }
  576. case global.SpotPresaleListingOrderRsp: // 铁合金现货预售挂牌接口应答
  577. var p pb.SpotPresaleListingOrderRsp
  578. if err = proto.Unmarshal(b, &p); err != nil {
  579. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  580. return
  581. }
  582. if bs, e := protojson.Marshal(&p); e != nil {
  583. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  584. return
  585. } else {
  586. bytes = &bs
  587. serialNumber = p.GetHeader().GetRequestID()
  588. }
  589. case global.CJJCMemberOperateRsp: // 出境检测会员操作响应
  590. var p pb.CJJCMemberOperateRsp
  591. if err = proto.Unmarshal(b, &p); err != nil {
  592. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  593. return
  594. }
  595. if bs, e := protojson.Marshal(&p); e != nil {
  596. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  597. return
  598. } else {
  599. bytes = &bs
  600. serialNumber = p.GetHeader().GetRequestID()
  601. }
  602. case global.BSFWMemberOperateRsp: // 保税服务会员操作响应
  603. var p pb.BSFWMemberOperateRsp
  604. if err = proto.Unmarshal(b, &p); err != nil {
  605. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  606. return
  607. }
  608. if bs, e := protojson.Marshal(&p); e != nil {
  609. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  610. return
  611. } else {
  612. bytes = &bs
  613. serialNumber = p.GetHeader().GetRequestID()
  614. }
  615. case global.AccountFundInfoRsp: // 账户资金信息响应
  616. var p pb.AccountFundInfoRsp
  617. if err = proto.Unmarshal(b, &p); err != nil {
  618. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  619. return
  620. }
  621. if bs, e := protojson.Marshal(&p); e != nil {
  622. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  623. return
  624. } else {
  625. bytes = &bs
  626. serialNumber = p.GetHeader().GetRequestID()
  627. }
  628. case global.GZPresaleApplyRsp: // 广钻预售申请响应
  629. var p pb.GZPresaleApplyRsp
  630. if err = proto.Unmarshal(b, &p); err != nil {
  631. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  632. return
  633. }
  634. if bs, e := protojson.Marshal(&p); e != nil {
  635. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  636. return
  637. } else {
  638. bytes = &bs
  639. serialNumber = p.GetHeader().GetRequestID()
  640. }
  641. case global.GZPresaleOrderRsp: // 广钻预售认购下单响应
  642. var p pb.GZPresaleOrderRsp
  643. if err = proto.Unmarshal(b, &p); err != nil {
  644. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  645. return
  646. }
  647. if bs, e := protojson.Marshal(&p); e != nil {
  648. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  649. return
  650. } else {
  651. bytes = &bs
  652. serialNumber = p.GetHeader().GetRequestID()
  653. }
  654. case global.GZCenterPurchaseApplyRsp: // 广钻集采申请响应
  655. var p pb.GZCenterPurchaseApplyRsp
  656. if err = proto.Unmarshal(b, &p); err != nil {
  657. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  658. return
  659. }
  660. if bs, e := protojson.Marshal(&p); e != nil {
  661. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  662. return
  663. } else {
  664. bytes = &bs
  665. serialNumber = p.GetHeader().GetRequestID()
  666. }
  667. case global.GZCenterPurchaseOrderRsp: // 广钻集采认购下单响应
  668. var p pb.GZCenterPurchaseOrderRsp
  669. if err = proto.Unmarshal(b, &p); err != nil {
  670. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  671. return
  672. }
  673. if bs, e := protojson.Marshal(&p); e != nil {
  674. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  675. return
  676. } else {
  677. bytes = &bs
  678. serialNumber = p.GetHeader().GetRequestID()
  679. }
  680. case global.BSWMSReckonPayRsp: // WMS结算单支付接口响应
  681. var p pb.BSWMSReckonPayRsp
  682. if err = proto.Unmarshal(b, &p); err != nil {
  683. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  684. return
  685. }
  686. if bs, e := protojson.Marshal(&p); e != nil {
  687. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  688. return
  689. } else {
  690. bytes = &bs
  691. serialNumber = p.GetHeader().GetRequestID()
  692. }
  693. case global.OrderRsp:
  694. var p pb.OrderRsp
  695. if err = proto.Unmarshal(b, &p); err != nil {
  696. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  697. return
  698. }
  699. if bs, e := protojson.Marshal(&p); e != nil {
  700. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  701. return
  702. } else {
  703. bytes = &bs
  704. serialNumber = p.GetHeader().GetRequestID()
  705. }
  706. case global.CancelOrderRsp:
  707. var p pb.CancelOrderRsp
  708. if err = proto.Unmarshal(b, &p); err != nil {
  709. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  710. return
  711. }
  712. if bs, e := protojson.Marshal(&p); e != nil {
  713. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  714. return
  715. } else {
  716. bytes = &bs
  717. serialNumber = p.GetHeader().GetRequestID()
  718. }
  719. case global.HolderCloseRsp:
  720. var p pb.HolderCloseRsp
  721. if err = proto.Unmarshal(b, &p); err != nil {
  722. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  723. return
  724. }
  725. if bs, e := protojson.Marshal(&p); e != nil {
  726. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  727. return
  728. } else {
  729. bytes = &bs
  730. serialNumber = p.GetHeader().GetRequestID()
  731. }
  732. case global.DeliveryOrderRsp:
  733. var p pb.DeliveryOrderRsp
  734. if err = proto.Unmarshal(b, &p); err != nil {
  735. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  736. return
  737. }
  738. if bs, e := protojson.Marshal(&p); e != nil {
  739. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  740. return
  741. } else {
  742. bytes = &bs
  743. serialNumber = p.GetHeader().GetRequestID()
  744. }
  745. case global.MakeUpDepositRsp:
  746. var p pb.MakeUpDepositRsp
  747. if err = proto.Unmarshal(b, &p); err != nil {
  748. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  749. return
  750. }
  751. if bs, e := protojson.Marshal(&p); e != nil {
  752. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  753. return
  754. } else {
  755. bytes = &bs
  756. serialNumber = p.GetHeader().GetRequestID()
  757. }
  758. case global.HoldAppendDepositRsp:
  759. var p pb.HoldAppendDepositRsp
  760. if err = proto.Unmarshal(b, &p); err != nil {
  761. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  762. return
  763. }
  764. if bs, e := protojson.Marshal(&p); e != nil {
  765. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  766. return
  767. } else {
  768. bytes = &bs
  769. serialNumber = p.GetHeader().GetRequestID()
  770. }
  771. case global.OfflineDeliveryRsp:
  772. var p pb.OfflineDeliveryRsp
  773. if err = proto.Unmarshal(b, &p); err != nil {
  774. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  775. return
  776. }
  777. if bs, e := protojson.Marshal(&p); e != nil {
  778. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  779. return
  780. } else {
  781. bytes = &bs
  782. serialNumber = p.GetHeader().GetRequestID()
  783. }
  784. case global.HdWRDealOrderRsp:
  785. var p pb.HdWRDealOrderRsp
  786. if err = proto.Unmarshal(b, &p); err != nil {
  787. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  788. return
  789. }
  790. if bs, e := protojson.Marshal(&p); e != nil {
  791. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  792. return
  793. } else {
  794. bytes = &bs
  795. serialNumber = p.GetHeader().GetRequestID()
  796. }
  797. case global.SupplementDepositRsp:
  798. var p pb.SupplementDepositRsp
  799. if err = proto.Unmarshal(b, &p); err != nil {
  800. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  801. return
  802. }
  803. if bs, e := protojson.Marshal(&p); e != nil {
  804. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  805. return
  806. } else {
  807. bytes = &bs
  808. serialNumber = p.GetHeader().GetRequestID()
  809. }
  810. case global.RefundedDepositRsp:
  811. var p pb.RefundedDepositRsp
  812. if err = proto.Unmarshal(b, &p); err != nil {
  813. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  814. return
  815. }
  816. if bs, e := protojson.Marshal(&p); e != nil {
  817. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  818. return
  819. } else {
  820. bytes = &bs
  821. serialNumber = p.GetHeader().GetRequestID()
  822. }
  823. case global.MarketOrderDeliveryApplyRsp:
  824. var p pb.MarketOrderDeliveryApplyRsp
  825. if err = proto.Unmarshal(b, &p); err != nil {
  826. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  827. return
  828. }
  829. if bs, e := protojson.Marshal(&p); e != nil {
  830. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  831. return
  832. } else {
  833. bytes = &bs
  834. serialNumber = p.GetHeader().GetRequestID()
  835. }
  836. case global.DeliveryClientOperatorRsp:
  837. var p pb.DeliveryClientOperatorRsp
  838. if err = proto.Unmarshal(b, &p); err != nil {
  839. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  840. return
  841. }
  842. if bs, e := protojson.Marshal(&p); e != nil {
  843. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  844. return
  845. } else {
  846. bytes = &bs
  847. serialNumber = p.GetHeader().GetRequestID()
  848. }
  849. }
  850. return
  851. }
  852. // RabbitMQSubscribeTopic 订阅主题
  853. func RabbitMQSubscribeTopic() (err error) {
  854. // 订阅需要的总线响应主题
  855. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_USER); err != nil {
  856. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  857. return
  858. }
  859. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_NTF); err != nil {
  860. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  861. return
  862. }
  863. if err = rabbitmq.SubscribeTopic(global.TOPIC_CLIENT_NTF); err != nil {
  864. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  865. return
  866. }
  867. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_QKERNEL); err != nil {
  868. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  869. return
  870. }
  871. if err = rabbitmq.SubscribeTopic(global.TOPIC_MANAGE_RSP); err != nil {
  872. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  873. return
  874. }
  875. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_BANK); err != nil {
  876. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  877. return
  878. }
  879. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_MONEY); err != nil {
  880. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  881. return
  882. }
  883. if err = rabbitmq.SubscribeTopic(global.TOPIC_PERFORMANCE_RSP); 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_WAREHOUSE_RECIEPT_RSP); 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_RSP_WAREHOUSE_TRADE); 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_WAREHOUSE_TRADE_GZ); 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_RSP_CJBS_TRADE_GZ); err != nil {
  900. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  901. return
  902. }
  903. // 铁合金
  904. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_PRESALE_THJ); 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_MANAGER_THJ_NTF); 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_PRESALE_GZ); 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_CENTERPURCHASE_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_ORDER); err != nil {
  921. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  922. return
  923. }
  924. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_DELIVERY_TRADE); err != nil {
  925. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  926. return
  927. }
  928. global.M2A_LOG.Info("rabbitmq subscribe topic successed.")
  929. return
  930. }
  931. // StartRabbitMQReceive 开始接收总线消息
  932. func StartRabbitMQReceive() {
  933. t := &MQProc{}
  934. go func() {
  935. for _, subinfo := range rabbitmq.SubInfos {
  936. rabbitmq.Receive(subinfo.Topic, subinfo.QueueName, t)
  937. }
  938. }()
  939. }
  940. // InitFuncodeTopic 初始化功能码主题MAP
  941. func InitFuncodeTopic() {
  942. if global.M2A_FuncodeTopic == nil {
  943. global.M2A_FuncodeTopic = make(map[string][]int)
  944. }
  945. global.M2A_FuncodeTopic[global.TOPIC_REQ_QKERNEL] = []int{
  946. global.ModifyPwdReq,
  947. }
  948. global.M2A_FuncodeTopic[global.TOPIC_MANAGE_REQ] = []int{
  949. global.UserReceiveInfoReq,
  950. global.DelUserReceiveInfoReq,
  951. global.UserReceiveIsDefaultReq,
  952. global.UserReceiptInfoReq,
  953. global.DelUserReceiptInfoReq,
  954. global.WarehouseApplyReq,
  955. global.WROutApplyReq,
  956. }
  957. global.M2A_FuncodeTopic[global.TOPIC_REQ_BANK] = []int{
  958. global.T2bBankSignReq,
  959. global.T2bBankCancelSignReq,
  960. global.T2bBankWithdrawReq,
  961. global.T2bBankDepositReq,
  962. }
  963. global.M2A_FuncodeTopic[global.TOPIC_REQ_MONEY] = []int{
  964. global.AccountFundInfoReq,
  965. }
  966. global.M2A_FuncodeTopic[global.TOPIC_PERFORMANCE_REQ] = []int{
  967. global.PerformanceContractedApplyReq,
  968. global.PerformanceDelayApplyReq,
  969. global.PerformanceManualConfirmReq,
  970. global.PerformanceModifyContactReq,
  971. }
  972. global.M2A_FuncodeTopic[global.TOPIC_WAREHOUSE_RECIEPT] = []int{
  973. global.ReceiptZSOutApplyReq,
  974. }
  975. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE] = []int{
  976. global.WRListingCancelOrderReq,
  977. global.HdWROrderReq,
  978. global.HdWRDealOrderReq,
  979. }
  980. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE_GZ] = []int{
  981. global.GoodsFavoriteOperateReq,
  982. global.ZSBuyOrderListingReq,
  983. global.ZSSellOrderListingReq,
  984. global.ZSBuyOrderDestingReq,
  985. global.ZSSellOrderDestingApplyReq,
  986. global.ZSSellOrderDestingApplyOperateReq,
  987. global.ZSBuyOrderDestingNegPriceReq,
  988. global.ZSBuyOrderDestingNegPriceOperateReq,
  989. }
  990. global.M2A_FuncodeTopic[global.TOPIC_REQ_CJBS_TRADE_GZ] = []int{
  991. global.CJJCMemberOperateReq,
  992. global.BSFWMemberOperateReq,
  993. global.BSWMSReckonPayReq,
  994. }
  995. // 铁合金
  996. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_THJ] = []int{
  997. global.SpotPresaleListingOrderReq,
  998. }
  999. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_GZ] = []int{
  1000. global.GZPresaleApplyReq,
  1001. global.GZPresaleOrderReq,
  1002. }
  1003. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_CENTERPURCHASE_GZ] = []int{
  1004. global.GZCenterPurchaseApplyReq,
  1005. global.GZCenterPurchaseOrderReq,
  1006. }
  1007. global.M2A_FuncodeTopic[global.TOPIC_REQ_ORDER] = []int{
  1008. global.OrderReq,
  1009. global.CancelOrderReq,
  1010. global.HolderCloseReq,
  1011. global.MakeUpDepositReq,
  1012. global.HoldAppendDepositReq,
  1013. global.OfflineDeliveryReq,
  1014. global.SupplementDepositReq,
  1015. global.RefundedDepositReq,
  1016. global.MarketOrderDeliveryApplyReq,
  1017. global.DeliveryClientOperatorReq,
  1018. }
  1019. global.M2A_FuncodeTopic[global.TOPIC_REQ_DELIVERY_TRADE] = []int{
  1020. global.DeliveryOrderReq,
  1021. }
  1022. global.M2A_FuncodeTopic[global.TOPIC_REQ_USER] = []int{
  1023. global.LoginReq,
  1024. }
  1025. }