job
This commit is contained in:
@@ -1,7 +1,29 @@
|
||||
package controllers
|
||||
|
||||
import "github.com/astaxie/beego"
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type JobController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
// @Title 发布任务
|
||||
// @Description 发布任务
|
||||
// @Param token header string true "认证token"
|
||||
// @Param payload formData string true "job+step 类型"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /PublishJob [post]
|
||||
func (c *JobController) PublishJob() {
|
||||
c.callPublishJob(func(params *tJobPublishJobParams) (retVal interface{}, errCode string, err error) {
|
||||
var job *model.Job
|
||||
if err = jxutils.Strings2Objs(params.Payload, &job); err == nil {
|
||||
err = cms.PublishJob(params.Ctx, job)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user