6
0

Compare commits

..

No commits in common. "master" and "v1.2.10" have entirely different histories.

19 changed files with 68 additions and 781 deletions

View File

@ -1,47 +0,0 @@
package asdk
import (
"fmt"
"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/utils"
"time"
)
const (
VERSION = "2020-11-16"
)
var HOST = requests.Host{
Default: "asdk",
}
type Client struct {
sdk.Client
}
func NewClient() (client *Client, err error) {
client = new(Client)
err = client.Init()
return
}
// GenerateInnerApiSign
// 生成内部接口签名
func GenerateInnerApiSign(ts int64) (int64, string) {
const InnerSignSecret = "sYbfhozSu^@K8~y*"
if ts == 0 {
ts = time.Now().Unix()
}
return ts, utils.Md5(fmt.Sprintf("%d%s", ts, InnerSignSecret))
}
// CreateKickUserReq 踢人
func (c *Client) CreateKickUserReq(req *KickUserReq) (resp *KickUserResp, err error) {
resp = CreateKickUserResp()
err = c.DoAction(req, resp)
if err != nil {
return
}
return
}

View File

@ -1,26 +0,0 @@
package asdk
import (
"fmt"
"testing"
)
// 获取用户累计付费
func TestKickUser(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
ts, sign := GenerateInnerApiSign(0)
req := CreateKickUserReq(KickUserParam{
Ts: ts,
Sign: sign,
UserName: "aq36604627",
})
resp, err := client.CreateKickUserReq(req)
if err != nil {
panic(err)
}
fmt.Println(resp.Code, resp.Msg, resp.Data)
}

View File

