Unverified Commit d15b8660 authored by Zane's avatar Zane Committed by GitHub

Added task saving interface parameter verification to facilitate troubleshooting…

Added task saving interface parameter verification to facilitate troubleshooting abnormal missing parameters. (#3602) Co-authored-by: 's avatarGH Action - Upstream Sync <action@github.com> Co-authored-by: 's avatarZzm0809 <934230207@qq.com>
parent 62eda7f3
...@@ -41,10 +41,12 @@ import org.dinky.data.result.SqlExplainResult; ...@@ -41,10 +41,12 @@ import org.dinky.data.result.SqlExplainResult;
import org.dinky.gateway.enums.SavePointType; import org.dinky.gateway.enums.SavePointType;
import org.dinky.gateway.result.SavePointResult; import org.dinky.gateway.result.SavePointResult;
import org.dinky.job.JobResult; import org.dinky.job.JobResult;
import org.dinky.mybatis.annotation.Save;
import org.dinky.service.TaskService; import org.dinky.service.TaskService;
import java.util.List; import java.util.List;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
...@@ -191,7 +193,7 @@ public class TaskController { ...@@ -191,7 +193,7 @@ public class TaskController {
paramType = "body", paramType = "body",
dataTypeClass = TaskSaveDTO.class) dataTypeClass = TaskSaveDTO.class)
@CheckTaskOwner(checkParam = TaskId.class, checkInterface = TaskService.class) @CheckTaskOwner(checkParam = TaskId.class, checkInterface = TaskService.class)
public Result<Void> saveOrUpdateTask(@RequestBody TaskSaveDTO task) { public Result<Void> saveOrUpdateTask(@Validated({Save.class}) @RequestBody TaskSaveDTO task) {
if (taskService.saveOrUpdateTask(task.toTaskEntity())) { if (taskService.saveOrUpdateTask(task.toTaskEntity())) {
return Result.succeed(Status.SAVE_SUCCESS); return Result.succeed(Status.SAVE_SUCCESS);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment