消息服务RPC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
835 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. package msgrpc
  2. const DES_KEY = "msgsirpc"
  3. type Req struct {
  4. SiteId string
  5. Dbname string
  6. }
  7. type MsgBody struct {
  8. Req
  9. Platform string
  10. BusinessId string
  11. Domainname string
  12. Type string
  13. Data string
  14. OrderSn string
  15. Memo string
  16. }
  17. type MsgSend struct {
  18. Id string
  19. }
  20. type NoticeSend struct {
  21. Req
  22. Domain string
  23. UserId string
  24. ManagerId string
  25. TargetType string
  26. TargetId string
  27. TemplateData map[string]string
  28. }
  29. func rpc_server_conn(url ...string) (*MsgRpcServiceClient, error) {
  30. var wx_rpc_url string = "127.0.0.1:7954"
  31. if len(url) > 0 && url[0] != "" {
  32. wx_rpc_url = url[0]
  33. }
  34. conn, _, err := DialMsgRpcService("tcp", wx_rpc_url)
  35. if err != nil {
  36. return nil, err
  37. }
  38. return conn, nil
  39. }