1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package tm
import (
"context"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
// serviceTm 客服
type serviceTm struct {
}
var Service = serviceTm{}
type ServiceUrlRes struct {
Message string `json:"Message"`
UrlData struct {
ReturnUrl string `json:"ReturnUrl"`
} `json:"UrlData"`
Code string `json:"Code"`
}
// Url 客服链接
func (s *serviceTm) Url(ctx context.Context, SellerId, UserId interface{}) (res *ServiceUrlRes, err error) {
method := "getCustomServiceUrl"
request := map[string]string{
"BizUid": server.BizUid,
"SellerId": gconv.String(SellerId),
"AccountType": "ANONY",
"ThirdPartyUserId": gconv.String(UserId),
}
result, err := post(ctx, method, request)
_ = json.Unmarshal([]byte(result), &res)
return
}