Browse Source

修改绑定第三方参数

master v0.2.6
guzeng 3 years ago
parent
commit
186eeac18a
5 changed files with 35 additions and 3 deletions
  1. +1
    -0
      common.go
  2. +4
    -2
      go.mod
  3. +9
    -0
      go.sum
  4. +2
    -1
      third.client.go
  5. +19
    -0
      third.client_test.go

+ 1
- 0
common.go View File

@ -15,6 +15,7 @@ type BindThirdReq struct {
Openname string Openname string
Unionid string Unionid string
Avatar string Avatar string
Mobile string
} }
type Res struct { type Res struct {


+ 4
- 2
go.mod View File

@ -3,7 +3,9 @@ module git.tetele.net/tgo/userrpc
go 1.14 go 1.14
require ( require (
github.com/chai2010/protorpc v1.0.0 // indirect
git.tetele.net/tgo/crypter v0.2.2 // indirect
github.com/chai2010/protorpc v1.0.0
github.com/golang/protobuf v1.0.0
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
) )

+ 9
- 0
go.sum View File

@ -1,8 +1,17 @@
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 h1:aJ45G9sl1utSKo35EqnBSTs5jqTpdJDJAuZMMYPAtFo=
github.com/chai2010/protorpc v1.0.0/go.mod h1:woR3WwjaQDqFjlzdVsFEKiK5Ur12QL8mYxVPjfr5z54= 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 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ=
github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= 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= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

+ 2
- 1
third.client.go View File

@ -14,7 +14,7 @@ import (
* 2021/04/05 * 2021/04/05
* gz * gz
*/ */
func BindThird(site_id, dbname, platform, user_id, openid, openname, unionid, avatar string, url ...string) (*Res, error) {
func BindThird(site_id, dbname, platform, user_id, openid, openname, unionid, avatar, mobile string, url ...string) (*Res, error) {
conn, err := rpc_server_conn(url...) conn, err := rpc_server_conn(url...)
if err != nil { if err != nil {
@ -30,6 +30,7 @@ func BindThird(site_id, dbname, platform, user_id, openid, openname, unionid, av
data.Platform = platform data.Platform = platform
data.Unionid = unionid data.Unionid = unionid
data.Avatar = avatar data.Avatar = avatar
data.Mobile = mobile
data.Userid = user_id data.Userid = user_id
data_json, err := json.Marshal(data) data_json, err := json.Marshal(data)


+ 19
- 0
third.client_test.go View File

@ -0,0 +1,19 @@
package userrpc
import (
"testing"
)
func Test_BindThird(t *testing.T) {
dbname := "test1_tetele_com"
site_id := "1001"
platform := "deliver_mini"
user_id := "1"
openid := "CasfoieFsdfsdfiDiodf_df"
openname := "测试中"
avatar := "https://ssss.ttt.ddd/sfsd"
res, err := BindThird(site_id, dbname, platform, user_id, openid, openname, "", avatar)
t.Log(res)
t.Log(err)
}

Loading…
Cancel
Save