@ -1,45 +0,0 @@
package asdk
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
"strconv"
)
type KickUserReq struct {
*requests.RpcRequest
}
type KickUserResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct{} `json:"data"`
TraceId string `json:"trace_id"`
}
type KickUserParam struct {
Ts int64 `json:"ts"`
Sign string `json:"sign"`
UserName string `json:"user_name"`
}
func CreateKickUserReq(data KickUserParam) *KickUserReq {
req := &KickUserReq{
&requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/kick")
req.Method = requests.GET
req.QueryParams = map[string]string{
"ts": strconv.FormatInt(data.Ts, 10),
"sign": data.Sign,
"user_name": data.UserName,
}
return req
}
func CreateKickUserResp() *KickUserResp {
return &KickUserResp{
BaseResponse: &responses.BaseResponse{},
}
}

View File

@ -234,8 +234,8 @@ func TestOrderRestart(t *testing.T) {
} }
req := CreateOrderRestartRequest(OrderRestartParam{ req := CreateOrderRestartRequest(OrderRestartParam{
OrderNum: "20250530173554491048", OrderNum: "20250530173554491048",
SysRemarkContent: "模拟用户重启", RemarkContent: "模拟用户重启",
SysRemarkPic: []string{}, RemarkPic: []string{},
}) })
res, err := client.OrderRestart(req) res, err := client.OrderRestart(req)
if err != nil { if err != nil {
@ -255,17 +255,17 @@ func TestOrderSubmit(t *testing.T) {
panic(newErr) panic(newErr)
} }
req := CreateOrderSubmitRequest(OrderSubmitParam{ req := CreateOrderSubmitRequest(OrderSubmitParam{
SysGameId: 7874, GameId: 7991,
SysUserName: "rz35990497", UserName: "ws45265737",
SysUid: 221016372, Uid: 65598086,
SysRoleId: "265500394", RoleId: "10676785",
SysRoleName: "好玩的尼", RoleName: "流水行者",
SysServerName: "碧水连天", ServerName: "血阳琉璃",
SysOrderTemplateCode: "findAccount", OrderTemplateCode: "btu7RoDj",
SysDetail: "测试go-common改动。", Detail: "我的问题是,组队这个玩法的初衷是希望实现大家能和身边认识的朋友一起下洞的目标。但是现在看来,很多玩家都选择了在游戏中随机匹配队友,而我们发现,组队机制暴露的绝大部分玩家体验问题都是在随机匹配中出现的。<br/>比如恶意踢人,又比如匹配到的玩家等级比较低,不符合自己本次下洞的目标,再或者是组队进入洞窟却发现队友已经快要收尾结束探险了。",
SysPhone: "13725263463", Phone: "13725263463",
ApplyIp: "192.168.1.202", ApplyIp: "183.63.75.58",
SysOrderParts: []OrderSubmitPart{ OrderParts: []OrderSubmitPart{
{ {
PartKey: "email", PartKey: "email",
PartName: "联系邮箱", PartName: "联系邮箱",
@ -277,12 +277,13 @@ func TestOrderSubmit(t *testing.T) {
PartName: "充值凭证", PartName: "充值凭证",
PartValue: "", PartValue: "",
PicValue: []string{ PicValue: []string{
"uploads/068/068eefab055a96ae404db19b7a121898.jpeg", "uploads/d1a/d1aba28357b89e7ebfc77e5c43fc81b7.jpeg",
"uploads/908/90822cca4e87ed49acaf82050dd3ac09.jpeg", "uploads/c37/c3726c5cf7175ed048f6c68416dbf30b.jpeg",
"uploads/ca2/ca285ae8feae8c60d51b53079fa9b2a9.jpeg",
}, },
}, },
}, },
SysSmsCode: "7204", SmsCode: "7204",
}) })
res, err := client.OrderSubmit(req) res, err := client.OrderSubmit(req)
if err != nil { if err != nil {

View File

@ -175,16 +175,14 @@ func CreateOrderAppraiseResponse() (resp *OrderAppraiseResponse) {
// OrderRestartParam 用户重启工单 // OrderRestartParam 用户重启工单
type OrderRestartParam struct { type OrderRestartParam struct {
OrderNum string `json:"order_num"` OrderNum string `json:"order_num"`
SysRemarkContent string `json:"sys_remark_content"` RemarkContent string `json:"remark_content"`
SysRemarkPic []string `json:"sys_remark_pic"` RemarkPic []string `json:"remark_pic"`
UserName string `json:"user_name"`
} }
type OrderRestartRequest struct { type OrderRestartRequest struct {
*requests.JsonRequest *requests.JsonRequest
OrderNum string `position:"Json" field:"order_num"` OrderNum string `position:"Json" field:"order_num"`
SysRemarkContent string `position:"Json" field:"sys_remark_content"` RemarkContent string `position:"Json" field:"remark_content"`
SysRemarkPic []string `position:"Json" field:"sys_remark_pic"` RemarkPic []string `position:"Json" field:"remark_pic"`
UserName string `position:"Json" field:"user_name"`
} }
type OrderRestartResponse struct { type OrderRestartResponse struct {
*responses.BaseResponse *responses.BaseResponse
@ -196,9 +194,8 @@ func CreateOrderRestartRequest(param OrderRestartParam) (req *OrderRestartReques
req = &OrderRestartRequest{ req = &OrderRestartRequest{
JsonRequest: &requests.JsonRequest{}, JsonRequest: &requests.JsonRequest{},
OrderNum: param.OrderNum, OrderNum: param.OrderNum,
SysRemarkContent: param.SysRemarkContent, RemarkContent: param.RemarkContent,
SysRemarkPic: param.SysRemarkPic, RemarkPic: param.RemarkPic,
UserName: param.UserName,
} }
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_restart") req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_restart")
req.Method = requests.POST req.Method = requests.POST
@ -212,18 +209,18 @@ func CreateOrderRestartResponse() (resp *OrderRestartResponse) {
// OrderSubmitParam 工单提交 // OrderSubmitParam 工单提交
type OrderSubmitParam struct { type OrderSubmitParam struct {
SysGameId int64 `json:"sys_game_id"` GameId int64 `json:"game_id"`
SysUserName string `json:"sys_user_name"` UserName string `json:"user_name"`
SysUid int64 `json:"sys_uid"` Uid int64 `json:"uid"`
SysRoleId string `json:"sys_role_id"` RoleId string `json:"role_id"`
SysRoleName string `json:"sys_role_name"` RoleName string `json:"role_name"`
SysServerName string `json:"sys_server_name"` ServerName string `json:"server_name"`
SysOrderTemplateCode string `json:"sys_order_template_code"` OrderTemplateCode string `json:"order_template_code"`
SysDetail string `json:"sys_detail"` Detail string `json:"detail"`
SysPhone string `json:"sys_phone"` Phone string `json:"phone"`
ApplyIp string `json:"apply_ip"` ApplyIp string `json:"apply_ip"`
SysOrderParts []OrderSubmitPart `json:"sys_order_parts"` OrderParts []OrderSubmitPart `json:"order_parts"`
SysSmsCode string `json:"sys_sms_code"` SmsCode string `json:"sms_code"`
} }
type OrderSubmitPart struct { type OrderSubmitPart struct {
@ -236,18 +233,18 @@ type OrderSubmitPart struct {
} }
type OrderSubmitRequest struct { type OrderSubmitRequest struct {
*requests.JsonRequest *requests.JsonRequest
SysGameId int64 `position:"Json" field:"sys_game_id"` GameId int64 `position:"Json" field:"game_id"`
SysUserName string `position:"Json" field:"sys_user_name"` UserName string `position:"Json" field:"user_name"`
SysUid int64 `position:"Json" field:"sys_uid"` Uid int64 `position:"Json" field:"uid"`
SysRoleId string `position:"Json" field:"sys_role_id"` RoleId string `position:"Json" field:"role_id"`
SysRoleName string `position:"Json" field:"sys_role_name"` RoleName string `position:"Json" field:"role_name"`
SysServerName string `position:"Json" field:"sys_server_name"` ServerName string `position:"Json" field:"server_name"`
SysOrderTemplateCode string `position:"Json" field:"sys_order_template_code"` OrderTemplateCode string `position:"Json" field:"order_template_code"`
SysDetail string `position:"Json" field:"sys_detail"` Detail string `position:"Json" field:"detail"`
SysPhone string `position:"Json" field:"sys_phone"` Phone string `position:"Json" field:"phone"`
ApplyIp string `position:"Json" field:"apply_ip"` ApplyIp string `position:"Json" field:"apply_ip"`
SysOrderParts []OrderSubmitPart `position:"Json" field:"sys_order_parts"` OrderParts []OrderSubmitPart `position:"Json" field:"order_parts"`
SysSmsCode string `position:"Json" field:"sys_sms_code"` SmsCode string `position:"Json" field:"sms_code"`
} }
type OrderSubmitResponse struct { type OrderSubmitResponse struct {
*responses.BaseResponse *responses.BaseResponse
@ -261,18 +258,18 @@ type OrderSubmitResponse struct {
func CreateOrderSubmitRequest(param OrderSubmitParam) (req *OrderSubmitRequest) { func CreateOrderSubmitRequest(param OrderSubmitParam) (req *OrderSubmitRequest) {
req = &OrderSubmitRequest{ req = &OrderSubmitRequest{
JsonRequest: &requests.JsonRequest{}, JsonRequest: &requests.JsonRequest{},
SysGameId: param.SysGameId, GameId: param.GameId,
SysUserName: param.SysUserName, UserName: param.UserName,
SysUid: param.SysUid, Uid: param.Uid,
SysRoleId: param.SysRoleId, RoleId: param.RoleId,
SysRoleName: param.SysRoleName, RoleName: param.RoleName,
SysServerName: param.SysServerName, ServerName: param.ServerName,
SysOrderTemplateCode: param.SysOrderTemplateCode, OrderTemplateCode: param.OrderTemplateCode,
SysDetail: param.SysDetail, Detail: param.Detail,
SysPhone: param.SysPhone, Phone: param.Phone,
ApplyIp: param.ApplyIp, ApplyIp: param.ApplyIp,
SysOrderParts: param.SysOrderParts, OrderParts: param.OrderParts,
SysSmsCode: param.SysSmsCode, SmsCode: param.SmsCode,
} }
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_submit") req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_submit")
req.Method = requests.POST req.Method = requests.POST
@ -288,13 +285,11 @@ func CreateOrderSubmitResponse() (resp *OrderSubmitResponse) {
type OrderFurtherPartParam struct { type OrderFurtherPartParam struct {
OrderNum string `json:"order_num"` OrderNum string `json:"order_num"`
OrderParts []OrderSubmitPart `json:"order_parts"` OrderParts []OrderSubmitPart `json:"order_parts"`
UserName string `json:"user_name"`
} }
type OrderFurtherPartRequest struct { type OrderFurtherPartRequest struct {
*requests.JsonRequest *requests.JsonRequest
OrderNum string `position:"Json" field:"order_num"` OrderNum string `position:"Json" field:"order_num"`
OrderParts []OrderSubmitPart `position:"Json" field:"order_parts"` OrderParts []OrderSubmitPart `position:"Json" field:"order_parts"`
UserName string `position:"Json" field:"user_name"`
} }
type OrderFurtherPartResponse struct { type OrderFurtherPartResponse struct {
*responses.BaseResponse *responses.BaseResponse
@ -307,7 +302,6 @@ func CreateOrderFurtherPartRequest(param OrderFurtherPartParam) (req *OrderFurth
JsonRequest: &requests.JsonRequest{}, JsonRequest: &requests.JsonRequest{},
OrderNum: param.OrderNum, OrderNum: param.OrderNum,
OrderParts: param.OrderParts, OrderParts: param.OrderParts,
UserName: param.UserName,
} }
req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_further_data") req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_further_data")
req.Method = requests.POST req.Method = requests.POST

View File

@ -116,10 +116,3 @@ func (c *Client) GetProtocolByCompany(req *GetProtocolByCompanyRep) (resp *GetPr
err = c.DoAction(req, resp) err = c.DoAction(req, resp)
return return
} }
// KickUser 踢人
func (c *Client) KickUser(req *KickUserReq) (resp *KickUserResp, err error) {
resp = CreateKickUserResp()
err = c.DoAction(req, resp)
return
}

View File

@ -3,7 +3,6 @@ package game
import ( import (
"fmt" "fmt"
"testing" "testing"
"time"
) )
func TestGetGameOsInfo(t *testing.T) { func TestGetGameOsInfo(t *testing.T) {
@ -212,18 +211,3 @@ func TestClient_GetProtocolByCompany(t *testing.T) {
} }
t.Log(resp.Code, resp.Msg, resp.Data.Content) t.Log(resp.Code, resp.Msg, resp.Data.Content)
} }
// 测试踢人
func TestKickUser(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Error(err)
} // CreateKickUserReq
getRealAuthBlackListReq := CreateKickUserReq(8677, "wzcqtest", "8676", time.Now().Unix())
kickUserResp, err := client.KickUser(getRealAuthBlackListReq)
if err != nil {
t.Error(err)
return
}
t.Log(kickUserResp)
}

View File

@ -442,49 +442,3 @@ func CreateGetGameRealAuthInfoResp() *GetGameRealAuthInfoResp {
BaseResponse: &responses.BaseResponse{}, BaseResponse: &responses.BaseResponse{},
} }
} }
// KickUserReq
// 踢人下线
type KickUserReq struct {
*requests.RpcRequest
Uid int64 `position:"Body" field:"uid" default:"-" `
GameSign string `position:"Body" field:"game_sign" default:"-" `
ServerSign string `position:"Body" field:"server_sign" default:"-" `
Time int64 `position:"Body" field:"time" default:"-" `
}
type KickUserRespDataCallCpInfo struct {
Url string `json:"url"`
RequestParam map[string]any `json:"request_param"`
Response map[string]any `json:"response"`
}
type KickUserRespData struct {
CallCpInfo KickUserRespDataCallCpInfo `json:"call_cp_info"`
}
type KickUserResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data KickUserRespData `json:"data"`
}
func CreateKickUserReq(uid int64, gameSign string, serverSign string, time int64) *KickUserReq {
req := &KickUserReq{
RpcRequest: &requests.RpcRequest{},
Uid: uid,
GameSign: gameSign,
ServerSign: serverSign,
Time: time,
}
req.InitWithApiInfo(HOST, VERSION, "/api/game/kickUser")
req.Method = requests.POST
return req
}
func CreateKickUserResp() *KickUserResp {
return &KickUserResp{
BaseResponse: &responses.BaseResponse{},
}
}

View File

@ -55,11 +55,3 @@ func (c *Client) EditCard(req EditCardRequestParam) (response string, err error)
} }
return createEditCardResponse.GetHttpContentString(), nil return createEditCardResponse.GetHttpContentString(), nil
} }
// GetUserGameSign
// 获取用户登录过的游戏大类
func (c *Client) GetUserGameSign(req *GetUserGameSignRequest) (response *GetUserGameSignResponse, err error) {
response = CreateGetUserGameSignResponse()
err = c.DoAction(req, response)
return
}

View File

@ -63,18 +63,3 @@ func TestEditCard(t *testing.T) {
t.Logf("%v", editCardResponse) t.Logf("%v", editCardResponse)
} }
// 测试获取用户登录过的游戏大类
func TestGetUserGameSign(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Error(err)
}
req := CreateGetUserGameSignRequest("oo70683572", "", "")
resp, err := client.GetUserGameSign(req)
if err != nil {
t.Error(err)
}
t.Logf("resp code:%+v", resp.Code)
t.Logf("resp data:%+v", resp.Data)
}

View File

@ -21,35 +21,9 @@ type GetUserListResponse struct {
} }
type UserInfo struct { type UserInfo struct {
Id string `json:"id"` UserName string `json:"user_name"` // 用户名
Uid string `json:"uid"` Uid string `json:"uid"` // uid
BbsUid string `json:"bbs_uid"` Telephone string `json:"telephone"` // 手机号
UserName string `json:"user_name"`
UserPwd string `json:"user_pwd"`
Email string `json:"email"`
Integral string `json:"integral"`
NickName string `json:"nick_name"`
TrueName string `json:"true_name"`
Sex string `json:"sex"`
IdType string `json:"id_type"`
IdCard string `json:"id_card"`
Birthday string `json:"birthday"`
Telephone string `json:"telephone"`
Mobile string `json:"mobile"`
Address string `json:"address"`
Zipcode int64 `json:"zipcode"`
Level string `json:"level"`
Qq string `json:"qq"`
Msn string `json:"msn"`
Question string `json:"question"`
Answer string `json:"answer"`
HeadPic string `json:"head_pic"`
Defendboss string `json:"defendboss"`
RegTime int64 `json:"reg_time"`
RegIp string `json:"reg_ip"`
LoginIp string `json:"login_ip"`
LoginTime string `json:"login_time"`
State string `json:"state"`
} }
// CreateGetUserListRequest 获取玩家用户列表 // CreateGetUserListRequest 获取玩家用户列表
@ -140,63 +114,3 @@ func CreateGetUserRoleListResponse() (response *GetUserRoleListResponse) {
} }
return return
} }
type GetUserGameSignRequest struct {
*requests.RpcRequest
}
type GetUserGameSignResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
List []UserGameSign `json:"list"`
} `json:"data"`
}
type UserGameSign struct {
Id string `json:"id"`
AgentId string `json:"agent_id"`
SiteId string `json:"site_id"`
Uid string `json:"uid"`
UserName string `json:"user_name"`
GameId string `json:"game_id"`
GameSign string `json:"game_sign"`
Oaid string `json:"oaid"`
Imei string `json:"imei"`
Imei2 string `json:"imei2"`
Ua string `json:"ua"`
FirstLoginIp string `json:"first_login_ip"`
FirstLoginTime string `json:"first_login_time"`
LastLoginIp string `json:"last_login_ip"`
LastLoginTime string `json:"last_login_time"`
}
// CreateGetUserGameSignRequest 获取用户登录过的游戏大类
func CreateGetUserGameSignRequest(userName, gameSign, orderBy string) (req *GetUserGameSignRequest) {
ts, sign := GetSign()
req = &GetUserGameSignRequest{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
req.FormParams = map[string]string{
"act": "info",
"do": "get_user_game_sign",
"username": userName,
"game_sign": gameSign,
"order_by": orderBy,
"time": fmt.Sprintf("%v", ts),
"sign": sign,
}
req.Method = requests.POST
return
}
func CreateGetUserGameSignResponse() (response *GetUserGameSignResponse) {
response = &GetUserGameSignResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}

View File

@ -10,7 +10,6 @@ type ComplaintCompleteRequest struct {
MchId string `position:"Body" field:"mch_id" default:"" ` MchId string `position:"Body" field:"mch_id" default:"" `
ComplaintId string `position:"Body" field:"complaint_id" default:"" ` ComplaintId string `position:"Body" field:"complaint_id" default:"" `
ExtData string `position:"Body" field:"ext_data" default:"" ` ExtData string `position:"Body" field:"ext_data" default:"" `
PayType int `position:"Body" field:"pay_type" default:"" `
} }
type ComplaintCompleteResponse struct { type ComplaintCompleteResponse struct {

View File

@ -10,7 +10,6 @@ type ComplaintUploadRequest struct {
MchId string `position:"Body" field:"mch_id" default:"" ` MchId string `position:"Body" field:"mch_id" default:"" `
ImageUrl string `position:"Body" field:"image_url" default:"" ` ImageUrl string `position:"Body" field:"image_url" default:"" `
ComplaintId string `position:"Body" field:"complaint_id" default:" " ` ComplaintId string `position:"Body" field:"complaint_id" default:" " `
PayType int `position:"Body" field:"pay_type" default:"" `
} }
type ComplaintUploadResponse struct { type ComplaintUploadResponse struct {

View File

@ -64,13 +64,3 @@ func (c *Client) GetUserRoleRegPage(req *UserRoleRegReq) (resp *UserRoleRegResp,
} }
return return
} }
// GetUserTotalPay 获取用户累计付费
func (c *Client) GetUserTotalPay(req *GetUserTotalPayReq) (resp *GetUserTotalPayResp, err error) {
resp = CreateGetUserTotalPayResp()
err = c.DoAction(req, resp)
if err != nil {
return
}
return
}

