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