|
|
|
@@ -18,15 +18,17 @@ import ( |
|
|
|
|
|
|
|
type ScheduleCreateTaskLogic struct { |
|
|
|
logx.Logger |
|
|
|
ctx context.Context |
|
|
|
svcCtx *svc.ServiceContext |
|
|
|
ctx context.Context |
|
|
|
svcCtx *svc.ServiceContext |
|
|
|
queryResource *QueryResourcesLogic |
|
|
|
} |
|
|
|
|
|
|
|
func NewScheduleCreateTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ScheduleCreateTaskLogic { |
|
|
|
return &ScheduleCreateTaskLogic{ |
|
|
|
Logger: logx.WithContext(ctx), |
|
|
|
ctx: ctx, |
|
|
|
svcCtx: svcCtx, |
|
|
|
Logger: logx.WithContext(ctx), |
|
|
|
ctx: ctx, |
|
|
|
svcCtx: svcCtx, |
|
|
|
queryResource: NewQueryResourcesLogic(ctx, svcCtx), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -77,6 +79,10 @@ func (l *ScheduleCreateTaskLogic) ScheduleCreateTask(req *types.CreateTaskReq) ( |
|
|
|
} |
|
|
|
|
|
|
|
if len(req.Resources) != 0 { |
|
|
|
_, err := l.queryResource.QueryResources(&types.QueryResourcesReq{AdapterId: req.AdapterId}) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
return |
|
|
|
|