diff --git a/user/go.mod b/user/go.mod new file mode 100644 index 0000000..8478138 --- /dev/null +++ b/user/go.mod @@ -0,0 +1,8 @@ +module git.tetele.net/tgo/rpc/user + +go 1.14 + +require ( + github.com/chai2010/protorpc v1.0.0 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect +) diff --git a/user/go.sum b/user/go.sum new file mode 100644 index 0000000..0a0e052 --- /dev/null +++ b/user/go.sum @@ -0,0 +1,8 @@ +github.com/chai2010/protorpc v1.0.0 h1:aJ45G9sl1utSKo35EqnBSTs5jqTpdJDJAuZMMYPAtFo= +github.com/chai2010/protorpc v1.0.0/go.mod h1:woR3WwjaQDqFjlzdVsFEKiK5Ur12QL8mYxVPjfr5z54= +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= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/user/user.client.go b/user/user.client.go index e616e24..9a3cd19 100644 --- a/user/user.client.go +++ b/user/user.client.go @@ -40,6 +40,7 @@ func GetUserByToken(dbname, token string, url ...string) (map[string]string, err "IsVip": res.GetIsVip(), "Usercode": res.GetUsercode(), "GroupId": res.GetGroupId(), + "Type": res.GetType(), }, nil } @@ -84,6 +85,7 @@ func Login(dbname, account, password string, url ...string) (map[string]string, "Token": res.GetToken(), "Usercode": res.GetUsercode(), "GroupId": res.GetGroupId(), + "Type": res.GetType(), }, nil } diff --git a/user/user.client_test.go b/user/user.client_test.go index 9136c05..f154741 100644 --- a/user/user.client_test.go +++ b/user/user.client_test.go @@ -12,15 +12,15 @@ func Test_GetUserByToken(t *testing.T) { t.Log(res["UserId"]) t.Log(err) - res, err = GetUserById(dbname, "114") - t.Log(res) - t.Log(res["UserId"]) - t.Log(err) + // res, err = GetUserById(dbname, "114") + // t.Log(res) + // t.Log(res["UserId"]) + // t.Log(err) } func Test_Login(t *testing.T) { dbname := "dev_tetele_net" - account := "adminw" + account := "admin" password := "e10adc3949ba59abbe56e057f20f883e" res, err := Login(dbname, account, password) t.Log(res)