View File

@ -98,22 +98,3 @@ func TestClient_GetUserRoleRegPage(t *testing.T) {
} }
fmt.Println(resp.Code, resp.Msg, resp.Data) fmt.Println(resp.Code, resp.Msg, resp.Data)
} }
// 获取用户累计付费
func TestGetUserTotalPay(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
req := CreateGetUserTotalPayReq(GetUserTotalPayParam{
Where: "user_name = 'yoyo685757'",
Fields: []string{"user_name", "sum(total_pay_money) as total_pay_money", "last_pay_time"},
GroupBy: []string{"user_name"},
})
resp, err := client.GetUserTotalPay(req)
if err != nil {
panic(err)
}
fmt.Println(resp.Code, resp.Msg, resp.Data)
}

View File

@ -1,63 +0,0 @@
package stat
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
"strings"
)
type GetUserTotalPayReq struct {
*requests.RpcRequest
}
type GetUserTotalPayParam struct {
Where string `json:"where"`
Fields []string `json:"fields"`
GroupBy []string `json:"group_by"`
}
type GetUserTotalPayResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data TotalPayList `json:"data"`
}
type TotalPayList struct {
List []TotalPay `json:"list"`
}
type TotalPay struct {
UserName string `json:"user_name"`
RegDate string `json:"reg_date"`
AgentId int64 `json:"agent_id"`
SiteId int64 `json:"site_id"`
GameId int64 `json:"game_id"`
FirstPayTime string `json:"first_pay_time"`
FirstPayMoney float64 `json:"first_pay_money"`
TotalPayMoney float64 `json:"total_pay_money"`
LastPayTime string `json:"last_pay_time"`
PayTimes int64 `json:"pay_times"`
IsFirst int64 `json:"is_first"`
}
// CreateGetUserTotalPayReq 获取用户累充
func CreateGetUserTotalPayReq(data GetUserTotalPayParam) *GetUserTotalPayReq {
req := &GetUserTotalPayReq{
&requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/pay/getUserTotalPay")
req.Method = requests.POST
req.FormParams = make(map[string]string)
req.FormParams["where"] = data.Where
req.FormParams["fields"] = strings.Join(data.Fields, ",")
req.FormParams["group_by"] = strings.Join(data.GroupBy, ",")
return req
}
// CreateGetUserTotalPayResp 获取用户累充
func CreateGetUserTotalPayResp() *GetUserTotalPayResp {
return &GetUserTotalPayResp{
BaseResponse: &responses.BaseResponse{},
}
}

View File

@ -1,55 +0,0 @@
package userlive
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
)
const (
VERSION = "2020-11-16"
)
var HOST = requests.Host{
Default: "userlive",
}
type Client struct {
sdk.Client
}
func NewClient() (client *Client, err error) {
client = new(Client)
err = client.Init()
return
}
// CreateBanReq 封禁
func (c *Client) CreateBanReq(req *BanReq) (resp *BanResp, err error) {
resp = CreateBanResp()
err = c.DoAction(req, resp)
if err != nil {
return
}
return
}
// CreateAddBanRuleCacheReq 添加封禁规则缓存
func (c *Client) CreateAddBanRuleCacheReq(req *AddBanRuleCacheReq) (resp *AddBanRuleCacheResp, err error) {
resp = CreateAddBanRuleCacheResp()
err = c.DoAction(req, resp)
if err != nil {
return
}
return
}
// CreateRemoveBanRuleCacheReq 删除封禁规则缓存
func (c *Client) CreateRemoveBanRuleCacheReq(req *RemoveBanRuleCacheReq) (resp *RemoveBanRuleCacheResp, err error) {
resp = CreateRemoveBanRuleCacheResp()
err = c.DoAction(req, resp)
if err != nil {
return
}
return
}

