Files
course/backend/src/UoocProgress.Api/Controllers/AdminBrushController.cs
T
nanxunandClaude Fable 5 cd486a36ef feat: UOOC/Zhihuishu dual-platform brushing platform
- ASP.NET Core 9 Web API backend with JWT auth, EF Core MySQL
- Vue 3 + Vite + Pinia + Ant Design Vue frontend
- Multi-platform connection management (UOOC & Zhihuishu)
- Video brushing with AES-CBC encryption for Zhihuishu
- Multi-task queue with cross-platform parallel execution
- Task persistence via MySQL database
- Progress tracking with inline catalog enrichment
- Mobile-responsive UI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-24 15:31:32 +08:00

32 lines
1.0 KiB
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using UoocProgress.Api.Services;
namespace UoocProgress.Api.Controllers;
[ApiController]
[Authorize(Policy = "AdminOnly")]
[Route("api/admin/brush")]
public sealed class AdminBrushController(VideoBrushService brushService) : ControllerBase
{
[HttpGet("tasks")]
public ActionResult<IReadOnlyList<AdminBrushTaskDto>> GetTasks()
=> Ok(brushService.GetAllTasks());
[HttpPost("stop/{userId:long}")]
public IActionResult Stop(long userId) { brushService.AdminStop(userId); return NoContent(); }
[HttpPost("stop-all")]
public IActionResult StopAll() { brushService.StopAll(); return NoContent(); }
[HttpGet("config")]
public ActionResult<BrushSystemConfig> GetConfig() => Ok(brushService.Config);
[HttpPut("config")]
public ActionResult<BrushSystemConfig> UpdateConfig([FromBody] BrushSystemConfig config)
{
brushService.Config.PauseNewTasks = config.PauseNewTasks;
return Ok(brushService.Config);
}
}