113 lines
4.8 KiB
Go
113 lines
4.8 KiB
Go
package big_data
|
||
|
||
import (
|
||
"encoding/json"
|
||
|
||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||
)
|
||
|
||
// GetUserProfileParam 用户筛选/圈选查询参数
|
||
type GetUserProfileParam struct {
|
||
UserName []string `json:"user_name"`
|
||
UserName2 []string `json:"user_name2"`
|
||
Uid []string `json:"uid"`
|
||
RoleId []string `json:"role_id"`
|
||
RoleName []string `json:"role_name"`
|
||
RoleNameLike string `json:"role_name_like"`
|
||
LabelId []int `json:"label_id"`
|
||
WeworkTag []string `json:"wework_tag"`
|
||
OrderId []string `json:"order_id"`
|
||
TradeOrderId []string `json:"trade_order_id"`
|
||
GameSign []string `json:"game_sign"`
|
||
GameId []string `json:"game_id"`
|
||
RegisterDate []string `json:"register_date"` // 区间 [开始, 结束]
|
||
LastLoginDate []string `json:"last_login_date"` // 区间 [开始, 结束]
|
||
LastPayDate []string `json:"last_pay_date"` // 区间 [开始, 结束]
|
||
PayAmtAccMin int64 `json:"pay_amt_acc_min"`
|
||
PayAmtAccMax int64 `json:"pay_amt_acc_max"`
|
||
LastPayAmountMin int64 `json:"last_pay_amount_min"`
|
||
LastPayAmountMax int64 `json:"last_pay_amount_max"`
|
||
Page int `json:"page"`
|
||
PageSize int `json:"page_size"`
|
||
XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空
|
||
}
|
||
|
||
// GetUserProfileRequest 用户筛选/圈选查询请求
|
||
type GetUserProfileRequest struct {
|
||
*requests.JsonRequest
|
||
UserName []string `position:"Json" field:"user_name"`
|
||
UserName2 []string `position:"Json" field:"user_name2"`
|
||
Uid []string `position:"Json" field:"uid"`
|
||
RoleId []string `position:"Json" field:"role_id"`
|
||
RoleName []string `position:"Json" field:"role_name"`
|
||
RoleNameLike string `position:"Json" field:"role_name_like"`
|
||
LabelId []int `position:"Json" field:"label_id"`
|
||
WeworkTag []string `position:"Json" field:"wework_tag"`
|
||
OrderId []string `position:"Json" field:"order_id"`
|
||
TradeOrderId []string `position:"Json" field:"trade_order_id"`
|
||
GameSign []string `position:"Json" field:"game_sign"`
|
||
GameId []string `position:"Json" field:"game_id"`
|
||
RegisterDate []string `position:"Json" field:"register_date"`
|
||
LastLoginDate []string `position:"Json" field:"last_login_date"`
|
||
LastPayDate []string `position:"Json" field:"last_pay_date"`
|
||
PayAmtAccMin int64 `position:"Json" field:"pay_amt_acc_min"`
|
||
PayAmtAccMax int64 `position:"Json" field:"pay_amt_acc_max"`
|
||
LastPayAmountMin int64 `position:"Json" field:"last_pay_amount_min"`
|
||
LastPayAmountMax int64 `position:"Json" field:"last_pay_amount_max"`
|
||
Page int `position:"Json" field:"page"`
|
||
PageSize int `position:"Json" field:"page_size"`
|
||
Authorization string `position:"Header" field:"Authorization"`
|
||
XDebug string `position:"Header" field:"x-debug"`
|
||
}
|
||
|
||
// GetUserProfileResponse 用户筛选/圈选查询响应(返回不做处理,data 原样透出)
|
||
type GetUserProfileResponse struct {
|
||
*responses.BaseResponse
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
Data json.RawMessage `json:"data"`
|
||
}
|
||
|
||
// CreateGetUserProfileRequest 创建用户筛选/圈选查询请求
|
||
// token 为 GetToken 返回的 data.token,直接放入 Authorization 头
|
||
func CreateGetUserProfileRequest(token string, param GetUserProfileParam) *GetUserProfileRequest {
|
||
req := &GetUserProfileRequest{
|
||
JsonRequest: &requests.JsonRequest{},
|
||
UserName: param.UserName,
|
||
UserName2: param.UserName2,
|
||
Uid: param.Uid,
|
||
RoleId: param.RoleId,
|
||
RoleName: param.RoleName,
|
||
RoleNameLike: param.RoleNameLike,
|
||
LabelId: param.LabelId,
|
||
WeworkTag: param.WeworkTag,
|
||
OrderId: param.OrderId,
|
||
TradeOrderId: param.TradeOrderId,
|
||
GameSign: param.GameSign,
|
||
GameId: param.GameId,
|
||
RegisterDate: param.RegisterDate,
|
||
LastLoginDate: param.LastLoginDate,
|
||
LastPayDate: param.LastPayDate,
|
||
PayAmtAccMin: param.PayAmtAccMin,
|
||
PayAmtAccMax: param.PayAmtAccMax,
|
||
LastPayAmountMin: param.LastPayAmountMin,
|
||
LastPayAmountMax: param.LastPayAmountMax,
|
||
Page: param.Page,
|
||
PageSize: param.PageSize,
|
||
Authorization: token,
|
||
XDebug: param.XDebug,
|
||
}
|
||
req.InitWithApiInfo(HOST, VERSION, "/api/internal/v1/get_user_profile")
|
||
req.Method = requests.POST
|
||
req.Scheme = requests.HTTPS
|
||
return req
|
||
}
|
||
|
||
// CreateGetUserProfileResponse 创建用户筛选/圈选查询响应
|
||
func CreateGetUserProfileResponse() *GetUserProfileResponse {
|
||
return &GetUserProfileResponse{
|
||
BaseResponse: &responses.BaseResponse{},
|
||
}
|
||
}
|