View File

@ -1,104 +0,0 @@
package userlive
import (
"fmt"
"testing"
"time"
)
// 踢人
func TestBan(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
req := CreateBanReq(BanReqParam{
ActionTime: time.Now().Unix(),
TriggerType: triggerTypeLogin,
Ip: "127.0.0.1",
GameId: 8654,
UserName: "aq36604627",
Uid: 632308087,
ServerId: 123,
RoleId: "123",
BundleId: "asdfas",
GameName: "fasdf",
GameVersion: "fasdf",
SdkVersion: "fasdf",
Os: "fasd",
OsVersion: "faf",
InApp: "fasdf",
Ua: "fasdfas",
NetworkType: "fasdfa",
IsVirtual: "-1",
Cpu: "cpu",
DeviceModel: "dfasdf",
Baseband: "fasdfa",
Resolution: "fasdfa",
Battery: "fasdf",
LongId: "fasdf",
OriginImei: "fasdf",
Imei: "fasdf",
OriginOaid: "fasdf",
Oaid: "fasdf",
AndroidId: "fasdf",
Idfa: "fsdf",
Idfv: "fasdf",
DeviceId: "fasdf",
})
resp, err := client.CreateBanReq(req)
if err != nil {
panic(err)
}
fmt.Println(resp.Code, resp.Msg, resp.Data)
}
// 添加封禁规则
func TestAddBanRuleCache(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
req := CreateAddBanRuleCacheReq(RuleInfo{
Id: 21,
Phone: "13247173568",
UserName: "gr24616919",
IdCard: "",
DeviceId: "device_id1",
LongId: "long_id1",
IsVirtual: 0,
EndTime: "2029-01-01",
})
resp, err := client.CreateAddBanRuleCacheReq(req)
if err != nil {
panic(err)
}
fmt.Println(resp.Code, resp.Msg, resp.Data)
}
// 删除封禁规则
func TestRemoveBanRuleCache(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
infos := []RuleInfo{{
Id: 21,
Phone: "13247173568",
UserName: "gr24616919",
IdCard: "",
DeviceId: "device_id1",
LongId: "long_id1",
IsVirtual: 0,
EndTime: "2029-01-01",
}}
req := CreateRemoveBanRuleCacheReq(RemoveBanRuleCacheReqParam{Rules: infos})
resp, err := client.CreateRemoveBanRuleCacheReq(req)
if err != nil {
panic(err)
}
fmt.Println(resp.Code, resp.Msg, resp.Data)
}

