feat(wx-work): 新增企微客户打标签三接口
This commit is contained in:
parent
8b692dd9af
commit
edcf4cd90f
@ -42,3 +42,33 @@ func (c *Client) IsUserBind(req *IsUserBindReq) (resp *IsUserBindResp, err error
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AddGameSignTag 给企微客户添加来源游戏大类标签
|
||||
func (c *Client) AddGameSignTag(req *AddGameSignTagReq) (resp *AddGameSignTagResp, err error) {
|
||||
resp = CreateAddGameSignTagResp()
|
||||
err = c.DoAction(req, resp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AddGameIdTag 给企微客户添加来源子游戏标签
|
||||
func (c *Client) AddGameIdTag(req *AddGameIdTagReq) (resp *AddGameIdTagResp, err error) {
|
||||
resp = CreateAddGameIdTagResp()
|
||||
err = c.DoAction(req, resp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AddUserRegGameTag 按玩家注册的子游戏/根游戏给企微客户打标签
|
||||
func (c *Client) AddUserRegGameTag(req *AddUserRegGameTagReq) (resp *AddUserRegGameTagResp, err error) {
|
||||
resp = CreateAddUserRegGameTagResp()
|
||||
err = c.DoAction(req, resp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
125
services/wx-work/tag.go
Normal file
125
services/wx-work/tag.go
Normal file
@ -0,0 +1,125 @@
|
||||
package wx_work
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
// 打标签系列接口的响应约定:Code 为 0(common.Code.Success)表示成功,
|
||||
// 非 0 时 Msg 为具体失败原因。三个接口均无 data 返回。
|
||||
|
||||
type AddGameSignTagReq struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type AddGameSignTagResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"status_code"`
|
||||
Msg string `json:"status_msg"`
|
||||
}
|
||||
|
||||
// CreateAddGameSignTagReq 添加来源游戏大类标签请求
|
||||
//
|
||||
// company 公司主体,如 GR
|
||||
// customerId 企微客户ID(external_userid)
|
||||
// gameSign 游戏大类标识
|
||||
func CreateAddGameSignTagReq(company, customerId, gameSign string) *AddGameSignTagReq {
|
||||
req := &AddGameSignTagReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
|
||||
req.InitWithApiInfo(HOST, VERSION, "/v1/tag/add_game_sign_tag")
|
||||
req.Method = requests.POST
|
||||
req.FormParams = map[string]string{
|
||||
"company": company,
|
||||
"customer_id": customerId,
|
||||
"game_sign": gameSign,
|
||||
}
|
||||
return req
|
||||
}
|
||||
|
||||
// CreateAddGameSignTagResp 添加来源游戏大类标签响应
|
||||
func CreateAddGameSignTagResp() *AddGameSignTagResp {
|
||||
return &AddGameSignTagResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
||||
type AddGameIdTagReq struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type AddGameIdTagResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"status_code"`
|
||||
Msg string `json:"status_msg"`
|
||||
}
|
||||
|
||||
// CreateAddGameIdTagReq 添加来源子游戏标签请求
|
||||
//
|
||||
// company 公司主体,如 GR
|
||||
// customerId 企微客户ID(external_userid)
|
||||
// gameId 子游戏ID
|
||||
func CreateAddGameIdTagReq(company, customerId string, gameId int64) *AddGameIdTagReq {
|
||||
req := &AddGameIdTagReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
|
||||
req.InitWithApiInfo(HOST, VERSION, "/v1/tag/add_game_id_tag")
|
||||
req.Method = requests.POST
|
||||
req.FormParams = map[string]string{
|
||||
"company": company,
|
||||
"customer_id": customerId,
|
||||
"game_id": strconv.FormatInt(gameId, 10),
|
||||
}
|
||||
return req
|
||||
}
|
||||
|
||||
// CreateAddGameIdTagResp 添加来源子游戏标签响应
|
||||
func CreateAddGameIdTagResp() *AddGameIdTagResp {
|
||||
return &AddGameIdTagResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
||||
type AddUserRegGameTagReq struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type AddUserRegGameTagResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"status_code"`
|
||||
Msg string `json:"status_msg"`
|
||||
}
|
||||
|
||||
// CreateAddUserRegGameTagReq 按玩家注册的子游戏/根游戏打标签请求
|
||||
//
|
||||
// company 公司主体,如 GR
|
||||
// customerId 企微客户ID(external_userid)
|
||||
// userName 贪玩账号名,服务端据此查注册的子游戏与根游戏
|
||||
//
|
||||
// 一次调用打上根游戏、子游戏两个标签。其中一个取不到只在服务端记日志,
|
||||
// 两个都取不到才返回失败。
|
||||
func CreateAddUserRegGameTagReq(company, customerId, userName string) *AddUserRegGameTagReq {
|
||||
req := &AddUserRegGameTagReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
|
||||
req.InitWithApiInfo(HOST, VERSION, "/v1/tag/add_user_reg_game_tag")
|
||||
req.Method = requests.POST
|
||||
req.FormParams = map[string]string{
|
||||
"company": company,
|
||||
"customer_id": customerId,
|
||||
"user_name": userName,
|
||||
}
|
||||
return req
|
||||
}
|
||||
|
||||
// CreateAddUserRegGameTagResp 按玩家注册的子游戏/根游戏打标签响应
|
||||
func CreateAddUserRegGameTagResp() *AddUserRegGameTagResp {
|
||||
return &AddUserRegGameTagResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user