去掉shiro框架
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.label.controller;
|
||||
|
||||
import com.label.annotation.RequireRole;
|
||||
import com.label.common.auth.TokenPrincipal;
|
||||
import com.label.common.result.Result;
|
||||
import com.label.common.shiro.TokenPrincipal;
|
||||
import com.label.entity.VideoProcessJob;
|
||||
import com.label.service.VideoProcessService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -9,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* POST /api/video/process — 触发视频处理(ADMIN)
|
||||
* GET /api/video/jobs/{jobId} — 查询任务状态(ADMIN)
|
||||
* POST /api/video/jobs/{jobId}/reset — 重置失败任务(ADMIN)
|
||||
* POST /api/video/callback — AI 回调接口(无需认证,已在 TokenFilter 中排除)
|
||||
* POST /api/video/callback — AI 回调接口(无需认证,已在 AuthInterceptor 中排除)
|
||||
*/
|
||||
@Tag(name = "视频处理", description = "视频处理任务创建、查询、重置和回调")
|
||||
@Slf4j
|
||||
@@ -37,7 +37,7 @@ public class VideoController {
|
||||
/** POST /api/video/process — 触发视频处理任务 */
|
||||
@Operation(summary = "触发视频处理任务")
|
||||
@PostMapping("/api/video/process")
|
||||
@RequiresRoles("ADMIN")
|
||||
@RequireRole("ADMIN")
|
||||
public Result<VideoProcessJob> createJob(@RequestBody Map<String, Object> body,
|
||||
HttpServletRequest request) {
|
||||
Object sourceIdVal = body.get("sourceId");
|
||||
@@ -57,7 +57,7 @@ public class VideoController {
|
||||
/** GET /api/video/jobs/{jobId} — 查询视频处理任务 */
|
||||
@Operation(summary = "查询视频处理任务状态")
|
||||
@GetMapping("/api/video/jobs/{jobId}")
|
||||
@RequiresRoles("ADMIN")
|
||||
@RequireRole("ADMIN")
|
||||
public Result<VideoProcessJob> getJob(@PathVariable Long jobId,
|
||||
HttpServletRequest request) {
|
||||
return Result.success(videoProcessService.getJob(jobId, principal(request).getCompanyId()));
|
||||
@@ -66,7 +66,7 @@ public class VideoController {
|
||||
/** POST /api/video/jobs/{jobId}/reset — 管理员重置失败任务 */
|
||||
@Operation(summary = "重置失败的视频处理任务")
|
||||
@PostMapping("/api/video/jobs/{jobId}/reset")
|
||||
@RequiresRoles("ADMIN")
|
||||
@RequireRole("ADMIN")
|
||||
public Result<VideoProcessJob> resetJob(@PathVariable Long jobId,
|
||||
HttpServletRequest request) {
|
||||
return Result.success(videoProcessService.reset(jobId, principal(request).getCompanyId()));
|
||||
@@ -75,7 +75,7 @@ public class VideoController {
|
||||
/**
|
||||
* POST /api/video/callback — AI 服务回调(无需 Bearer Token)。
|
||||
*
|
||||
* 此端点已在 TokenFilter.shouldNotFilter() 中排除认证,
|
||||
* 此端点已在 AuthInterceptor 中排除认证,
|
||||
* 由 AI 服务直接调用,携带 jobId、status、outputPath 等参数。
|
||||
*
|
||||
* Body 示例:
|
||||
|
||||
Reference in New Issue
Block a user