| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/user") |
| | | @Api(value = "app用户",tags = "app用户操作控制器") |
| | | @Slf4j |
| | | public class AppUserController { |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TokenBlacklistService blacklistService; |
| | | @GetMapping("/test") |
| | | /* @GetMapping("/test") |
| | | @ApiOperation(value = "登出" ,tags = "app用户端") |
| | | public R<Void> test(@RequestHeader("Authorization") String token) { |
| | | throw new ServiceException("测试"); |
| | | |
| | | } |
| | | }*/ |
| | | /** |
| | | * 登出 |
| | | */ |
| | |
| | | * 手机号验证码登录 |
| | | */ |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录",tags = "app用户端") |
| | | @ApiOperation(value = "手机号登录",tags = "app用户端",notes = "手机号:19923261698 如果不存在,即帮忙注册,需要传jscode") |
| | | public R<LoginVO> mobileLogin(@RequestBody @Valid MobileLoginDTO mobileLogin) { |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | |
| | |
| | | */ |
| | | @PostMapping("/register") |
| | | @ApiOperation(value = "注册",tags = "app用户端") |
| | | public R<Void> register(@RequestBody @Valid RegisterDTO registerDTO) { |
| | | appUserService.register(registerDTO); |
| | | return R.ok(); |
| | | public R<LoginVO> register(@RequestBody @Valid RegisterDTO registerDTO) { |
| | | |
| | | return R.ok( appUserService.register(registerDTO)); |
| | | } |
| | | /** |
| | | * 根据小区id(可选择) |
| | |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 修改姓名 |
| | | */ |
| | | @PutMapping("/setName") |
| | | @ApiOperation(value = "修改姓名",tags = "app用户端-个人信息") |
| | | public R<Void> setName(@RequestParam String name) { |
| | | appUserService.setName(name); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 修改头像 |
| | | */ |
| | | @PutMapping("/setAvatar") |
| | | @ApiOperation(value = "修改头像",tags = "app用户端-个人信息") |
| | | public R<Void> setAvatar(@RequestParam String avatar) { |
| | | appUserService.setAvatar(avatar); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 修改生日 |
| | | */ |
| | | @PutMapping("/setBirthDay") |
| | |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "注销账号",tags = "app用户端-个人信息") |
| | | public R<Void> delete() { |
| | | appUserService.delete(); |
| | | public R<Void> delete(@RequestHeader("Authorization") String token) { |
| | | appUserService.delete(token); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/detail") |
| | | @PreAuthorize("@ss.hasPermi('system:appuser:list')") |
| | | @ApiOperation(value = "用户管理-用户详情", tags = "系统后台-用户管理") |
| | | public R<AppUserSysDetailVO> detail(@RequestParam("id") Integer id) { |
| | | public R<AppUserSysDetailVO> detail(@RequestParam("id") String id) { |
| | | return R.ok(appUserService.detail(id)); |
| | | } |
| | | /** |
| | |
| | | @PutMapping("/froze") |
| | | @PreAuthorize("@ss.hasPermi('system:appuser:list')") |
| | | @ApiOperation(value = "用户管理-冻结/解冻", tags = "系统后台-用户管理") |
| | | public R froze(@RequestParam("id") Integer id) { |
| | | public R froze(@RequestParam("id") String id) { |
| | | appUserService.froze(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | @GetMapping("/refund") |
| | | @PreAuthorize("@ss.hasPermi('system:appuser:list')") |
| | | @ApiOperation(value = "用户管理-会员退费", tags = "系统后台-用户管理") |
| | | public R<Void> refund(@RequestParam("id") Integer id) { |
| | | public R<Void> refund(@RequestParam("id") String id) { |
| | | appUserService.refund(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 订单取消支付回退 |
| | | * |
| | | * @param refundCallbackResult |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/refundPayMoneyCallback") |
| | | public void refundPayMoneyCallback(RefundCallbackResult refundCallbackResult, HttpServletResponse response) { |
| | | R callback = appUserService.refundPayMoneyCallback(refundCallbackResult); |
| | | @PostMapping("/refundPayMoneyCallback") |
| | | public String refundPayMoneyCallback(@RequestBody(required = false) String xmlData) { |
| | | System.out.println("会员退费:" + xmlData); |
| | | R callback = appUserService.refundPayMoneyCallback(xmlData); |
| | | if (callback.getCode() == 200) { |
| | | response.setStatus(200); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | out.println("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"; |
| | | }else { |
| | | System.err.println("支付回退错误:"+callback.getMsg()); |
| | | return "<xml><return_code><![CDATA[FAIL]]></return_code></xml>"; |
| | | } |
| | | } |
| | | |