From 76415f46c9347999a7d0ba832ae43f657db2c88f Mon Sep 17 00:00:00 2001 From: listen <494177603@qq.com> Date: Mon, 13 Dec 2021 19:56:35 +0800 Subject: [PATCH] first commit --- common.go | 2 +- go.mod | 2 +- go.sum | 5 +++-- user.client_test.go | 13 +++++++++++++ user.proto | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/common.go b/common.go index 2fce7f8..2909f16 100644 --- a/common.go +++ b/common.go @@ -3,7 +3,7 @@ package userrpc import ( "log" - "git.tetele.net/tgo/conf" + "git.tetele.net/yueheng/conf" ) const DES_KEY = "usersrpc" diff --git a/go.mod b/go.mod index dfaf047..85bcac4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.tetele.net/tgo/userrpc go 1.14 require ( - git.tetele.net/tgo/conf v0.33.1 + git.tetele.net/yueheng/conf v1.2.6 git.tetele.net/tgo/crypter v0.2.2 github.com/chai2010/protorpc v1.1.3 github.com/golang/protobuf v1.0.0 diff --git a/go.sum b/go.sum index 97c2e8d..9b7ce09 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,8 @@ -git.tetele.net/tgo/conf v0.33.1 h1:ZEIv3Vq35RCv5f3T3Uz97s2mkZLl7W5OlmXvzI3/sS8= -git.tetele.net/tgo/conf v0.33.1/go.mod h1:AWVIBEDE5dtotthUgR0SWaR2Qa6/f+O5WQ3s7Tj8q7A= git.tetele.net/tgo/crypter v0.2.2 h1:YMQJh2Gj5Po4ZfelJUmXBKi01UbmtiSy3bmqRfnYQMo= git.tetele.net/tgo/crypter v0.2.2/go.mod h1:vfvRLZA8+lHNgNXneOcgvVhDyuv25ZRb+C6xHOmXNx0= +git.tetele.net/yueheng/conf v0.33.1 h1:ZEIv3Vq35RCv5f3T3Uz97s2mkZLl7W5OlmXvzI3/sS8= +git.tetele.net/yueheng/conf v0.33.1/go.mod h1:AWVIBEDE5dtotthUgR0SWaR2Qa6/f+O5WQ3s7Tj8q7A= +git.tetele.net/yueheng/conf v1.2.6/go.mod h1:qRujMTqjMByvdC05qdfscZMFRKM5XA1qbtz4rnFyStY= 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= diff --git a/user.client_test.go b/user.client_test.go index d7c1162..6cf0efa 100644 --- a/user.client_test.go +++ b/user.client_test.go @@ -48,3 +48,16 @@ func Test_UpdateUserCache(t *testing.T){ t.Log(res) } + +func Test_GetById(t *testing.T){ + dbname := "shop" + siteId := "1198881" + + res,err := GetById(siteId,dbname,"6") + + if err != nil { + t.Error(err.Error()) + } + + t.Log(res) +} diff --git a/user.proto b/user.proto index 816c09a..61107e0 100644 --- a/user.proto +++ b/user.proto @@ -96,7 +96,7 @@ service UserService { rpc getUserThird(Request) returns (Response); // 查询第三方账号v2 rpc getBusiness(Request) returns (Response); // 查询商户 rpc getById(Request) returns (Response); // 查询用户 - rpc updateUserCache(Request) returns (Response); // 查询用户 + rpc updateUserCache(Request) returns (Response); // 更新用户缓存并返回用户信息 rpc getBusinessInfo(Request) returns (Response); // 查询分销商 rpc getAddressInfo(Request) returns (Response); // 查询地址 rpc getUserScore(Request) returns (Response); // 查询用户积分