|
|
@@ -90,11 +90,12 @@ public class FamilyUserController {
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "切换家长/孩子模式(已废弃,使用 /api/family/member/switch)")
|
|
|
+ @Deprecated
|
|
|
@PostMapping("/switch-mode")
|
|
|
public Result<String> switchMode(@RequestAttribute("userId") Long userId,
|
|
|
- @RequestBody Map<String, String> body) {
|
|
|
+ @RequestBody Map<String, String> body) {
|
|
|
return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
@Operation(summary = "切换用户角色 (支持 parent/child/teacher)")
|
|
|
@PostMapping("/switch-role")
|
|
|
@@ -116,36 +117,27 @@ public class FamilyUserController {
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "家长切换到指定孩子身份(已废弃,使用 /api/family/member/switch)")
|
|
|
+ @Deprecated
|
|
|
@PostMapping("/switch-to-child")
|
|
|
public Result<Long> switchToFamilyMember(@RequestAttribute("userId") Long userId,
|
|
|
@RequestBody Map<String, Long> body) {
|
|
|
return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
}
|
|
|
|
|
|
- @Operation(summary = "孩子切换回家长身份")
|
|
|
+ @Operation(summary = "孩子切换回家长身份(已废弃,使用 /api/family/member/switch)")
|
|
|
+ @Deprecated
|
|
|
@PostMapping("/switch-back-to-parent")
|
|
|
public Result<Boolean> switchBackToParent(@RequestAttribute("userId") Long userId) {
|
|
|
- boolean result = userService.switchBackToParent(userId);
|
|
|
- return Result.success(result);
|
|
|
+ return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
}
|
|
|
|
|
|
- @Operation(summary = "带密码校验切换回家长视角")
|
|
|
+ @Operation(summary = "带密码校验切换回家长视角(已废弃,使用 /api/family/member/switch)")
|
|
|
+ @Deprecated
|
|
|
@PostMapping("/switch-back-verify")
|
|
|
public Result<Boolean> switchBackVerify(@RequestAttribute("userId") Long userId,
|
|
|
- @RequestBody Map<String, String> body) {
|
|
|
- if (userId == null) {
|
|
|
- return Result.error("请先登录");
|
|
|
- }
|
|
|
- String password = body.get("password");
|
|
|
- if (password == null || password.isEmpty()) {
|
|
|
- return Result.error("请输入密码");
|
|
|
- }
|
|
|
- boolean verified = userService.verifySwitchBack(userId, password);
|
|
|
- if (!verified) {
|
|
|
- return Result.error("密码错误");
|
|
|
- }
|
|
|
- return Result.success(true);
|
|
|
- }
|
|
|
+ @RequestBody Map<String, String> body) {
|
|
|
+ return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
+ }
|
|
|
|
|
|
@Operation(summary = "创建孩子")
|
|
|
@PostMapping("/children")
|