兼容无token下拉取任务列表
This commit is contained in:
@@ -28,8 +28,8 @@ func NewGetTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTa
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetTaskListLogic) GetTaskList(req *types.GetTaskListReq) (*types.GetTaskListResp, error) {
|
||||
uid := cast.ToStringMapInt(l.ctx.Value("data"))["id"]
|
||||
func (l *GetTaskListLogic) GetTaskList(uid int, req *types.GetTaskListReq) (*types.GetTaskListResp, error) {
|
||||
//uid := cast.ToStringMapInt(l.ctx.Value("data"))["id"]
|
||||
tasks, err := l.svcCtx.TaskModel.FindTasksByCommunity(l.ctx, req.CommunityId)
|
||||
if err != nil {
|
||||
l.Errorw("get task list failed", logx.Field("err", err), logx.Field("communityId", req.CommunityId))
|
||||
@@ -43,10 +43,13 @@ func (l *GetTaskListLogic) GetTaskList(req *types.GetTaskListReq) (*types.GetTas
|
||||
taskSeq = cast.ToInt(time.Now().Format("20060102"))
|
||||
}
|
||||
var finishState int8
|
||||
tp, err := l.svcCtx.TaskProgressModel.FindOneByUidTaskIdTaskSeq(l.ctx, uid, t.CommunityId, taskSeq)
|
||||
if err == nil {
|
||||
finishState = tp.Stage
|
||||
if uid > 0 {
|
||||
tp, err := l.svcCtx.TaskProgressModel.FindOneByUidTaskIdTaskSeq(l.ctx, uid, t.CommunityId, taskSeq)
|
||||
if err == nil {
|
||||
finishState = tp.Stage
|
||||
}
|
||||
}
|
||||
|
||||
resp.Tasks = append(resp.Tasks, types.Task{
|
||||
Id: t.Id,
|
||||
Title: t.Title,
|
||||
|
||||
Reference in New Issue
Block a user