feat: add redis gateway protection and task recovery

This commit is contained in:
wlx committed 2026-09-08 18:02:45 +08:00
1 parent cbc7317aa8
commit 473479fc4c
17 files changed
+272 -10

No files matched your search

@@ -0,0 +1,29 @@
package com.moyi.controlplane.task;
import com.moyi.controlplane.auth.AuthController;
import com.moyi.controlplane.auth.AuthService;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/tasks")
public class SessionTaskController {
private final AsyncTaskService tasks;
private final AuthService auth;
public SessionTaskController(AsyncTaskService tasks, AuthService auth) {
this.tasks = tasks;
this.auth = auth;
}
@GetMapping
public Map<String, Object> list(
jakarta.servlet.http.HttpServletRequest request,
@RequestParam(defaultValue = "50") int limit
) {
return Map.of("tasks", tasks.listForUser(AuthController.sessionToken(request), auth, limit));
}
}