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

41 lines
633 B

3 years ago
3 years ago
  1. package msgrpc
  2. import (
  3. "git.tetele.net/tgo/conf"
  4. )
  5. const DES_KEY = "msgsirpc"
  6. type Req struct {
  7. SiteId string
  8. Dbname string
  9. }
  10. type MsgBody struct {
  11. Req
  12. Platform string
  13. BusinessId string
  14. Domainname string
  15. Type string
  16. Data string
  17. OrderSn string
  18. Memo string
  19. }
  20. type MsgSend struct {
  21. Id string
  22. }
  23. func rpc_server_conn(url ...string) (*MsgRpcServiceClient, error) {
  24. var wx_rpc_url string = "127.0.0.1:" + conf.MSG_RPC_PORT
  25. if len(url) > 0 && url[0] != "" {
  26. wx_rpc_url = url[0]
  27. }
  28. conn, _, err := DialMsgRpcService("tcp", wx_rpc_url)
  29. if err != nil {
  30. return nil, err
  31. }
  32. return conn, nil
  33. }