浏览代码

视频列表 add 的时候 api 返回值新增 job id ,便于后续再次发送命令去改变任务状态

Signed-off-by: allan716 <[email protected]>
allan716 3 年之前
父节点
当前提交
fd5dad2b00
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      internal/backend/controllers/v1/video_list.go

+ 6 - 3
internal/backend/controllers/v1/video_list.go

@@ -3,13 +3,14 @@ package v1
 import (
 	"errors"
 	"fmt"
+	"net/http"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/internal/pkg/video_scan_and_refresh_helper"
 	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
 	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	TTaskqueue "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/gin-gonic/gin"
-	"net/http"
 )
 
 func (cb *ControllerBase) RefreshVideoListStatusHandler(c *gin.Context) {
@@ -128,11 +129,13 @@ func (cb *ControllerBase) VideoListAddHandler(c *gin.Context) {
 		return
 	}
 	if bok == false {
-		c.JSON(http.StatusOK, backend.ReplyCommon{
+		c.JSON(http.StatusOK, backend.ReplyJobThings{
+			JobID:   oneJob.Id,
 			Message: "job is already in queue",
 		})
 	} else {
-		c.JSON(http.StatusOK, backend.ReplyCommon{
+		c.JSON(http.StatusOK, backend.ReplyJobThings{
+			JobID:   oneJob.Id,
 			Message: "ok",
 		})
 	}