mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-30 00:51:24 +08:00
任务,通知功能完成
This commit is contained in:
6
apps/job/api/from/job.go
Normal file
6
apps/job/api/from/job.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package from
|
||||
|
||||
type JobStatus struct {
|
||||
JobId int64 `json:"jobId"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"pandax/apps/job/api/from"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/jobs"
|
||||
"pandax/apps/job/services"
|
||||
@@ -151,3 +152,20 @@ func (l *JobApi) StartJobForService(rc *ctx.ReqCtx) {
|
||||
}
|
||||
l.JobApp.Update(*job)
|
||||
}
|
||||
|
||||
// @Summary 修改JOB状态
|
||||
// @Description 获取JSON
|
||||
// @Tags 任务
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body from.JobStatus true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /job/changeStatus [put]
|
||||
// @Security X-TOKEN
|
||||
func (l *JobApi) UpdateStatusJob(rc *ctx.ReqCtx) {
|
||||
var job from.JobStatus
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &job)
|
||||
|
||||
l.JobApp.Update(entity.SysJob{JobId: job.JobId, Status: job.Status})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user