Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
66eb586d88 | |||
5f5a1160bf | |||
eb6157ce05 | |||
a329d30296 | |||
|
49c41fb60b | ||
|
384d257e03 | ||
e1c163ef10 | |||
45e449df11 | |||
90cc6c3719 | |||
|
b0027fd6e3 | ||
|
0b9b6ec0d9 | ||
e4b852e4a6 | |||
efaf155924 | |||
|
ef5d453838 | ||
|
a274190b01 | ||
|
eea0eb790e | ||
|
de55d3d7d5 | ||
6d3f8d8232 | |||
089a9091ec | |||
ba79540f78 | |||
7e9eae718c | |||
25552dd187 | |||
|
eb25c8f20a | ||
|
92868ce4a0 |
@ -120,3 +120,15 @@ func (client *Client) OrderRecordDetail(req *GetWorkOrderRecordDetailReq) (resp
|
|||||||
err = client.DoAction(req, resp)
|
err = client.DoAction(req, resp)
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
@ -366,3 +366,41 @@ func TestOrderRecordDetail(t *testing.T) {
|
|||||||
}
|
}
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
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))
|
||||||
|
}
|
||||||
|
@ -46,3 +46,75 @@ func CreateGetFaqResponse() (response *GetFaqResponse) {
|
|||||||
}
|
}
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
@ -82,3 +82,9 @@ 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
|
||||||
|
}
|
||||||
|
@ -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 int `json:"download_id"`
|
DownloadId string `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,6 +99,8 @@ 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"`
|
||||||
@ -208,7 +210,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"`
|
||||||
@ -255,3 +257,61 @@ 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{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
36
services/ip/client.go
Normal file
36
services/ip/client.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
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
|
||||||
|
}
|
48
services/ip/client_test.go
Normal file
48
services/ip/client_test.go
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
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))
|
||||||
|
}
|
100
services/ip/ip.go
Normal file
100
services/ip/ip.go
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
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
|
||||||
|
}
|
@ -33,3 +33,14 @@ 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,3 +19,18 @@ 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,6 +15,14 @@ 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"})
|
||||||
@ -40,3 +48,21 @@ 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,6 +88,22 @@ 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,6 +1,7 @@
|
|||||||
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"
|
||||||
@ -140,3 +141,30 @@ 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,6 +29,20 @@ 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 (
|
||||||
@ -44,6 +58,14 @@ 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{},
|
||||||
@ -62,3 +84,24 @@ 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,6 +3,7 @@ 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 (
|
||||||
@ -49,3 +50,17 @@ 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,3 +78,23 @@ 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,3 +57,59 @@ 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