消息服务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.

48 lines
771 B

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. SmsData []string
  29. }
  30. func rpc_server_conn(url ...string) (*MsgRpcServiceClient, error) {
  31. var wx_rpc_url string = "127.0.0.1:7954"
  32. if len(url) > 0 && url[0] != "" {
  33. wx_rpc_url = url[0]
  34. }
  35. conn, _, err := DialMsgRpcService("tcp", wx_rpc_url)
  36. if err != nil {
  37. return nil, err
  38. }
  39. return conn, nil
  40. }