|
@@ -129,13 +129,14 @@ public class TaskController {
|
|
|
|
|
|
|
|
@Operation(summary = "批量完成任务")
|
|
@Operation(summary = "批量完成任务")
|
|
|
@PostMapping("/batch-complete")
|
|
@PostMapping("/batch-complete")
|
|
|
- public Result<Boolean> batchComplete(@RequestBody Map<String, Object> params) {
|
|
|
|
|
|
|
+ public Result<Boolean> batchComplete(@RequestBody Map<String, Object> params,
|
|
|
|
|
+ @RequestAttribute("userId") Long userId) {
|
|
|
List<Long> taskIds = (List<Long>) params.get("taskIds");
|
|
List<Long> taskIds = (List<Long>) params.get("taskIds");
|
|
|
if (taskIds == null || taskIds.isEmpty()) {
|
|
if (taskIds == null || taskIds.isEmpty()) {
|
|
|
return Result.error("taskIds不能为空");
|
|
return Result.error("taskIds不能为空");
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- taskService.batchComplete(taskIds);
|
|
|
|
|
|
|
+ taskService.batchComplete(taskIds, userId);
|
|
|
return Result.success(true);
|
|
return Result.success(true);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
return Result.error("批量操作失败: " + e.getMessage());
|
|
return Result.error("批量操作失败: " + e.getMessage());
|
|
@@ -144,13 +145,14 @@ public class TaskController {
|
|
|
|
|
|
|
|
@Operation(summary = "批量删除任务")
|
|
@Operation(summary = "批量删除任务")
|
|
|
@PostMapping("/batch-delete")
|
|
@PostMapping("/batch-delete")
|
|
|
- public Result<Boolean> batchDelete(@RequestBody Map<String, Object> params) {
|
|
|
|
|
|
|
+ public Result<Boolean> batchDelete(@RequestBody Map<String, Object> params,
|
|
|
|
|
+ @RequestAttribute("userId") Long userId) {
|
|
|
List<Long> taskIds = (List<Long>) params.get("taskIds");
|
|
List<Long> taskIds = (List<Long>) params.get("taskIds");
|
|
|
if (taskIds == null || taskIds.isEmpty()) {
|
|
if (taskIds == null || taskIds.isEmpty()) {
|
|
|
return Result.error("taskIds不能为空");
|
|
return Result.error("taskIds不能为空");
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- taskService.batchDelete(taskIds);
|
|
|
|
|
|
|
+ taskService.batchDelete(taskIds, userId);
|
|
|
return Result.success(true);
|
|
return Result.success(true);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
return Result.error("批量操作失败: " + e.getMessage());
|
|
return Result.error("批量操作失败: " + e.getMessage());
|