fix: handle missing current macro scene

parent 3d4f520d
...@@ -51,7 +51,8 @@ public class MacroSceneController { ...@@ -51,7 +51,8 @@ public class MacroSceneController {
@GetMapping("/current") @GetMapping("/current")
@Operation(summary = "根据用户查询当前主计划场景") @Operation(summary = "根据用户查询当前主计划场景")
public R<MacroSceneConfig> current(@RequestParam String userId) { public R<MacroSceneConfig> current(@RequestParam String userId) {
return R.ok(macroSceneService.getSceneByUserId(userId)); MacroSceneConfig scene = macroSceneService.getSceneByUserId(userId);
return scene == null ? R.ok(null, "error") : R.ok(scene);
} }
@PostMapping("/select") @PostMapping("/select")
......
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