package msgrpc
|
|
|
|
const DES_KEY = "msgsirpc"
|
|
|
|
type Req struct {
|
|
SiteId string
|
|
Dbname string
|
|
}
|
|
|
|
type MsgBody struct {
|
|
Req
|
|
Platform string
|
|
BusinessId string
|
|
Domainname string
|
|
Type string
|
|
Data string
|
|
OrderSn string
|
|
Memo string
|
|
}
|
|
|
|
type MsgSend struct {
|
|
Id string
|
|
}
|
|
|
|
type NoticeSend struct {
|
|
Req
|
|
Domain string
|
|
UserId string
|
|
ManagerId string
|
|
TargetType string
|
|
TargetId string
|
|
TemplateData map[string]string
|
|
SmsData []string
|
|
}
|
|
|
|
func rpc_server_conn(url ...string) (*MsgRpcServiceClient, error) {
|
|
|
|
var wx_rpc_url string = "127.0.0.1:7954"
|
|
if len(url) > 0 && url[0] != "" {
|
|
wx_rpc_url = url[0]
|
|
}
|
|
conn, _, err := DialMsgRpcService("tcp", wx_rpc_url)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return conn, nil
|
|
}
|