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

37 lines
597 B

2 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. func rpc_server_conn(url ...string) (*MsgRpcServiceClient, error) {
  21. var wx_rpc_url string = "127.0.0.1:" + conf.MSG_RPC_PORT
  22. if len(url) > 0 && url[0] != "" {
  23. wx_rpc_url = url[0]
  24. }
  25. conn, _, err := DialMsgRpcService("tcp", wx_rpc_url)
  26. if err != nil {
  27. return nil, err
  28. }
  29. return conn, nil
  30. }