From c0058b8a9fea97325352e4eb6aae695e49aa6d40 Mon Sep 17 00:00:00 2001 From: lijianbin <513837235@.qq.com> Date: Tue, 9 Nov 2021 09:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B6=88=E6=81=AF=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.go | 46 ++++++++++++++++++++++++++-------------------- go.mod | 5 +++-- go.sum | 8 ++++---- msg.proto | 1 + 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/common.go b/common.go index 8e7a31f..98c3a42 100644 --- a/common.go +++ b/common.go @@ -3,35 +3,41 @@ package msgrpc const DES_KEY = "msgsirpc" type Req struct { - SiteId string - Dbname string + SiteId string + Dbname string } type MsgBody struct { - Req - Platform string - BusinessId string - Domainname string - Type string - Data string - OrderSn string - Memo string + Req + Platform string + BusinessId string + Domainname string + Type string + Data string + OrderSn string + Memo string } type MsgSend struct { - Id string + Id string +} + +type NoticeSend struct { + Req + ManagerId string + TemplateData map[string]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 - } + 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 + return conn, nil } diff --git a/go.mod b/go.mod index 868a186..0465a40 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,9 @@ module git.tetele.net/tgo/msgrpc go 1.14 require ( - git.tetele.net/tgo/crypter v0.2.2 // indirect - github.com/chai2010/protorpc v1.0.0 // indirect + git.tetele.net/tgo/crypter v0.2.2 + github.com/chai2010/protorpc v1.1.3 + github.com/golang/protobuf v1.0.0 golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect ) diff --git a/go.sum b/go.sum index 1c4b4d9..c760e72 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ git.tetele.net/tgo/crypter v0.2.2 h1:YMQJh2Gj5Po4ZfelJUmXBKi01UbmtiSy3bmqRfnYQMo= git.tetele.net/tgo/crypter v0.2.2/go.mod h1:vfvRLZA8+lHNgNXneOcgvVhDyuv25ZRb+C6xHOmXNx0= -github.com/chai2010/protorpc v1.0.0 h1:aJ45G9sl1utSKo35EqnBSTs5jqTpdJDJAuZMMYPAtFo= -github.com/chai2010/protorpc v1.0.0/go.mod h1:woR3WwjaQDqFjlzdVsFEKiK5Ur12QL8mYxVPjfr5z54= +github.com/chai2010/protorpc v1.1.3 h1:VJK5hIoZn0XCGol0GmbxZkUG6FbTI5LP2Lam6RVd15w= +github.com/chai2010/protorpc v1.1.3/go.mod h1:/wO0kiyVdu7ug8dCMrA2yDr2vLfyhsLEuzLa9J2HJ+I= github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ= github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= diff --git a/msg.proto b/msg.proto index 5be2d19..4a01aa4 100644 --- a/msg.proto +++ b/msg.proto @@ -19,4 +19,5 @@ message Response { // rpc方法 service MsgRpcService { rpc sendMsg (Request) returns (Response); // 发送消息 + rpc sendNotcie (Request) returns (Response); // 跃横推送消息 } \ No newline at end of file