2025-09-18 08:54:29 +08:00
|
|
|
package com.fuyuanshen.app.controller;
|
|
|
|
|
|
|
|
|
|
import com.fuyuanshen.app.model.AppRegisterBody;
|
2025-09-18 15:25:32 +08:00
|
|
|
import com.fuyuanshen.app.model.AppUpdatePasswordBody;
|
2025-09-18 08:54:29 +08:00
|
|
|
import com.fuyuanshen.app.service.AppLoginService;
|
|
|
|
|
import com.fuyuanshen.app.service.AppRegisterService;
|
|
|
|
|
import com.fuyuanshen.common.core.domain.R;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* APP我的
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/app/userCenter")
|
|
|
|
|
public class AppUserCenterController {
|
|
|
|
|
|
|
|
|
|
private final AppLoginService loginService;
|
|
|
|
|
private final AppRegisterService registerService;
|
|
|
|
|
/**
|
|
|
|
|
* 用户注销
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/cancelAccount")
|
|
|
|
|
public R<Void> cancelAccount() {
|
|
|
|
|
loginService.cancelAccount();
|
|
|
|
|
return R.ok("用户注销成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改密码
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/updatePassword")
|
2025-09-18 15:25:32 +08:00
|
|
|
public R<Void> updatePassword(@Validated @RequestBody AppUpdatePasswordBody body) {
|
2025-09-18 08:54:29 +08:00
|
|
|
registerService.updatePassword(body);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 退出登录
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/logout")
|
|
|
|
|
public R<Void> logout() {
|
|
|
|
|
loginService.logout();
|
|
|
|
|
return R.ok("退出成功");
|
|
|
|
|
}
|
|
|
|
|
}
|