修改用户信息,用户未登录,登录查询游戏任务功能
This commit is contained in:
@ -11,10 +11,9 @@ import (
|
||||
func (c *ControllerV1) GetLoginTaskList(ctx context.Context, req *v1.GetLoginTaskListReq) (res *v1.GetLoginTaskListRes, err error) {
|
||||
out, err := service.Task().GetLoginTaskList(ctx, &model.GetLoginTaskListIn{
|
||||
NetBarAccount: req.NetBarAccount,
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
Num: req.Num,
|
||||
Pageidx: req.Pageidx,
|
||||
Gid: req.Gid,
|
||||
Source: req.Source,
|
||||
BrandId: req.BrandId,
|
||||
})
|
||||
|
||||
|
||||
@ -12,11 +12,13 @@ func (c *ControllerV1) NonLoginTaskList(ctx context.Context, req *v1.NonLoginTas
|
||||
|
||||
out, err := service.Task().GetNonLoginTaskList(ctx, &model.GetNonLoginTaskListIn{
|
||||
NetBarAccount: req.NetBarAccount,
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
Gid: req.Gid,
|
||||
Source: req.Source,
|
||||
BrandId: req.BrandId,
|
||||
//Page: req.Page,
|
||||
//Size: req.Size,
|
||||
Num: req.Num,
|
||||
Pageidx: req.Pageidx,
|
||||
Gid: req.Gid,
|
||||
Source: req.Source,
|
||||
BrandId: req.BrandId,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
@ -13,8 +13,8 @@ func (c *ControllerV1) Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoR
|
||||
|
||||
id := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
out, err := service.User().Info(ctx, &model.UserInfoIn{
|
||||
OpenId: req.OpenId,
|
||||
Id: int(id),
|
||||
//OpenId: req.OpenId,
|
||||
Id: int(id),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@ -141,7 +141,7 @@ func (s *sTask) GetNonLoginTaskList(ctx context.Context, in *model.GetNonLoginTa
|
||||
// 调用外部接口
|
||||
data, err := tencent.GetNonLoginTaskList(ctx, in)
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("调用接口异常")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO 任务列表数据处理
|
||||
|
||||
@ -139,7 +139,7 @@ func (s *sUser) WeChatLogin(ctx context.Context, in *model.WeChatLogin) (out *mo
|
||||
}
|
||||
|
||||
func (s *sUser) Info(ctx context.Context, in *model.UserInfoIn) (out *model.UserInfoOut, err error) {
|
||||
exist, err := dao.Users.Ctx(ctx).Where(do.Users{WxOpenId: in.OpenId, Id: in.Id}).OmitEmptyWhere().Exist()
|
||||
exist, err := dao.Users.Ctx(ctx).Where(do.Users{Id: in.Id}).OmitEmptyWhere().Exist()
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("查找用户失败")
|
||||
}
|
||||
@ -147,7 +147,7 @@ func (s *sUser) Info(ctx context.Context, in *model.UserInfoIn) (out *model.User
|
||||
return nil, ecode.Params.Sub("用户不存在")
|
||||
}
|
||||
var user entity.Users
|
||||
if err := dao.Users.Ctx(ctx).Where(do.Users{WxOpenId: in.OpenId, Id: in.Id}).OmitEmptyWhere().Scan(&user); err != nil {
|
||||
if err := dao.Users.Ctx(ctx).Where(do.Users{Id: in.Id}).OmitEmptyWhere().Scan(&user); err != nil {
|
||||
return nil, ecode.Fail.Sub("查找用户失败")
|
||||
}
|
||||
out = &model.UserInfoOut{
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
package model
|
||||
|
||||
type GetNonLoginTaskListIn struct {
|
||||
NetBarAccount string `json:"netBarAccount"` //网关账号
|
||||
Page int `json:"page"` // 分页索引
|
||||
Size int `json:"size"` // 分页大小
|
||||
Gid int `json:"gid"` // 游戏唯一id
|
||||
Source string `json:"source"` // 不能为空
|
||||
BrandId string `json:"brandId"` // 品牌id(可选)
|
||||
NetBarAccount string `json:"netbar_account"` //网关账号
|
||||
//Page int `json:"page"` // 分页索引
|
||||
//Size int `json:"size"` // 分页大小
|
||||
Pageidx string `json:"pageidx"` // 分页索引
|
||||
Num int `json:"num"` //
|
||||
Gid int `json:"gid"` // 游戏唯一id
|
||||
Source string `json:"source"` // 不能为空
|
||||
BrandId string `json:"brand_id"` // 品牌id(可选)
|
||||
}
|
||||
|
||||
type GetNonLoginTaskListOut struct {
|
||||
@ -17,11 +19,13 @@ type GetNonLoginTaskListOut struct {
|
||||
|
||||
type GetLoginTaskListIn struct {
|
||||
NetBarAccount string `json:"netBarAccount"` //网关账号
|
||||
Page int `json:"page"` // 分页索引
|
||||
Size int `json:"size"` // 分页大小
|
||||
Gid int `json:"gid"` // 游戏唯一id
|
||||
Source string `json:"source"` // 不能为空
|
||||
BrandId string `json:"brandId"` // 品牌id(可选)
|
||||
//Page int `json:"page"` // 分页索引
|
||||
//Size int `json:"size"` // 分页大小
|
||||
Pageidx string `json:"pageidx"` // 分页索引
|
||||
Num int `json:"num"` //
|
||||
Gid int `json:"gid"` // 游戏唯一id
|
||||
Source string `json:"source"` // 不能为空
|
||||
BrandId string `json:"brandId"` // 品牌id(可选)
|
||||
}
|
||||
|
||||
type GetLoginTaskListOut struct {
|
||||
|
||||
@ -69,8 +69,8 @@ type UserLoginOut struct {
|
||||
}
|
||||
|
||||
type UserInfoIn struct {
|
||||
Id int
|
||||
OpenId string
|
||||
Id int
|
||||
//OpenId string
|
||||
}
|
||||
type UserInfoOut struct {
|
||||
Id int64
|
||||
|
||||
Reference in New Issue
Block a user