Compare commits
No commits in common. "master" and "v1.1.64" have entirely different histories.
@ -18,10 +18,10 @@ func signRpcRequest(request requests.AcsRequest, signer Signer) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if signer != nil {
|
|
||||||
if _, isContainsSign := request.GetQueryParams()["sign"]; isContainsSign {
|
if _, isContainsSign := request.GetQueryParams()["sign"]; isContainsSign {
|
||||||
delete(request.GetQueryParams(), "sign")
|
delete(request.GetQueryParams(), "sign")
|
||||||
}
|
}
|
||||||
|
|
||||||
stringToSign := buildRpcStringToSign(request)
|
stringToSign := buildRpcStringToSign(request)
|
||||||
request.SetStringToSign(stringToSign)
|
request.SetStringToSign(stringToSign)
|
||||||
signature := signer.Sign(stringToSign, "&")
|
signature := signer.Sign(stringToSign, "&")
|
||||||
@ -29,12 +29,11 @@ func signRpcRequest(request requests.AcsRequest, signer Signer) (err error) {
|
|||||||
debug("GrSdk sign: %s", signature)
|
debug("GrSdk sign: %s", signature)
|
||||||
debug("GrSdk sign string: %s", stringToSign)
|
debug("GrSdk sign string: %s", stringToSign)
|
||||||
debug("GrSdk sign: \r\n")
|
debug("GrSdk sign: \r\n")
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func completeRpcSignParams(request requests.AcsRequest, signer Signer) (err error) {
|
func completeRpcSignParams(request requests.AcsRequest, signer Signer) (err error) {
|
||||||
if signer != nil {
|
|
||||||
var accessKeyFrom string
|
var accessKeyFrom string
|
||||||
if accessKeyFrom, err = signer.GetAccessKeyFrom(); err != nil {
|
if accessKeyFrom, err = signer.GetAccessKeyFrom(); err != nil {
|
||||||
return
|
return
|
||||||
@ -44,14 +43,13 @@ func completeRpcSignParams(request requests.AcsRequest, signer Signer) (err erro
|
|||||||
queryParams["access_time"] = fmt.Sprintf("%d", time.Now().Unix())
|
queryParams["access_time"] = fmt.Sprintf("%d", time.Now().Unix())
|
||||||
queryParams["access_key"], err = signer.GetAccessKeyId()
|
queryParams["access_key"], err = signer.GetAccessKeyId()
|
||||||
queryParams["access_from"] = accessKeyFrom
|
queryParams["access_from"] = accessKeyFrom
|
||||||
request.GetHeaders()["Gr-Sdk-From"] = accessKeyFrom
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
request.GetHeaders()["Content-type"] = requests.Form
|
|
||||||
|
|
||||||
|
request.GetHeaders()["Content-type"] = requests.Form
|
||||||
|
request.GetHeaders()["Gr-Sdk-From"] = accessKeyFrom
|
||||||
formString := utils.GetUrlFormedMap(request.GetFormParams())
|
formString := utils.GetUrlFormedMap(request.GetFormParams())
|
||||||
request.SetContent(bytes.NewBufferString(formString).Bytes())
|
request.SetContent(bytes.NewBufferString(formString).Bytes())
|
||||||
return
|
return
|
||||||
|
@ -91,15 +91,11 @@ func (client *Client) Init() (err error) {
|
|||||||
|
|
||||||
func (client *Client) InitWithAccessKey(accessKeyId, accessKeySecret, accessKeyFrom string) (err error) {
|
func (client *Client) InitWithAccessKey(accessKeyId, accessKeySecret, accessKeyFrom string) (err error) {
|
||||||
config := client.InitWithConfig()
|
config := client.InitWithConfig()
|
||||||
var credential auth.Credential
|
credential := &credentials.BaseCredential{
|
||||||
if accessKeyId != "" {
|
|
||||||
credential = &credentials.BaseCredential{
|
|
||||||
AccessKeyId: accessKeyId,
|
AccessKeyId: accessKeyId,
|
||||||
AccessKeySecret: accessKeySecret,
|
AccessKeySecret: accessKeySecret,
|
||||||
AccessKeyFrom: accessKeyFrom,
|
AccessKeyFrom: accessKeyFrom,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return client.InitWithOptions(config, credential)
|
return client.InitWithOptions(config, credential)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,9 +133,8 @@ func (client *Client) InitWithOptions(config *Config, credential auth.Credential
|
|||||||
if config.Timeout > 0 {
|
if config.Timeout > 0 {
|
||||||
client.httpClient.Timeout = config.Timeout
|
client.httpClient.Timeout = config.Timeout
|
||||||
}
|
}
|
||||||
if credential != nil {
|
|
||||||
client.signer, err = auth.NewSignerWithCredential(credential, client.ProcessCommonRequestWithSigner)
|
client.signer, err = auth.NewSignerWithCredential(credential, client.ProcessCommonRequestWithSigner)
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ func Unmarshal(response AcsResponse, httpResponse *http.Response, format string)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, isCommonResponse := response.(*CommonResponse); isCommonResponse {
|
if _, isCommonResponse := response.(CommonResponse); isCommonResponse {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,8 +109,3 @@ func InitStructWithDefaultTag(bean interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Md5(data string) string {
|
|
||||||
s := md5.Sum([]byte(data))
|
|
||||||
return hex.EncodeToString(s[:])
|
|
||||||
}
|
|
||||||
|
@ -23,7 +23,3 @@ func TestInitStructWithDefaultTag(t *testing.T) {
|
|||||||
InitStructWithDefaultTag(testcase)
|
InitStructWithDefaultTag(testcase)
|
||||||
fmt.Printf("%+v", testcase)
|
fmt.Printf("%+v", testcase)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMd5(t *testing.T) {
|
|
||||||
t.Log(Md5("123456"))
|
|
||||||
}
|
|
||||||
|
@ -1,134 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
VERSION = "2025-06-10"
|
|
||||||
)
|
|
||||||
|
|
||||||
var HOST = requests.Host{
|
|
||||||
Default: "cs",
|
|
||||||
}
|
|
||||||
|
|
||||||
type Client struct {
|
|
||||||
sdk.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewClient() (client *Client, err error) {
|
|
||||||
client = new(Client)
|
|
||||||
err = client.Init()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetFaq(req *GetFaqRequest) (resp *GetFaqResponse, err error) {
|
|
||||||
resp = CreateGetFaqResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetUserInfo(req *GetUserInfoRequest) (resp *GetUserInfoResponse, err error) {
|
|
||||||
resp = CreateGetUserInfoResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetCsUserRoleList(req *GetUserRoleListRequest) (resp *GetUserRoleListResponse, err error) {
|
|
||||||
resp = CreateGetUserRoleListResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetUserServerList(req *GetUserServerListRequest) (resp *GetUserServerListResponse, err error) {
|
|
||||||
resp = CreateGetUserServerListResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) SendSmsCode(req *SendSmsRequest) (resp *SendSmsResponse, err error) {
|
|
||||||
resp = CreateSendSmsResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) Upload(req *UploadRequest) (resp *UploadResponse, err error) {
|
|
||||||
// check file stream
|
|
||||||
if req.FileStream == nil {
|
|
||||||
err = errors.New("stream is empty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 必须设置content
|
|
||||||
req.SetContent(req.FileStream)
|
|
||||||
resp = CreateUploadResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) GetOrderTemplateDetail(req *OrderTemplateDetailReq) (resp *OrderTemplateDetailResp, err error) {
|
|
||||||
resp = CreateOrderTemplateDetailResp()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetOrderFurtherPart(req *GetOrderFurtherPartRequest) (resp *GetOrderFurtherPartResponse, err error) {
|
|
||||||
resp = CreateGetOrderFurtherPartResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) OrderUrgent(req *OrderUrgentRequest) (resp *OrderUrgentResponse, err error) {
|
|
||||||
resp = CreateOrderUrgentResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) OrderUpdateHandle(req *OrderUpdateHandleRequest) (resp *OrderUpdateHandleResponse, err error) {
|
|
||||||
resp = CreateOrderUpdateHandleResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) OrderAppraise(req *OrderAppraiseRequest) (resp *OrderAppraiseResponse, err error) {
|
|
||||||
resp = CreateOrderAppraiseResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) OrderRestart(req *OrderRestartRequest) (resp *OrderRestartResponse, err error) {
|
|
||||||
resp = CreateOrderRestartResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) OrderSubmit(req *OrderSubmitRequest) (resp *OrderSubmitResponse, err error) {
|
|
||||||
resp = CreateOrderSubmitResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) OrderFurtherPart(req *OrderFurtherPartRequest) (resp *OrderFurtherPartResponse, err error) {
|
|
||||||
resp = CreateOrderFurtherPartResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) OrderRecordList(req *GetWorkOrderRecordListRequest) (resp *GetWorkOrderRecordListResponse, err error) {
|
|
||||||
resp = CreateGetWorkOrderRecordListResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (client *Client) OrderRecordDetail(req *GetWorkOrderRecordDetailReq) (resp *GetWorkOrderRecordDetailResp, err error) {
|
|
||||||
resp = CreateGetWorkOrderRecordDetailResp()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetFaqDetail(req *GetFaqDetailRequest) (resp *GetFaqDetailResponse, err error) {
|
|
||||||
resp = CreateGetFaqDetailResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetHotFaqList(req *GetHotFaqRequest) (resp *GetHotFaqResponse, err error) {
|
|
||||||
resp = CreateGetHotFaqResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,406 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客服工单服务,单元测试
|
|
||||||
*/
|
|
||||||
|
|
||||||
// 获取faq树状数据
|
|
||||||
func TestGetFaq(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
|
|
||||||
req := CreateGetFaqRequest()
|
|
||||||
faq, err := client.GetFaq(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf(fmt.Sprintf("%#+v", faq))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取玩家基本信息
|
|
||||||
func TestGetUserInfo(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserInfoRequest("ws45265737")
|
|
||||||
info, err := client.GetUserInfo(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取玩家角色列表
|
|
||||||
func TestGetUserRoleList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserRoleListRequest(int64(63610626), int64(2850))
|
|
||||||
info, err := client.GetCsUserRoleList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("获取玩家角色列表失败")
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取玩家区服列表
|
|
||||||
func TestGetUserServerList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserServerListRequest(int64(63610626), int64(2850))
|
|
||||||
info, err := client.GetUserServerList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("获取玩家区服列表失败")
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 给玩家发送短信
|
|
||||||
func TestSendSms(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateSendSmsRequest(SendSmsReq{
|
|
||||||
Phone: "13725263463",
|
|
||||||
})
|
|
||||||
info, err := client.SendSmsCode(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("给玩家发送短信失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单图片上传
|
|
||||||
func TestUpload(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
// 读取文件流
|
|
||||||
file, err := os.ReadFile("test.png")
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req := CreateUploadRequest()
|
|
||||||
req.FileStream = file
|
|
||||||
res, err := client.Upload(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单图片上传失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单模板查询
|
|
||||||
func TestGetOrderTemplateDetail(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
templateId := int64(12)
|
|
||||||
req := CreateOrderTemplateDetailReq(templateId)
|
|
||||||
res, err := client.GetOrderTemplateDetail(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单模板查询失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单补充字段设置
|
|
||||||
func TestGetOrderFurtherPart(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetOrderFurtherPartRequest(GetOrderFurtherPartParam{
|
|
||||||
OrderNum: "20250605092301764049"})
|
|
||||||
res, err := client.GetOrderFurtherPart(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单补充字段设置获取失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户催单
|
|
||||||
func TestOrderUrgent(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderUrgentRequest(OrderUrgentParam{
|
|
||||||
OrderNum: "20250530173554491048"})
|
|
||||||
res, err := client.OrderUrgent(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("用户催单失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户更新工单处理标识
|
|
||||||
func TestOrderUpdateHandle(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderUpdateHandleRequest(OrderUpdateHandleParam{
|
|
||||||
IsHandle: 1,
|
|
||||||
OrderNum: "20250530173554491048"})
|
|
||||||
res, err := client.OrderUpdateHandle(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("用户催单失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户评价工单
|
|
||||||
func TestOrderAppraise(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderAppraiseRequest(OrderAppraiseParam{
|
|
||||||
OrderNum: "20250530173554491048",
|
|
||||||
Score: 5,
|
|
||||||
})
|
|
||||||
res, err := client.OrderAppraise(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("用户评价失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单重启
|
|
||||||
func TestOrderRestart(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderRestartRequest(OrderRestartParam{
|
|
||||||
OrderNum: "20250530173554491048",
|
|
||||||
RemarkContent: "模拟用户重启",
|
|
||||||
RemarkPic: []string{},
|
|
||||||
})
|
|
||||||
res, err := client.OrderRestart(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单重启失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交工单
|
|
||||||
func TestOrderSubmit(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderSubmitRequest(OrderSubmitParam{
|
|
||||||
GameId: 7991,
|
|
||||||
UserName: "ws45265737",
|
|
||||||
Uid: 65598086,
|
|
||||||
RoleId: "10676785",
|
|
||||||
RoleName: "流水行者",
|
|
||||||
ServerName: "血阳琉璃",
|
|
||||||
OrderTemplateCode: "btu7RoDj",
|
|
||||||
Detail: "我的问题是,组队这个玩法的初衷是希望实现大家能和身边认识的朋友一起下洞的目标。但是现在看来,很多玩家都选择了在游戏中随机匹配队友,而我们发现,组队机制暴露的绝大部分玩家体验问题都是在随机匹配中出现的。<br/>比如恶意踢人,又比如匹配到的玩家等级比较低,不符合自己本次下洞的目标,再或者是组队进入洞窟却发现队友已经快要收尾结束探险了。",
|
|
||||||
Phone: "13725263463",
|
|
||||||
ApplyIp: "183.63.75.58",
|
|
||||||
OrderParts: []OrderSubmitPart{
|
|
||||||
{
|
|
||||||
PartKey: "email",
|
|
||||||
PartName: "联系邮箱",
|
|
||||||
PartValue: "kingson2011@126.com",
|
|
||||||
PicValue: nil,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
PartKey: "pay_pic",
|
|
||||||
PartName: "充值凭证",
|
|
||||||
PartValue: "",
|
|
||||||
PicValue: []string{
|
|
||||||
"uploads/d1a/d1aba28357b89e7ebfc77e5c43fc81b7.jpeg",
|
|
||||||
"uploads/c37/c3726c5cf7175ed048f6c68416dbf30b.jpeg",
|
|
||||||
"uploads/ca2/ca285ae8feae8c60d51b53079fa9b2a9.jpeg",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
SmsCode: "7204",
|
|
||||||
})
|
|
||||||
res, err := client.OrderSubmit(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单提交失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户工单补充资料
|
|
||||||
func TestOrderFurtherPart(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateOrderFurtherPartRequest(OrderFurtherPartParam{
|
|
||||||
OrderNum: "20250611160840208567",
|
|
||||||
OrderParts: []OrderSubmitPart{
|
|
||||||
{
|
|
||||||
PartKey: "game_name",
|
|
||||||
PartName: "游戏名称",
|
|
||||||
PartValue: "镇魂街:最终章",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
res, err := client.OrderFurtherPart(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("用户工单补充资料失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单列表查询
|
|
||||||
func TestGetWorkOrderRecordList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetWorkOrderRecordListRequest(GetWorkOrderRecordListParam{
|
|
||||||
HandleStatus: "",
|
|
||||||
UserName: "ws45265737",
|
|
||||||
GameId: 7991,
|
|
||||||
Page: 1,
|
|
||||||
PageSize: 20,
|
|
||||||
})
|
|
||||||
res, err := client.OrderRecordList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单列表查询失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单详情查询
|
|
||||||
func TestOrderRecordDetail(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetWorkOrderRecordDetailRequest(OrderDetailParam{
|
|
||||||
OrderNum: "20250611160840208567",
|
|
||||||
})
|
|
||||||
res, err := client.OrderRecordDetail(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("工单详情查询失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取faq详情
|
|
||||||
func TestGetFaqDetail(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetFaqDetailRequest(FaqDetailRequest{
|
|
||||||
Id: int64(31),
|
|
||||||
})
|
|
||||||
res, err := client.GetFaqDetail(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 || res.Data.Id == 0 {
|
|
||||||
t.Error("获取faq详情失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取热门faq
|
|
||||||
func TestGetFaqHotList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetHotFaqRequest()
|
|
||||||
res, err := client.GetHotFaqList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 || len(res.Data) == 0 {
|
|
||||||
t.Error("获取热门faq失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Faq 树状结构
|
|
||||||
type Faq struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
ParentId int64 `json:"parent_id"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
Answer string `json:"answer"`
|
|
||||||
Type int64 `json:"type"`
|
|
||||||
WorkOrderTemplateId int64 `json:"work_order_template_id"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
UpdatedAt string `json:"updated_at"`
|
|
||||||
ProcessFlow string `json:"process_flow"`
|
|
||||||
Children []*Faq `json:"children"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetFaqRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetFaqResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data Faq `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetFaqRequest() (req *GetFaqRequest) {
|
|
||||||
req = &GetFaqRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/list")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetFaqResponse() (response *GetFaqResponse) {
|
|
||||||
response = &GetFaqResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FaqDetail Faq详情
|
|
||||||
type FaqDetail struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
ParentId int64 `json:"parent_id"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
Answer string `json:"answer"`
|
|
||||||
Type int64 `json:"type"`
|
|
||||||
WorkOrderTemplateId int64 `json:"work_order_template_id"`
|
|
||||||
ProcessFlow string `json:"process_flow"`
|
|
||||||
}
|
|
||||||
type GetFaqDetailRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Id int64 `position:"Json" field:"id"`
|
|
||||||
}
|
|
||||||
type GetFaqDetailResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data FaqDetail `json:"data"`
|
|
||||||
}
|
|
||||||
type FaqDetailRequest struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetFaqDetailRequest(param FaqDetailRequest) (req *GetFaqDetailRequest) {
|
|
||||||
req = &GetFaqDetailRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Id: param.Id,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/detail")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetFaqDetailResponse() (response *GetFaqDetailResponse) {
|
|
||||||
response = &GetFaqDetailResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 热门faq列表
|
|
||||||
type HotFaq struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
}
|
|
||||||
type GetHotFaqRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
type GetHotFaqResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []HotFaq `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetHotFaqRequest() (req *GetHotFaqRequest) {
|
|
||||||
req = &GetHotFaqRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/hot_list")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetHotFaqResponse() (response *GetHotFaqResponse) {
|
|
||||||
response = &GetHotFaqResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,314 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客服工单,相关方法
|
|
||||||
*/
|
|
||||||
|
|
||||||
type UploadRequest struct {
|
|
||||||
*requests.StreamRequest
|
|
||||||
FileStream []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type UploadResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data struct {
|
|
||||||
FileName string `json:"file_name"`
|
|
||||||
FileUrl string `json:"file_url"`
|
|
||||||
FilePath string `json:"file_path"`
|
|
||||||
}
|
|
||||||
TraceId string `json:"trace_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateUploadRequest() (req *UploadRequest) {
|
|
||||||
req = &UploadRequest{
|
|
||||||
StreamRequest: &requests.StreamRequest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/upload_image")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateUploadResponse() (resp *UploadResponse) {
|
|
||||||
return &UploadResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取工单补充字段设置
|
|
||||||
|
|
||||||
// GetOrderFurtherPartParam 请求参数
|
|
||||||
type GetOrderFurtherPartParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
}
|
|
||||||
type GetOrderFurtherPartRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
}
|
|
||||||
type OrderFurtherPart struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
FurtherParts []*OrderPart `json:"further_parts"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetOrderFurtherPartResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Data OrderFurtherPart `json:"data"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetOrderFurtherPartRequest(param GetOrderFurtherPartParam) (req *GetOrderFurtherPartRequest) {
|
|
||||||
req = &GetOrderFurtherPartRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/get_order_further_part")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetOrderFurtherPartResponse() (resp *GetOrderFurtherPartResponse) {
|
|
||||||
return &GetOrderFurtherPartResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderUrgentParam 用户催单
|
|
||||||
type OrderUrgentParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
}
|
|
||||||
type OrderUrgentRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
}
|
|
||||||
type OrderUrgentResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderUrgentRequest(param OrderUrgentParam) (req *OrderUrgentRequest) {
|
|
||||||
req = &OrderUrgentRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_urgent")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderUrgentResponse() (resp *OrderUrgentResponse) {
|
|
||||||
return &OrderUrgentResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderUpdateHandleParam 更新工单处理标识
|
|
||||||
type OrderUpdateHandleParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
IsHandle int64 `json:"is_handle"`
|
|
||||||
}
|
|
||||||
type OrderUpdateHandleRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
IsHandle int64 `position:"Json" field:"is_handle"`
|
|
||||||
}
|
|
||||||
type OrderUpdateHandleResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderUpdateHandleRequest(param OrderUpdateHandleParam) (req *OrderUpdateHandleRequest) {
|
|
||||||
req = &OrderUpdateHandleRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
IsHandle: param.IsHandle,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_handle")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderUpdateHandleResponse() (resp *OrderUpdateHandleResponse) {
|
|
||||||
return &OrderUpdateHandleResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderAppraiseParam 用户评价工单
|
|
||||||
type OrderAppraiseParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
Score int `json:"score"`
|
|
||||||
}
|
|
||||||
type OrderAppraiseRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
Score int `position:"Json" field:"score"`
|
|
||||||
}
|
|
||||||
type OrderAppraiseResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderAppraiseRequest(param OrderAppraiseParam) (req *OrderAppraiseRequest) {
|
|
||||||
req = &OrderAppraiseRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
Score: param.Score,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_appraise")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderAppraiseResponse() (resp *OrderAppraiseResponse) {
|
|
||||||
return &OrderAppraiseResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderRestartParam 用户重启工单
|
|
||||||
type OrderRestartParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
RemarkContent string `json:"remark_content"`
|
|
||||||
RemarkPic []string `json:"remark_pic"`
|
|
||||||
}
|
|
||||||
type OrderRestartRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
RemarkContent string `position:"Json" field:"remark_content"`
|
|
||||||
RemarkPic []string `position:"Json" field:"remark_pic"`
|
|
||||||
}
|
|
||||||
type OrderRestartResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderRestartRequest(param OrderRestartParam) (req *OrderRestartRequest) {
|
|
||||||
req = &OrderRestartRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
RemarkContent: param.RemarkContent,
|
|
||||||
RemarkPic: param.RemarkPic,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_restart")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderRestartResponse() (resp *OrderRestartResponse) {
|
|
||||||
return &OrderRestartResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderSubmitParam 工单提交
|
|
||||||
type OrderSubmitParam struct {
|
|
||||||
GameId int64 `json:"game_id"`
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
Uid int64 `json:"uid"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
ServerName string `json:"server_name"`
|
|
||||||
OrderTemplateCode string `json:"order_template_code"`
|
|
||||||
Detail string `json:"detail"`
|
|
||||||
Phone string `json:"phone"`
|
|
||||||
ApplyIp string `json:"apply_ip"`
|
|
||||||
OrderParts []OrderSubmitPart `json:"order_parts"`
|
|
||||||
SmsCode string `json:"sms_code"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type OrderSubmitPart struct {
|
|
||||||
PartId int64 `json:"part_id"`
|
|
||||||
PartKey string `json:"part_key"`
|
|
||||||
PartName string `json:"part_name"`
|
|
||||||
PartValue string `json:"part_value"`
|
|
||||||
PartType int64 `json:"part_type"`
|
|
||||||
PicValue []string `json:"pic_value"`
|
|
||||||
}
|
|
||||||
type OrderSubmitRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
GameId int64 `position:"Json" field:"game_id"`
|
|
||||||
UserName string `position:"Json" field:"user_name"`
|
|
||||||
Uid int64 `position:"Json" field:"uid"`
|
|
||||||
RoleId string `position:"Json" field:"role_id"`
|
|
||||||
RoleName string `position:"Json" field:"role_name"`
|
|
||||||
ServerName string `position:"Json" field:"server_name"`
|
|
||||||
OrderTemplateCode string `position:"Json" field:"order_template_code"`
|
|
||||||
Detail string `position:"Json" field:"detail"`
|
|
||||||
Phone string `position:"Json" field:"phone"`
|
|
||||||
ApplyIp string `position:"Json" field:"apply_ip"`
|
|
||||||
OrderParts []OrderSubmitPart `position:"Json" field:"order_parts"`
|
|
||||||
SmsCode string `position:"Json" field:"sms_code"`
|
|
||||||
}
|
|
||||||
type OrderSubmitResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
} `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderSubmitRequest(param OrderSubmitParam) (req *OrderSubmitRequest) {
|
|
||||||
req = &OrderSubmitRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
GameId: param.GameId,
|
|
||||||
UserName: param.UserName,
|
|
||||||
Uid: param.Uid,
|
|
||||||
RoleId: param.RoleId,
|
|
||||||
RoleName: param.RoleName,
|
|
||||||
ServerName: param.ServerName,
|
|
||||||
OrderTemplateCode: param.OrderTemplateCode,
|
|
||||||
Detail: param.Detail,
|
|
||||||
Phone: param.Phone,
|
|
||||||
ApplyIp: param.ApplyIp,
|
|
||||||
OrderParts: param.OrderParts,
|
|
||||||
SmsCode: param.SmsCode,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_submit")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderSubmitResponse() (resp *OrderSubmitResponse) {
|
|
||||||
return &OrderSubmitResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderFurtherPartParam 工单补充资料
|
|
||||||
type OrderFurtherPartParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
OrderParts []OrderSubmitPart `json:"order_parts"`
|
|
||||||
}
|
|
||||||
type OrderFurtherPartRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
OrderParts []OrderSubmitPart `position:"Json" field:"order_parts"`
|
|
||||||
}
|
|
||||||
type OrderFurtherPartResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderFurtherPartRequest(param OrderFurtherPartParam) (req *OrderFurtherPartRequest) {
|
|
||||||
req = &OrderFurtherPartRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
OrderNum: param.OrderNum,
|
|
||||||
OrderParts: param.OrderParts,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_further_data")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderFurtherPartResponse() (resp *OrderFurtherPartResponse) {
|
|
||||||
return &OrderFurtherPartResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 获取客服工单列表
|
|
||||||
|
|
||||||
type GetWorkOrderRecordListParam struct {
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
Page int64 `position:"Json" field:"page"`
|
|
||||||
PageSize int64 `position:"Json" field:"page_size"`
|
|
||||||
UserName string `position:"Json" field:"user_name"`
|
|
||||||
GameId int64 `position:"Json" field:"game_id"`
|
|
||||||
HandleStatus string `position:"Json" field:"handle_status"`
|
|
||||||
}
|
|
||||||
type OrderRecord struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
WorkOrderTemplateFirstLevelName string `json:"work_order_template_first_level_name"`
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
GameId int64 `json:"game_id"`
|
|
||||||
GameName string `json:"game_name"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
ServerName string `json:"server_name"`
|
|
||||||
Detail string `json:"detail"`
|
|
||||||
ApplyTime string `json:"apply_time"`
|
|
||||||
HandleStatus string `json:"handle_status"`
|
|
||||||
HandleStatusName string `json:"handle_status_name"`
|
|
||||||
IsUrgent int64 `json:"is_urgent"`
|
|
||||||
IsAppraise int64 `json:"is_appraise"`
|
|
||||||
FinishTime string `json:"finish_time"`
|
|
||||||
OrderParts []*OrderSubmitPart `json:"order_parts"`
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
WorkOrderTemplateFirstLevelId int64 `json:"work_order_template_first_level_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// PageInfoResp 分页响应
|
|
||||||
type PageInfoResp struct {
|
|
||||||
Page int `json:"page"`
|
|
||||||
PageSize int `json:"page_size"`
|
|
||||||
TotalNumber int `json:"total_number"`
|
|
||||||
TotalPage int `json:"total_page"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetWorkOrderRecordListResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Data struct {
|
|
||||||
Data []*OrderRecord `json:"data"`
|
|
||||||
PageInfo *PageInfoResp `json:"page_info"`
|
|
||||||
} `json:"data"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
TraceId string `json:"trace_id"`
|
|
||||||
}
|
|
||||||
type GetWorkOrderRecordListRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
Page int64 `position:"Json" field:"page"`
|
|
||||||
PageSize int64 `position:"Json" field:"page_size"`
|
|
||||||
UserName string `position:"Json" field:"user_name"`
|
|
||||||
GameId int64 `position:"Json" field:"game_id"`
|
|
||||||
HandleStatus string `position:"Json" field:"handle_status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetWorkOrderRecordListRequest(param GetWorkOrderRecordListParam) (req *GetWorkOrderRecordListRequest) {
|
|
||||||
req = &GetWorkOrderRecordListRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.OrderNum = param.OrderNum
|
|
||||||
req.Page = param.Page
|
|
||||||
req.PageSize = param.PageSize
|
|
||||||
req.UserName = param.UserName
|
|
||||||
req.GameId = param.GameId
|
|
||||||
req.HandleStatus = param.HandleStatus
|
|
||||||
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_record_list")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetWorkOrderRecordListResponse() (resp *GetWorkOrderRecordListResponse) {
|
|
||||||
resp = &GetWorkOrderRecordListResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工单详情
|
|
||||||
|
|
||||||
type OrderDetailParam struct {
|
|
||||||
OrderNum string `json:"order_num"`
|
|
||||||
}
|
|
||||||
type OrderLog struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
ApplyCount int64 `json:"apply_count"`
|
|
||||||
ActionType string `json:"action_type"`
|
|
||||||
PlayerLinkType string `json:"player_link_type"`
|
|
||||||
PlayerLinkTypeName string `json:"player_link_type_name"`
|
|
||||||
Content []*OrderSubmitPart `json:"content"`
|
|
||||||
PicContent []*OrderSubmitPart `json:"pic_content"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type OrderDetail struct {
|
|
||||||
OrderRecord *OrderRecord `json:"order_record"`
|
|
||||||
OrderLogs []*OrderLog `json:"order_logs"`
|
|
||||||
}
|
|
||||||
type GetWorkOrderRecordDetailResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Data OrderDetail `json:"data"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
type GetWorkOrderRecordDetailReq struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
OrderNum string `position:"Json" field:"order_num"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetWorkOrderRecordDetailRequest(param OrderDetailParam) (req *GetWorkOrderRecordDetailReq) {
|
|
||||||
req = &GetWorkOrderRecordDetailReq{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.OrderNum = param.OrderNum
|
|
||||||
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_record_detail")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetWorkOrderRecordDetailResp() (resp *GetWorkOrderRecordDetailResp) {
|
|
||||||
resp = &GetWorkOrderRecordDetailResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
// OrderTemplate 工单模板
|
|
||||||
type OrderTemplate struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
UniqueCode string `json:"unique_code"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
UpdatedAt string `json:"updated_at"`
|
|
||||||
TemplateParts []*OrderPart `json:"template_parts"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// OrderPart 工单字段
|
|
||||||
type OrderPart struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
PartName string `json:"part_name"`
|
|
||||||
PartKey string `json:"part_key"`
|
|
||||||
PartType int64 `json:"part_type"`
|
|
||||||
IsRequire int64 `json:"is_require"`
|
|
||||||
TipsContent string `json:"tips_content"`
|
|
||||||
MaxNum int64 `json:"max_num"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type OrderTemplateDetailReq struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Id int64 `position:"Json" field:"id"`
|
|
||||||
}
|
|
||||||
type OrderTemplateDetailResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data OrderTemplate `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateOrderTemplateDetailReq(templateId int64) (req *OrderTemplateDetailReq) {
|
|
||||||
req = &OrderTemplateDetailReq{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Id: templateId,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order_template/detail")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateOrderTemplateDetailResp() (response *OrderTemplateDetailResp) {
|
|
||||||
response = &OrderTemplateDetailResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB |
@ -1,157 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取玩家(用户)相关信息
|
|
||||||
*/
|
|
||||||
|
|
||||||
// UserInfo 用户信息
|
|
||||||
type UserInfo struct {
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
Uid int64 `json:"uid"`
|
|
||||||
Telephone string `json:"telephone"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserInfoRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserInfoResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data UserInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserInfoRequest(userName string) (req *GetUserInfoRequest) {
|
|
||||||
req = &GetUserInfoRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/info")
|
|
||||||
|
|
||||||
req.FormParams = map[string]string{
|
|
||||||
"user_name": userName,
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserInfoResponse() (response *GetUserInfoResponse) {
|
|
||||||
response = &GetUserInfoResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UserRoleInfo 玩家角色信息
|
|
||||||
type UserRoleInfo struct {
|
|
||||||
Uid int64 `json:"uid"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserRoleListRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserRoleListResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []UserRoleInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserRoleListRequest(uId int64, gameId int64) (req *GetUserRoleListRequest) {
|
|
||||||
req = &GetUserRoleListRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/role_list")
|
|
||||||
|
|
||||||
req.JsonParams["uid"] = uId
|
|
||||||
req.JsonParams["game_id"] = gameId
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetUserRoleListResponse() (response *GetUserRoleListResponse) {
|
|
||||||
response = &GetUserRoleListResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UserServerInfo 玩家区服信息
|
|
||||||
type UserServerInfo struct {
|
|
||||||
ServerName string `json:"server_name"`
|
|
||||||
}
|
|
||||||
type GetUserServerListRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
type GetUserServerListResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []UserServerInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserServerListRequest(uId int64, gameId int64) (req *GetUserServerListRequest) {
|
|
||||||
req = &GetUserServerListRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/server_list")
|
|
||||||
|
|
||||||
req.JsonParams["uid"] = uId
|
|
||||||
req.JsonParams["game_id"] = gameId
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetUserServerListResponse() (response *GetUserServerListResponse) {
|
|
||||||
response = &GetUserServerListResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
type SendSmsReq struct {
|
|
||||||
Phone string `json:"phone"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SendSmsResp 发送短信返回
|
|
||||||
type SendSmsResp struct {
|
|
||||||
// 短信发送时间戳,工单模块 有效期5分钟
|
|
||||||
SendCodeTime int64 `json:"send_code_time"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SendSmsRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Phone string `position:"Json" field:"phone"`
|
|
||||||
}
|
|
||||||
type SendSmsResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data SendSmsResp `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateSendSmsRequest(param SendSmsReq) (req *SendSmsRequest) {
|
|
||||||
req = &SendSmsRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Phone: param.Phone,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/send_sms")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateSendSmsResponse() (response *SendSmsResponse) {
|
|
||||||
response = &SendSmsResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -82,30 +82,3 @@ func (c *Client) GetIsBlockOutIos(req *IsBlockOutIosReq) (resp *IsBlockOutIosRes
|
|||||||
err = c.DoAction(req, resp)
|
err = c.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GetGameVersion(req *GetGameVersionReq) (resp *GetGameVersionResp, err error) {
|
|
||||||
resp = CreateGetGameVersionResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetConfig 获取游戏全局配置
|
|
||||||
func (c *Client) GetConfig(req *GetConfigReq) (resp *GetConfigResp, err error) {
|
|
||||||
resp = CreateGetConfigResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRealAuthBlackList 获取实名黑名单
|
|
||||||
func (c *Client) GetRealAuthBlackList(req *GetRealAuthBlackListReq) (resp *GetRealAuthBlackListResp, err error) {
|
|
||||||
resp = CreateGetRealAuthBlackListResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetGameRealAuthInfo 获取实名参数
|
|
||||||
func (c *Client) GetGameRealAuthInfo(req *GetGameRealAuthInfoReq) (resp *GetGameRealAuthInfoResp, err error) {
|
|
||||||
resp = CreateGetGameRealAuthInfoResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -134,48 +134,3 @@ func TestIsBlockOutIos(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Log(isBlockOutIos)
|
t.Log(isBlockOutIos)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取游戏全局配置
|
|
||||||
func TestGetConfig(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getConfigReq := CreateGetConfigReq("overlord_act_config")
|
|
||||||
isBlockOutIos, err := client.GetConfig(getConfigReq)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(isBlockOutIos)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取实名黑名单
|
|
||||||
func TestGetRealAuthBlackList(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getRealAuthBlackListReq := CreateGetRealAuthBlackListReq()
|
|
||||||
isBlockOutIos, err := client.GetRealAuthBlackList(getRealAuthBlackListReq)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(isBlockOutIos)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取游戏实名参数
|
|
||||||
func TestGetGameRealAuthInfo(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getGameRealAuthInfoReq := CreateGetGameRealAuthInfoReq(7081)
|
|
||||||
isBlockOutIos, err := client.GetGameRealAuthInfo(getGameRealAuthInfoReq)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(isBlockOutIos)
|
|
||||||
}
|
|
||||||
|
@ -89,7 +89,7 @@ type GameInfoData struct {
|
|||||||
Discount int `json:"discount"`
|
Discount int `json:"discount"`
|
||||||
Divide int `json:"divide"`
|
Divide int `json:"divide"`
|
||||||
DownloadDomain string `json:"download_domain"`
|
DownloadDomain string `json:"download_domain"`
|
||||||
DownloadId string `json:"download_id"`
|
DownloadId int `json:"download_id"`
|
||||||
ExchangeRate int `json:"exchange_rate"`
|
ExchangeRate int `json:"exchange_rate"`
|
||||||
ExtData string `json:"ext_data"`
|
ExtData string `json:"ext_data"`
|
||||||
Fcmathod int `json:"fcmathod"`
|
Fcmathod int `json:"fcmathod"`
|
||||||
@ -99,8 +99,6 @@ type GameInfoData struct {
|
|||||||
FlashAuthLogo string `json:"flash_auth_logo"`
|
FlashAuthLogo string `json:"flash_auth_logo"`
|
||||||
FlashAuthName string `json:"flash_auth_name"`
|
FlashAuthName string `json:"flash_auth_name"`
|
||||||
FlashAuthStatus int `json:"flash_auth_status"`
|
FlashAuthStatus int `json:"flash_auth_status"`
|
||||||
FlashPassId string `json:"flash_pass_id"`
|
|
||||||
FlashPassKey string `json:"flash_pass_key"`
|
|
||||||
GameByname string `json:"game_byname"`
|
GameByname string `json:"game_byname"`
|
||||||
GameIconImg string `json:"game_icon_img"`
|
GameIconImg string `json:"game_icon_img"`
|
||||||
GameSign string `json:"game_sign"`
|
GameSign string `json:"game_sign"`
|
||||||
@ -210,7 +208,7 @@ func CreateGetGameSimpleListResp() *GetGameSimpleListResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GameCompany
|
// GameCompany
|
||||||
// ==== 获取根游戏信息
|
// 获取根游戏记录
|
||||||
type GameCompany struct {
|
type GameCompany struct {
|
||||||
Id int `json:"id"`
|
Id int `json:"id"`
|
||||||
GameSign string `json:"game_sign"`
|
GameSign string `json:"game_sign"`
|
||||||
@ -257,181 +255,3 @@ func CreateGetGameCompanyResp() *GetGameCompanyResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==== 获取游戏客户端版本配置
|
|
||||||
|
|
||||||
type GameVersion struct {
|
|
||||||
ID int `json:"id"`
|
|
||||||
GameID int `json:"game_id"`
|
|
||||||
GameVersion string `json:"version"`
|
|
||||||
GameURL string `json:"url"`
|
|
||||||
PayCallbackURL string `json:"pay_callback_url"`
|
|
||||||
DomainURL string `json:"domain_url"`
|
|
||||||
Status int `json:"status"`
|
|
||||||
H5Version int `json:"h5_version"`
|
|
||||||
H5Status int `json:"h5_status"`
|
|
||||||
IsH5Logout int `json:"is_h5_logout"`
|
|
||||||
HideWindow int `json:"hidewindow"`
|
|
||||||
PayInfo PayInfo `json:"pay_display_info"`
|
|
||||||
IsYsdk int `json:"is_ysdk"`
|
|
||||||
CheckVerified int `json:"check_verified"`
|
|
||||||
Company string `json:"company"`
|
|
||||||
CompanyKf string `json:"company_kf"`
|
|
||||||
CompanyProto string `json:"company_proto"`
|
|
||||||
CompanySms string `json:"company_sms"`
|
|
||||||
KfStatus int `json:"kf_status"`
|
|
||||||
PopupTime int `json:"popup_time"`
|
|
||||||
ExtData map[string]any `json:"ext_data"`
|
|
||||||
VersionStatus int `json:"version_status"`
|
|
||||||
VersionTime int `json:"version_time"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameVersionReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
GameId int `position:"Body" field:"game_id"`
|
|
||||||
GameVersion string `position:"Body" field:"game_version"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameVersionResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data GameVersion `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameVersionReq(gameId int, gameVersion string) *GetGameVersionReq {
|
|
||||||
req := &GetGameVersionReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.GameId = gameId
|
|
||||||
req.GameVersion = gameVersion
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/api/game/getGameVersion")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameVersionResp() *GetGameVersionResp {
|
|
||||||
return &GetGameVersionResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetConfigReq
|
|
||||||
// 游戏全局配置
|
|
||||||
type GetConfigReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
Key string `position:"Query" field:"key" default:"-" `
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetConfigRespData struct {
|
|
||||||
Id int `json:"id"`
|
|
||||||
Key string `json:"key"`
|
|
||||||
ExtData string `json:"ext_data"`
|
|
||||||
}
|
|
||||||
type GetConfigResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data GetConfigRespData `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetConfigReq(key string) *GetConfigReq {
|
|
||||||
req := &GetConfigReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.Key = key
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/api/game/getConfig")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetConfigResp() *GetConfigResp {
|
|
||||||
return &GetConfigResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRealAuthBlackListReq
|
|
||||||
// 获取实名黑名单
|
|
||||||
type GetRealAuthBlackListReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
Key string `position:"Query" field:"key" default:"-" `
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetRealAuthBlackListRespDataItem struct {
|
|
||||||
Id int `json:"id"`
|
|
||||||
TrueName string `json:"true_name"`
|
|
||||||
IdCard string `json:"id_card"`
|
|
||||||
Remark string `json:"remark"`
|
|
||||||
CreateBy string `json:"create_by"`
|
|
||||||
UpdateBy string `json:"update_by"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
UpdatedAt string `json:"updated_at"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetRealAuthBlackListResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []GetRealAuthBlackListRespDataItem `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetRealAuthBlackListReq() *GetRealAuthBlackListReq {
|
|
||||||
req := &GetRealAuthBlackListReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/api/game/getRealAuthBlackList")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetRealAuthBlackListResp() *GetRealAuthBlackListResp {
|
|
||||||
return &GetRealAuthBlackListResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetGameRealAuthInfoReq
|
|
||||||
// 获取实名参数
|
|
||||||
type GetGameRealAuthInfoReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
GameId int64 `position:"Body" field:"game_id" default:"-" `
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameRealAuthInfoRespData struct {
|
|
||||||
GroupName string `json:"group_name"`
|
|
||||||
GroupDescription int `json:"group_description"`
|
|
||||||
VerifiedTime string `json:"verified_time"`
|
|
||||||
AreaProvince string `json:"area_province"`
|
|
||||||
VersionInfo string `json:"version_info"`
|
|
||||||
IsReal int `json:"is_real"`
|
|
||||||
IsDirect int `json:"is_direct"`
|
|
||||||
AuthChannel string `json:"auth_channel"`
|
|
||||||
StandbyAuthChannel string `json:"standby_auth_channel"`
|
|
||||||
ProtectTime int `json:"protect_time"`
|
|
||||||
GovIoReport int `json:"gov_io_report"`
|
|
||||||
MinorBan int `json:"minor_ban"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameRealAuthInfoResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data GetGameRealAuthInfoRespData `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameRealAuthInfoReq(gameId int64) *GetGameRealAuthInfoReq {
|
|
||||||
req := &GetGameRealAuthInfoReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
GameId: gameId,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/api/login/getGameRealAuthInfo")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameRealAuthInfoResp() *GetGameRealAuthInfoResp {
|
|
||||||
return &GetGameRealAuthInfoResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package ip
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
VERSION = "2025-06-24"
|
|
||||||
)
|
|
||||||
|
|
||||||
var HOST = requests.Host{
|
|
||||||
Default: "ip",
|
|
||||||
}
|
|
||||||
|
|
||||||
type Client struct {
|
|
||||||
sdk.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewClient() (client *Client, err error) {
|
|
||||||
client = new(Client)
|
|
||||||
err = client.Init()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) CreateGetIpRequest(req *IpRequest) (resp *IpResponse, err error) {
|
|
||||||
resp = CreateIpResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) CreateGetIpsRequest(req *IpsRequest) (resp *IpsResponse, err error) {
|
|
||||||
resp = CreateIpsResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package ip
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 测试获取单个ip地区信息
|
|
||||||
func TestGetIp(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateIpRequest(IpParam{
|
|
||||||
Ip: "114.234.202.136",
|
|
||||||
})
|
|
||||||
res, doErr := client.CreateGetIpRequest(req)
|
|
||||||
if doErr != nil {
|
|
||||||
panic(doErr)
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("查询多个ip失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 测试获取多个ip地区信息
|
|
||||||
func TestGetIps(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateIpsRequest(IpsParam{
|
|
||||||
Ips: []string{
|
|
||||||
"2001:ee0:5208:e600:4c51:3189:28a4:b668",
|
|
||||||
"114.234.202.136",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
res, err := client.CreateGetIpsRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Code != 0 {
|
|
||||||
t.Error("查询多个ip失败")
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
|
||||||
}
|
|
@ -1,100 +0,0 @@
|
|||||||
package ip
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
type IpInfo struct {
|
|
||||||
Ip string `json:"ip"`
|
|
||||||
City string `json:"city"`
|
|
||||||
Province string `json:"province"`
|
|
||||||
Country string `json:"country"`
|
|
||||||
Isp string `json:"isp"`
|
|
||||||
Owner string `json:"owner"`
|
|
||||||
Continent string `json:"continent"`
|
|
||||||
Accuracy string `json:"accuracy"`
|
|
||||||
Adcode string `json:"adcode"`
|
|
||||||
Areacode string `json:"areacode"`
|
|
||||||
Asnumber string `json:"asnumber"`
|
|
||||||
Radius string `json:"radius"`
|
|
||||||
Latwgs string `json:"latwgs"`
|
|
||||||
Lngwgs string `json:"lngwgs"`
|
|
||||||
Source string `json:"source"`
|
|
||||||
Timezone string `json:"timezone"`
|
|
||||||
Zipcode string `json:"zipcode"`
|
|
||||||
District string `json:"district"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// IpsParam
|
|
||||||
// 单个ip请求参数
|
|
||||||
type IpParam struct {
|
|
||||||
Ip string `json:"ip"`
|
|
||||||
}
|
|
||||||
type IpRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Ip string `position:"Json" field:"ip"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// IpResponse
|
|
||||||
// 单个ip返回参数
|
|
||||||
type IpResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data IpInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateIpRequest
|
|
||||||
// 同时支持ipv4、ipv6格式查询
|
|
||||||
func CreateIpRequest(param IpParam) (req *IpRequest) {
|
|
||||||
req = &IpRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Ip: param.Ip,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/getIp")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateIpResponse() (resp *IpResponse) {
|
|
||||||
resp = &IpResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 多个ip请求参数
|
|
||||||
type IpsParam struct {
|
|
||||||
Ips []string `json:"ips"`
|
|
||||||
}
|
|
||||||
type IpsRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Ips []string `position:"Json" field:"ips"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// IpsResponse
|
|
||||||
// 多个ip返回参数
|
|
||||||
type IpsResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data map[string]IpInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateIpsRequest
|
|
||||||
// 同时支持ipv4、ipv6格式查询
|
|
||||||
func CreateIpsRequest(param IpsParam) (req *IpsRequest) {
|
|
||||||
req = &IpsRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Ips: param.Ips,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/getIps")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateIpsResponse() (resp *IpsResponse) {
|
|
||||||
resp = &IpsResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
package msdk
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
const VERSION = "2024-06-25"
|
|
||||||
|
|
||||||
var HOST = requests.Host{
|
|
||||||
Default: "msdk.api.gaore.com",
|
|
||||||
}
|
|
||||||
|
|
||||||
type Client struct {
|
|
||||||
sdk.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewClient() (client *Client, err error) {
|
|
||||||
client = &Client{}
|
|
||||||
err = client.Init()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetIdfa 获取设备归因信息
|
|
||||||
func (c *Client) GetIdfa(req *GetIdfaReq) (resp *GetIdfaResp, err error) {
|
|
||||||
resp = &GetIdfaResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
if req.Imei == "" && req.Idfa != "" {
|
|
||||||
req.Imei = req.Idfa
|
|
||||||
}
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUserAttr 获取用户归因信息
|
|
||||||
func (c *Client) GetUserAttr(req *GetUserAttrReq) (resp *GetUserAttrResp, err error) {
|
|
||||||
resp = &GetUserAttrResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetImei 用户注册归因
|
|
||||||
func (c *Client) GetImei(req *GetImeiReq) (resp *GetImeiResp, err error) {
|
|
||||||
resp = &GetImeiResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) SetImei(req *SetImeiReq) (resp *SetImeiResp, err error) {
|
|
||||||
resp = &SetImeiResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,141 +0,0 @@
|
|||||||
package msdk
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestClient_GetUserAttr(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req := CreateGetUserAttrReq("ql83649336", "xxhbbxxl")
|
|
||||||
resp, err := client.GetUserAttr(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetIdfa(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req := CreateGetIdfaReq()
|
|
||||||
req.ChannelId = 1
|
|
||||||
req.GameId = 3706
|
|
||||||
req.Ip = "112.23.230.210"
|
|
||||||
req.Imei = "00000000-0000-0000-0000-000000000000"
|
|
||||||
req.LongId = "daff65f07c7cf84862f4217773e3d613"
|
|
||||||
req.SdkVersion = "1.7.2"
|
|
||||||
req.Os = "ios"
|
|
||||||
req.GameOs = 2
|
|
||||||
req.GameSubOs = 0
|
|
||||||
req.Ua = "Mozilla/5.0 (iPad; CPU OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
|
||||||
req.GameSign = "hlhj"
|
|
||||||
req.PkgAgentId = "100"
|
|
||||||
req.PkgSiteId = "1001"
|
|
||||||
req.Network = "Wifi"
|
|
||||||
req.Idfv = "53F2A5F7-B1D4-4716-9775-07727C29BC7A"
|
|
||||||
req.ScreenResolution = "2360*1640"
|
|
||||||
req.System = "15.6.1"
|
|
||||||
req.ProcessorModel = "iPad13,16"
|
|
||||||
req.BaseBand = ""
|
|
||||||
req.Model = "iPad13,16"
|
|
||||||
req.Battery = "74"
|
|
||||||
req.Oaid = ""
|
|
||||||
req.AdInfo = ""
|
|
||||||
req.WxPlatform = ""
|
|
||||||
req.AdDevice = "{\"bootTimeInSec\":\"1745364499\",\"countryCode\":\"CN\",\"language\":\"zh-Hans-CN\",\"deviceName\":\"1b9018182a49e16ba85bb095f224867c\",\"systemVersion\":\"15.6.1\",\"machine\":\"iPad13,16\",\"carrierInfo\":\"unknown\",\"memory\":\"8000356352\",\"disk\":\"255983177728\",\"sysFileTime\":\"1663537105.729985\",\"model\":\"J407AP\",\"timeZone\":\"28800\",\"mntId\":\"A058368B97B0D073829608AAC13FFA64D9BEFD0FE3E14EDB106F2BABD6DF94B1C2BFC7509CBB683EE5B22D91A19FF67A@/dev/disk0s1s1\",\"deviceInitTime\":\"1663537056.906820124\"}"
|
|
||||||
resp, err := client.GetIdfa(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetImei(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req := CreateGetImeiReq()
|
|
||||||
req.Uid = 218047048
|
|
||||||
req.UserName = "ct939725671"
|
|
||||||
req.GameId = 8050
|
|
||||||
req.GameSign = "mrwld"
|
|
||||||
req.RegTime = 1750939725
|
|
||||||
req.Imei = "of5wO5sKWep0OFPt9rWQf6xNJVPg"
|
|
||||||
req.ChannelId = 1
|
|
||||||
req.AgentId = 100
|
|
||||||
req.SiteId = 1001
|
|
||||||
req.Ip = "1864204063"
|
|
||||||
req.Idfa = "of5wO5sKWep0OFPt9rWQf6xNJVPg"
|
|
||||||
req.Logined = 1
|
|
||||||
req.MatchType = 1
|
|
||||||
req.GameAwemeId = ""
|
|
||||||
req.ComeBackUser = 0
|
|
||||||
req.FanCode = ""
|
|
||||||
req.Network = ""
|
|
||||||
req.Idfv = ""
|
|
||||||
req.ScreenResolution = ""
|
|
||||||
req.System = ""
|
|
||||||
req.Electric = ""
|
|
||||||
req.ProcessorModel = ""
|
|
||||||
req.BaseBand = ""
|
|
||||||
req.Model = ""
|
|
||||||
req.Battery = ""
|
|
||||||
req.Oaid = ""
|
|
||||||
req.AdInfo = ""
|
|
||||||
req.AdDevice = ""
|
|
||||||
req.Ua = "WebSdk GaoreGame/1.3.1"
|
|
||||||
req.WxPlatform = ""
|
|
||||||
resp, err := client.GetImei(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
t.Log(resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestSetImei(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req := CreateSetImeiReq()
|
|
||||||
// 基础字段赋值
|
|
||||||
req.UserName = "15179405888"
|
|
||||||
req.GameId = 6062
|
|
||||||
req.GameSign = "hlhj"
|
|
||||||
req.ChannelId = 1 // mtype
|
|
||||||
req.MatchType = 2
|
|
||||||
req.Imei = "96d9acdd57535c92-null"
|
|
||||||
req.Idfa = "96d9acdd57535c92-null"
|
|
||||||
req.Network = "4G"
|
|
||||||
req.Idfv = ""
|
|
||||||
req.ScreenResolution = "2132x1080"
|
|
||||||
req.System = "11"
|
|
||||||
req.ProcessorModel = ""
|
|
||||||
req.BaseBand = ""
|
|
||||||
req.Model = "PCDM10"
|
|
||||||
req.Battery = "45"
|
|
||||||
req.Oaid = "B9258E43A5084B43B72D94580C830898343a97328d6fd210b9e23859b1d5e83d_gaore_"
|
|
||||||
req.AdInfo = ""
|
|
||||||
req.AdDevice = ""
|
|
||||||
req.Ua = "Mozilla/5.0 (Linux; Android 11; PCDM10 Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36; SHGR GaoreGame/2.3.5"
|
|
||||||
req.WxPlatform = ""
|
|
||||||
|
|
||||||
resp, err := client.SetImei(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.Log(resp)
|
|
||||||
}
|
|
@ -1,218 +0,0 @@
|
|||||||
package msdk
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
const msdkKey = "msdk@gaore.com#!!"
|
|
||||||
|
|
||||||
type GetIdfaReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
ChannelId int `position:"Query" field:"mtype"`
|
|
||||||
GameId int `position:"Query" field:"game_id"`
|
|
||||||
GameSign string `position:"Query" field:"game_sign"`
|
|
||||||
Ip string `position:"Query" field:"ip"`
|
|
||||||
Imei string `position:"Query" field:"imei"`
|
|
||||||
Idfa string `position:"Query" field:"idfa"`
|
|
||||||
Idfv string `position:"Query" field:"idfv"`
|
|
||||||
LongId string `position:"Query" field:"long_id"`
|
|
||||||
SdkVersion string `position:"Query" field:"version"`
|
|
||||||
Os string `position:"Query" field:"os"`
|
|
||||||
GameOs int `position:"Query" field:"game_os"`
|
|
||||||
GameSubOs int `position:"Query" field:"game_sub_os"`
|
|
||||||
UserName string `position:"Query" field:"user_name"`
|
|
||||||
Ua string `position:"Query" field:"ua"`
|
|
||||||
LiveCode string `position:"Query" field:"live_code"`
|
|
||||||
AdDevice string `position:"Query" field:"ad_device"`
|
|
||||||
PkgAgentId string `position:"Query" field:"pkg_agent_id"`
|
|
||||||
PkgSiteId string `position:"Query" field:"pkg_site_id"`
|
|
||||||
Network string `position:"Query" field:"network"`
|
|
||||||
ScreenResolution string `position:"Query" field:"screen_resolution"`
|
|
||||||
System string `position:"Query" field:"system"`
|
|
||||||
Electric string `position:"Query" field:"electric"`
|
|
||||||
ProcessorModel string `position:"Query" field:"processor_model"`
|
|
||||||
BaseBand string `position:"Query" field:"baseband"`
|
|
||||||
Model string `position:"Query" field:"model"`
|
|
||||||
Battery string `position:"Query" field:"battery"`
|
|
||||||
Oaid string `position:"Query" field:"oaid"`
|
|
||||||
AdInfo string `position:"Query" field:"adinfo"`
|
|
||||||
WxPlatform string `position:"Query" field:"wx_platform"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetIdfaResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
GameId int `json:"game_id"`
|
|
||||||
AgentId int `json:"agent_id"`
|
|
||||||
SiteId int `json:"site_id"`
|
|
||||||
GameAwemeId string `json:"game_aweme_id"`
|
|
||||||
LongId string `json:"long_id"`
|
|
||||||
DeviceId string `json:"device_id"`
|
|
||||||
Exists bool `json:"exists"`
|
|
||||||
FromAd bool `json:"from_ad"`
|
|
||||||
MatchType int `json:"match_type"`
|
|
||||||
ClickId string `json:"click_id,omitempty"` // 非必要字段,使用 omitempty 忽略空值
|
|
||||||
MatchTrace string `json:"match_trace,omitempty"` // 非必要字段
|
|
||||||
RegTime int64 `json:"reg_time"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetIdfaReq() *GetIdfaReq {
|
|
||||||
req := &GetIdfaReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/getIdfa.php")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserAttrReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
UserName string `position:"Query" field:"user_name"`
|
|
||||||
GameSign string `position:"Query" field:"game_sign"`
|
|
||||||
Ts int64 `position:"Query" field:"ts"`
|
|
||||||
Sign string `position:"Query" field:"sign"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserAttrResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data struct {
|
|
||||||
Uid int `json:"uid"`
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
RegTime int `json:"reg_time"` // 假设注册时间是时间戳
|
|
||||||
GameID int `json:"game_id"`
|
|
||||||
RegIP string `json:"reg_ip"`
|
|
||||||
AgentId int `json:"agent_id"`
|
|
||||||
SiteId int `json:"site_id"`
|
|
||||||
Imei string `json:"imei"`
|
|
||||||
Oaid string `json:"oaid"`
|
|
||||||
LongId string `json:"long_id"`
|
|
||||||
PromotionId string `json:"promotion_id"`
|
|
||||||
Mid3 string `json:"mid3"`
|
|
||||||
} `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserAttrReq(userName, gameSign string) *GetUserAttrReq {
|
|
||||||
req := &GetUserAttrReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.UserName = userName
|
|
||||||
req.GameSign = gameSign
|
|
||||||
req.Ts = time.Now().Unix()
|
|
||||||
req.Sign = utils.Md5(fmt.Sprintf("%d%s", req.Ts, msdkKey))
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/getUserAttr.php")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetImeiReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
Uid int `position:"Query" field:"uid"`
|
|
||||||
UserName string `position:"Query" field:"user_name"`
|
|
||||||
GameId int `position:"Query" field:"game_id"`
|
|
||||||
GameSign string `position:"Query" field:"game_sign"`
|
|
||||||
RegTime int64 `position:"Query" field:"reg_time"`
|
|
||||||
Imei string `position:"Query" field:"imei"`
|
|
||||||
ChannelId int `position:"Query" field:"mtype"`
|
|
||||||
AgentId int `position:"Query" field:"agent_id"`
|
|
||||||
SiteId int `position:"Query" field:"site_id"`
|
|
||||||
Ip string `position:"Query" field:"ip"`
|
|
||||||
UserIp string `position:"Query" field:"user_ip"`
|
|
||||||
Idfa string `position:"Query" field:"idfa"`
|
|
||||||
Logined int `position:"Query" field:"logined"`
|
|
||||||
MatchType int `position:"Query" field:"match_type"`
|
|
||||||
GameAwemeId string `position:"Query" field:"game_aweme_id"`
|
|
||||||
ComeBackUser int `position:"Query" field:"come_back_user"` //回流用户标识 1=>回流用户
|
|
||||||
LpReg int `position:"Query" field:"lp_reg"` // 落地页注册用户标识
|
|
||||||
FanCode string `position:"Query" field:"fan_code"` // 粉丝码
|
|
||||||
Network string `position:"Query" field:"network"`
|
|
||||||
Idfv string `position:"Query" field:"idfv"`
|
|
||||||
ScreenResolution string `position:"Query" field:"screen_resolution"`
|
|
||||||
System string `position:"Query" field:"system"`
|
|
||||||
Electric string `position:"Query" field:"electric"`
|
|
||||||
ProcessorModel string `position:"Query" field:"processor_model"`
|
|
||||||
BaseBand string `position:"Query" field:"baseband"`
|
|
||||||
Model string `position:"Query" field:"model"`
|
|
||||||
Battery string `position:"Query" field:"battery"`
|
|
||||||
Oaid string `position:"Query" field:"oaid"`
|
|
||||||
AdInfo string `position:"Query" field:"adinfo"`
|
|
||||||
AdDevice string `position:"Query" field:"ad_device"`
|
|
||||||
Ua string `position:"Query" field:"ua"`
|
|
||||||
WxPlatform string `position:"Query" field:"wx_platform"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetImeiResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Uid string `json:"uid"`
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
Openid string `json:"openid"`
|
|
||||||
ChannelId string `json:"mtype"`
|
|
||||||
Logined int `json:"logined"`
|
|
||||||
GameId string `json:"game_id"`
|
|
||||||
GameSign string `json:"game_sign"`
|
|
||||||
MatchType int `json:"match_type"`
|
|
||||||
RegTime int64 `json:"reg_time"` // 原始时间戳字符串
|
|
||||||
Imei string `json:"imei"`
|
|
||||||
Oaid string `json:"oaid"`
|
|
||||||
Idfa string `json:"idfa"`
|
|
||||||
Ip int64 `json:"ip"`
|
|
||||||
UserIp string `json:"user_ip"`
|
|
||||||
Ua string `json:"ua"`
|
|
||||||
Media string `json:"media"`
|
|
||||||
AgentId int `json:"agent_id"`
|
|
||||||
SiteId int `json:"site_id"`
|
|
||||||
AdInfo string `json:"adinfo"`
|
|
||||||
GameAwemeId string `json:"game_aweme_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetImeiReq() *GetImeiReq {
|
|
||||||
req := &GetImeiReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/getImei.php")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
type SetImeiReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
UserName string `position:"Query" field:"user_name"`
|
|
||||||
GameId int `position:"Query" field:"game_id"`
|
|
||||||
Imei string `position:"Query" field:"imei"`
|
|
||||||
Idfa string `position:"Query" field:"idfa"`
|
|
||||||
GameSign string `position:"Query" field:"game_sign"`
|
|
||||||
ChannelId int `position:"Query" field:"mtype"`
|
|
||||||
MatchType int `position:"Query" field:"match_type"`
|
|
||||||
Network string `position:"Query" field:"network"`
|
|
||||||
Idfv string `position:"Query" field:"idfv"`
|
|
||||||
ScreenResolution string `position:"Query" field:"screen_resolution"`
|
|
||||||
System string `position:"Query" field:"system"` // 可能为系统版本号字符串
|
|
||||||
ProcessorModel string `position:"Query" field:"processor_model"`
|
|
||||||
BaseBand string `position:"Query" field:"baseband"`
|
|
||||||
Model string `position:"Query" field:"model"`
|
|
||||||
Battery string `position:"Query" field:"battery"`
|
|
||||||
Oaid string `position:"Query" field:"oaid"`
|
|
||||||
AdInfo string `position:"Query" field:"adinfo"`
|
|
||||||
AdDevice string `position:"Query" field:"ad_device"`
|
|
||||||
Ua string `position:"Query" field:"ua"`
|
|
||||||
WxPlatform string `position:"Query" field:"wx_platform"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SetImeiResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateSetImeiReq() *SetImeiReq {
|
|
||||||
req := &SetImeiReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/setImei.php")
|
|
||||||
req.Method = requests.GET
|
|
||||||
return req
|
|
||||||
}
|
|
@ -33,14 +33,3 @@ func (c *Client) OpenGame(req *OpenGameReq) (resp *OpenGameResp, err error) {
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPayRedisData 设置支付redis相关数据
|
|
||||||
func (c *Client) NewPayRedisData(req *NewPayRedisDataReq) (resp *NewPayRedisDataResp, err error) {
|
|
||||||
resp = CreateNewPayRedisDataResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -19,18 +19,3 @@ func TestOpenGame(t *testing.T) {
|
|||||||
|
|
||||||
fmt.Println(resp.Code, resp.Msg)
|
fmt.Println(resp.Code, resp.Msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNewPayRedisData(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
req := CreateNewPayRedisDataReq()
|
|
||||||
|
|
||||||
resp, err := client.NewPayRedisData(req)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println(resp.Code, resp.Msg)
|
|
||||||
}
|
|
||||||
|
@ -15,14 +15,6 @@ type OpenGameResp struct {
|
|||||||
*responses.BaseResponse
|
*responses.BaseResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
type NewPayRedisDataReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type NewPayRedisDataResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetHttpContentBytes 因为http://script.gaore.com/open_game.php?game_id=这个接口返回的不是json,反序列化会报错,所以返回一个固定的json
|
// GetHttpContentBytes 因为http://script.gaore.com/open_game.php?game_id=这个接口返回的不是json,反序列化会报错,所以返回一个固定的json
|
||||||
func (baseResponse *OpenGameResp) GetHttpContentBytes() []byte {
|
func (baseResponse *OpenGameResp) GetHttpContentBytes() []byte {
|
||||||
b, _ := json.Marshal(map[string]interface{}{"code": 200, "msg": "success"})
|
b, _ := json.Marshal(map[string]interface{}{"code": 200, "msg": "success"})
|
||||||
@ -48,21 +40,3 @@ func CreateOpenGameResp() *OpenGameResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateNewPayRedisDataReq 设置支付redis相关数据
|
|
||||||
func CreateNewPayRedisDataReq() *NewPayRedisDataReq {
|
|
||||||
req := &NewPayRedisDataReq{
|
|
||||||
&requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "pay/new_pay_redis_data.php")
|
|
||||||
req.Method = requests.GET
|
|
||||||
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateNewPayRedisDataResp() *NewPayRedisDataResp {
|
|
||||||
return &NewPayRedisDataResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -88,22 +88,6 @@ func (c *Client) SendSms(req *SendSmsRequest) (resp *SendSmsResponse, err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SendSmsV2(req *SendSmsRequestV2) (resp *SendSmsResponseV2, err error) {
|
|
||||||
|
|
||||||
if req.Phone == "" {
|
|
||||||
err = errors.New("phone is empty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Type == "" {
|
|
||||||
err = errors.New("type is empty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp = CreateSendSmsResponseV2()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func getToken(key string) (ts int64, token string) {
|
func getToken(key string) (ts int64, token string) {
|
||||||
ts = time.Now().Unix()
|
ts = time.Now().Unix()
|
||||||
hash := md5.New()
|
hash := md5.New()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package sms
|
package sms
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||||
"testing"
|
"testing"
|
||||||
@ -141,30 +140,3 @@ func TestClient_SendSmsUrl(t *testing.T) {
|
|||||||
|
|
||||||
fmt.Println(sms)
|
fmt.Println(sms)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClient_SendSmsCodeV2(t *testing.T) {
|
|
||||||
req := CreateSendSmsRequestV2(SendSmsParamV2{
|
|
||||||
Phone: "18320021439",
|
|
||||||
Type: SmsTypeRegister,
|
|
||||||
Replaces: []Item{{
|
|
||||||
Key: ReplaceKeyCode,
|
|
||||||
Value: "6379",
|
|
||||||
}, {
|
|
||||||
Key: ReplaceKeySecond,
|
|
||||||
Value: "120",
|
|
||||||
}},
|
|
||||||
Company: "",
|
|
||||||
Ip: "192.168.1.103",
|
|
||||||
})
|
|
||||||
|
|
||||||
sms, err := client.SendSmsV2(req)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
marshal, err := json.Marshal(sms)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
fmt.Println(string(marshal))
|
|
||||||
}
|
|
||||||
|
@ -29,20 +29,6 @@ type SendSmsResponse struct {
|
|||||||
*responses.BaseResponse
|
*responses.BaseResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
type SendSmsRequestV2 struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
Phone string `position:"Json" field:"phone"`
|
|
||||||
Type string `position:"Json" field:"type"`
|
|
||||||
Replaces []Item `position:"Json" field:"replaces"`
|
|
||||||
Company string `position:"Json" field:"company"`
|
|
||||||
Ip string `position:"Json" field:"ip"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SendSmsResponseV2 struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
TraceID string `json:"trace_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SmsType = string
|
type SmsType = string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -58,14 +44,6 @@ type SendSmsParam struct {
|
|||||||
Replaces []Item
|
Replaces []Item
|
||||||
}
|
}
|
||||||
|
|
||||||
type SendSmsParamV2 struct {
|
|
||||||
Phone string // 手机号
|
|
||||||
Type SmsType // 验证码类型
|
|
||||||
Replaces []Item
|
|
||||||
Company string // 子游戏公司主体
|
|
||||||
Ip string // ip
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateSendSmsRequest(param SendSmsParam) (req *SendSmsRequest) {
|
func CreateSendSmsRequest(param SendSmsParam) (req *SendSmsRequest) {
|
||||||
req = &SendSmsRequest{
|
req = &SendSmsRequest{
|
||||||
JsonRequest: &requests.JsonRequest{},
|
JsonRequest: &requests.JsonRequest{},
|
||||||
@ -84,24 +62,3 @@ func CreateSendSmsResponse() (resp *SendSmsResponse) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateSendSmsRequestV2(param SendSmsParamV2) (req *SendSmsRequestV2) {
|
|
||||||
req = &SendSmsRequestV2{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
Phone: param.Phone,
|
|
||||||
Type: param.Type,
|
|
||||||
Replaces: param.Replaces,
|
|
||||||
Company: param.Company,
|
|
||||||
Ip: param.Ip,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v2/sms/send")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateSendSmsResponseV2() (resp *SendSmsResponseV2) {
|
|
||||||
resp = &SendSmsResponseV2{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -3,7 +3,6 @@ package stat
|
|||||||
import (
|
import (
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -50,17 +49,3 @@ func (c *Client) GetAgentList(req *GetAgentListReq) (resp *GetAgentListResp, err
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserRoleRegPage 获取用户角色注册分页列表
|
|
||||||
func (c *Client) GetUserRoleRegPage(req *UserRoleRegReq) (resp *UserRoleRegResp, err error) {
|
|
||||||
resp = CreateUserRoleRegPageResp()
|
|
||||||
// 设置超时时间
|
|
||||||
req.SetConnectTimeout(10 * time.Second)
|
|
||||||
// 设置读取超时时间
|
|
||||||
req.SetReadTimeout(20 * time.Second)
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -78,23 +78,3 @@ func TestClient_GetAgentList(t *testing.T) {
|
|||||||
t.Log("GetAgentList test passed")
|
t.Log("GetAgentList test passed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestClient_GetUserRoleRegPage 查询用户角色注册分页
|
|
||||||
func TestClient_GetUserRoleRegPage(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
req := CreateUserRoleRegPageReq(UserRoleRegParam{
|
|
||||||
Page: 1,
|
|
||||||
PageSize: 10,
|
|
||||||
RoleId: "",
|
|
||||||
RoleName: "温文波箐魔灵",
|
|
||||||
})
|
|
||||||
|
|
||||||
resp, err := client.GetUserRoleRegPage(req)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
|
||||||
}
|
|
||||||
|
@ -57,59 +57,3 @@ func CreateSetUserNewGameAuthResp() *SetUserNewGameAuthResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------
|
|
||||||
|
|
||||||
// UserRoleReg 玩家汇总角色创建记录
|
|
||||||
type UserRoleReg struct {
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
Uid string `json:"uid"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
GameSign string `json:"game_sign"`
|
|
||||||
Id string `json:"id"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
}
|
|
||||||
type UserRoleRegPage struct {
|
|
||||||
Page int `json:"page"`
|
|
||||||
TotalCount int `json:"total_count"`
|
|
||||||
PageSize int `json:"page_size"`
|
|
||||||
Data []UserRoleReg `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type UserRoleRegParam struct {
|
|
||||||
Page int `json:"page"`
|
|
||||||
PageSize int `json:"page_size"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
}
|
|
||||||
type UserRoleRegReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
type UserRoleRegResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data UserRoleRegPage `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateUserRoleRegPageReq(param UserRoleRegParam) *UserRoleRegReq {
|
|
||||||
req := &UserRoleRegReq{
|
|
||||||
&requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/user/getRoleRegPage")
|
|
||||||
req.Method = requests.POST
|
|
||||||
req.FormParams = map[string]string{
|
|
||||||
"page": fmt.Sprintf("%v", param.Page),
|
|
||||||
"page_size": fmt.Sprintf("%v", param.PageSize),
|
|
||||||
"role_id": param.RoleId,
|
|
||||||
"role_name": param.RoleName,
|
|
||||||
}
|
|
||||||
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
func CreateUserRoleRegPageResp() *UserRoleRegResp {
|
|
||||||
return &UserRoleRegResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user