调整结构体
This commit is contained in:
@ -26,7 +26,7 @@ type GameTaskConfigParse struct {
|
|||||||
Target string `json:"target"`
|
Target string `json:"target"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type QQNetbarTask struct {
|
type GameTask struct {
|
||||||
RuleDesc string `json:"rule_desc"`
|
RuleDesc string `json:"rule_desc"`
|
||||||
TaskDesc string `json:"task_desc"`
|
TaskDesc string `json:"task_desc"`
|
||||||
LimitPrize int `json:"limit_prize"`
|
LimitPrize int `json:"limit_prize"`
|
||||||
@ -38,13 +38,15 @@ type QQNetbarTask struct {
|
|||||||
CycleEnd int64 `json:"cycle_end"`
|
CycleEnd int64 `json:"cycle_end"`
|
||||||
TargetName string `json:"target_name"`
|
TargetName string `json:"target_name"`
|
||||||
TargetTimes int `json:"target_times"`
|
TargetTimes int `json:"target_times"`
|
||||||
|
Status int `json:"status,omitempty"`
|
||||||
|
UserTimes int `json:"user_times,omitempty"`
|
||||||
GameTaskConfig GameTaskConfig `json:"game_task_config"`
|
GameTaskConfig GameTaskConfig `json:"game_task_config"`
|
||||||
GameTaskConfigParse GameTaskConfigParse `json:"game_task_config_parse"`
|
GameTaskConfigParse GameTaskConfigParse `json:"game_task_config_parse"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type QQNetbarTaskNoLoginResponse struct {
|
type GameTaskResponse struct {
|
||||||
PageIdx string `json:"pageidx"`
|
PageIdx string `json:"pageidx"`
|
||||||
TaskList []QQNetbarTask `json:"task_list"`
|
TaskList []GameTask `json:"task_list"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TaskParam struct {
|
type TaskParam struct {
|
||||||
@ -57,6 +59,6 @@ type TaskParam struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type QQNetbarActivityIn struct {
|
type QQNetbarActivityIn struct {
|
||||||
ServiceName string // 服务名称
|
ServiceName string // 服务名称
|
||||||
TaskParam TaskParam
|
TaskParam TaskParam // 参数体
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import (
|
|||||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||||
_ "server/utility/gamelife"
|
_ "server/utility/gamelife"
|
||||||
_ "server/utility/gametask"
|
|
||||||
_ "server/utility/myCasbin"
|
_ "server/utility/myCasbin"
|
||||||
_ "server/utility/oss/aliyun"
|
_ "server/utility/oss/aliyun"
|
||||||
_ "server/utility/rsa"
|
_ "server/utility/rsa"
|
||||||
|
|||||||
@ -309,11 +309,11 @@ func (s *gamelifeClient) GetBound(ctx context.Context, popenid string) (*model.U
|
|||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *gamelifeClient) RequestNetbarTaskByGameID(ctx context.Context, in *model.QQNetbarActivityIn) (out interface{}, err error) {
|
func (s *gamelifeClient) RequestNetbarTaskByGameID(ctx context.Context, in *model.QQNetbarActivityIn) (interface{}, error) {
|
||||||
client := resty.New()
|
client := resty.New()
|
||||||
switch in.ServiceName {
|
switch in.ServiceName {
|
||||||
case "GetNonloginTaskList":
|
case "GetNonloginTaskList":
|
||||||
result := model.QQNetbarTaskNoLoginResponse{}
|
result := model.GameTaskResponse{}
|
||||||
in.TaskParam.Source = s.PlatId
|
in.TaskParam.Source = s.PlatId
|
||||||
in.TaskParam.BrandId = s.BrandId
|
in.TaskParam.BrandId = s.BrandId
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
@ -322,14 +322,14 @@ func (s *gamelifeClient) RequestNetbarTaskByGameID(ctx context.Context, in *mode
|
|||||||
SetResult(&result).
|
SetResult(&result).
|
||||||
Post(s.taskUrlMap[s.Mode] + "GetNonloginTaskList")
|
Post(s.taskUrlMap[s.Mode] + "GetNonloginTaskList")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = ecode.Fail.Sub("请求出现异常")
|
return nil, ecode.Fail.Sub("请求出现异常")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.IsError() {
|
if resp.IsError() {
|
||||||
err = ecode.Fail.Sub("请求失败")
|
return nil, ecode.Fail.Sub("请求失败")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return &result, nil
|
||||||
|
default:
|
||||||
|
return nil, ecode.Fail.Sub("不支持的任务")
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user