job submit
This commit is contained in:
@@ -30,6 +30,20 @@ func (c *JobController) PublishJob() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户取消发布的任务
|
||||
// @Description 用户取消发布的任务
|
||||
// @Param token header string true "认证token"
|
||||
// @Param jobID formData int true "jobID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /CancelPublishJob [post]
|
||||
func (c *JobController) CancelPublishJob() {
|
||||
c.callCancelPublishJob(func(params *tJobCancelPublishJobParams) (retVal interface{}, errCode string, err error) {
|
||||
err = cms.CancelPublishJob(params.Ctx, params.JobID)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查看任务类型
|
||||
// @Description 查看任务类型
|
||||
// @Param token header string true "认证token"
|
||||
@@ -100,6 +114,21 @@ func (c *JobController) AcceptJob() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户取消接受的任务
|
||||
// @Description 用户取消接受的任务
|
||||
// @Param token header string true "认证token"
|
||||
// @Param jobID formData int true "jobID"
|
||||
// @Param jobOrderID formData int true "jobOrderID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /CancelAcceptJob [post]
|
||||
func (c *JobController) CancelAcceptJob() {
|
||||
c.callCancelAcceptJob(func(params *tJobCancelAcceptJobParams) (retVal interface{}, errCode string, err error) {
|
||||
err = cms.CancelAcceptJob(params.Ctx, params.JobID, int64(params.JobOrderID))
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查看接受的任务列表
|
||||
// @Description 查看接受的任务列表
|
||||
// @Param token header string true "认证token"
|
||||
@@ -124,3 +153,20 @@ func (c *JobController) GetJobOrders() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 提交任务
|
||||
// @Description 提交任务
|
||||
// @Param token header string true "认证token"
|
||||
// @Param payload formData string true "joborder type"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SubmitJob [post]
|
||||
func (c *JobController) SubmitJob() {
|
||||
c.callSubmitJob(func(params *tJobSubmitJobParams) (retVal interface{}, errCode string, err error) {
|
||||
var jobOrder *model.JobOrder
|
||||
if err = jxutils.Strings2Objs(params.Payload, &jobOrder); err == nil {
|
||||
err = cms.SubmitJob(params.Ctx, jobOrder)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user