feat: status constant define
This commit is contained in:
@@ -111,7 +111,7 @@ func (dc *DashboardController) GetSendStats(c *gin.Context) {
|
||||
}
|
||||
ds := dayMap[s.Day]
|
||||
ds.Total += s.Num
|
||||
if s.Status == "success" {
|
||||
if s.Status == constant.TaskStatusSuccess {
|
||||
ds.Success += s.Num
|
||||
} else {
|
||||
ds.Failed += s.Num
|
||||
|
||||
@@ -69,7 +69,7 @@ func (tc *TaskController) CreateTask(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 普通任务需要命令
|
||||
if req.Type != "repo" && req.Command == "" {
|
||||
if req.Type != constant.TaskTypeRepo && req.Command == "" {
|
||||
utils.BadRequest(c, "命令不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user