View File

@ -1,159 +0,0 @@
package userlive
import (
"encoding/json"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
const (
triggerTypeHeartbeat = "heartbeat" // 心跳上报触发
triggerTypeLogin = "login" // 用户登录、注册
)
// BanReq
// 上报用户设备信息,判断是否要踢用户下线
type BanReq struct {
*requests.JsonRequest
}
type BanResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
Ban bool `json:"ban"` // 是否要禁止
BanRuleId int64 `json:"ban_rule_id"` // 命中的封禁规则id
} `json:"data"`
}
type BanReqParam struct {
ActionTime int64 `json:"action_time" form:"action_time"` // 上报时间
TriggerType string `json:"trigger_type" form:"trigger_type"` // 触发类型
Ip string `json:"ip" form:"ip"` // ip
GameId int64 `json:"game_id" form:"game_id"` // 游戏id
UserName string `json:"user_name" form:"user_name"` // 用户名
Uid int64 `json:"uid" form:"uid"` // 用户id
ServerId int64 `json:"server_id" form:"server_id"` // 区服id
RoleId string `json:"role_id" form:"role_id"` // 角色id
BundleId string `json:"bundle_id" form:"bundle_id"` // ios 包名
GameName string `json:"game_name" from:"game_name"` // 应用名
GameVersion string `json:"game_version" from:"game_version"` // 游戏版本
SdkVersion string `json:"sdk_version" from:"sdk_version"` // sdk版本
Os string `json:"os" from:"os"` // 系统
OsVersion string `json:"os_version" from:"os_version"` // 系统版本
InApp string `json:"in_app" from:"in_app"` // 壳包系统,壳包传 如ios、android
Ua string `json:"ua" from:"ua"` // ua
NetworkType string `json:"network_type" from:"network_type"` // 网络类型
IsVirtual string `json:"is_virtual" from:"is_virtual"` // 是否是模拟器字符串01空字符串表示未知
Cpu string `json:"cpu" from:"cpu"` // cpu型号
DeviceModel string `json:"device_model" from:"device_model"` // 设备型号
Baseband string `json:"baseband" from:"baseband"` // 基带信息
Resolution string `json:"resolution" from:"resolution"` // 分辨率
Battery string `json:"battery" from:"battery"` // 电量
LongId string `json:"long_id" form:"long_id"` // 逻辑设备号
OriginImei string `json:"origin_imei" form:"origin_imei"` // imei原值
Imei string `json:"imei" form:"imei"` // 老sdk采集的imei
OriginOaid string `json:"origin_oaid" form:"origin_oaid"` // oaid原值
Oaid string `json:"oaid" form:"oaid"` // 老sdk采集的oaid
AndroidId string `json:"android_id" form:"android_id"` // 安卓id
Idfa string `json:"idfa" form:"idfa"` // idfa
Idfv string `json:"idfv" form:"idfv"` // idfv
DeviceId string `json:"device_id" form:"device_id"` // device_id
}
func CreateBanReq(data BanReqParam) *BanReq {
req := &BanReq{
&requests.JsonRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/user_ban/ban")
req.Method = requests.POST
marshal, _ := json.Marshal(data)
_ = json.Unmarshal(marshal, &req.JsonParams)
return req
}
// CreateBanResp 创建同步开服数据响应
func CreateBanResp() *BanResp {
return &BanResp{
BaseResponse: &responses.BaseResponse{},
}
}
// AddBanRuleCacheReq
// 添加封禁规则缓存
type AddBanRuleCacheReq struct {
*requests.JsonRequest
}
type AddBanRuleCacheResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct{} `json:"data"`
}
type RuleInfo struct {
Id int64 `json:"id"`
Phone string `json:"phone"`
UserName string `json:"user_name"`
IdCard string `json:"id_card"`
DeviceId string `json:"device_id"`
LongId string `json:"long_id"`
IsVirtual int64 `json:"is_virtual"`
EndTime string `json:"end_time"`
}
func CreateAddBanRuleCacheReq(data RuleInfo) *AddBanRuleCacheReq {
req := &AddBanRuleCacheReq{
&requests.JsonRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/user_ban/add_cache")
req.Method = requests.POST
marshal, _ := json.Marshal(data)
_ = json.Unmarshal(marshal, &req.JsonParams)
return req
}
func CreateAddBanRuleCacheResp() *AddBanRuleCacheResp {
return &AddBanRuleCacheResp{
BaseResponse: &responses.BaseResponse{},
}
}
// RemoveBanRuleCacheReq
// 删除封禁规则缓存
type RemoveBanRuleCacheReq struct {
*requests.JsonRequest
}
type RemoveBanRuleCacheReqParam struct {
Rules []RuleInfo `json:"rules"`
}
type RemoveBanRuleCacheResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct{} `json:"data"`
}
func CreateRemoveBanRuleCacheReq(param RemoveBanRuleCacheReqParam) *RemoveBanRuleCacheReq {
req := &RemoveBanRuleCacheReq{
&requests.JsonRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/user_ban/remove_cache")
req.Method = requests.POST
marshal, _ := json.Marshal(param)
_ = json.Unmarshal(marshal, &req.JsonParams)
return req
}
func CreateRemoveBanRuleCacheResp() *RemoveBanRuleCacheResp {
return &RemoveBanRuleCacheResp{
BaseResponse: &responses.BaseResponse{},
}
}