From e4989d361698a4cb7a2281e948e70410a265381c Mon Sep 17 00:00:00 2001 From: linck Date: Fri, 5 Nov 2021 17:47:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=EF=BC=8C=E4=BF=9D=E6=8C=81=E7=BB=9F=E4=B8=80=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pig/admin/api/feign/RemoteUserService.java | 4 ++-- .../fallback/RemoteUserServiceFallbackImpl.java | 4 ++-- .../pig/admin/controller/AppController.java | 8 ++++---- .../controller/OauthClientDetailsController.java | 2 +- .../pig/admin/service/AppServiceImpl.java | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java index 929fa708..8b518f84 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java @@ -53,8 +53,8 @@ public interface RemoteUserService { * @param from 调用标志 * @return R */ - @GetMapping("/app/info/{mobile}") - R infoByMobile(@PathVariable("mobile") String mobile, @RequestHeader(SecurityConstants.FROM) String from); + @GetMapping("/app/info/{phone}") + R infoByMobile(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM) String from); /** * 根据部门id,查询对应的用户 id 集合 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/fallback/RemoteUserServiceFallbackImpl.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/fallback/RemoteUserServiceFallbackImpl.java index 4e70ccc5..0110ac8f 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/fallback/RemoteUserServiceFallbackImpl.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/fallback/RemoteUserServiceFallbackImpl.java @@ -56,8 +56,8 @@ public class RemoteUserServiceFallbackImpl implements RemoteUserService { * @return R */ @Override - public R infoByMobile(String mobile, String from) { - log.error("feign 查询用户信息失败手机号码:{}", mobile, cause); + public R infoByMobile(String phone, String from) { + log.error("feign 查询用户信息失败手机号码:{}", phone, cause); return null; } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/AppController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/AppController.java index f550948b..e1f005c6 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/AppController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/AppController.java @@ -39,11 +39,11 @@ public class AppController { * @return 用户信息 */ @Inner - @GetMapping("/info/{mobile}") - public R infoByMobile(@PathVariable String mobile) { - SysUser user = userService.getOne(Wrappers.query().lambda().eq(SysUser::getPhone, mobile)); + @GetMapping("/info/{phone}") + public R infoByMobile(@PathVariable String phone) { + SysUser user = userService.getOne(Wrappers.query().lambda().eq(SysUser::getPhone, phone)); if (user == null) { - return R.failed(String.format("用户信息为空 %s", mobile)); + return R.failed(String.format("用户信息为空 %s", phone)); } return R.ok(userService.getUserInfo(user)); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/OauthClientDetailsController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/OauthClientDetailsController.java index 370c1609..dead8ee1 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/OauthClientDetailsController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/OauthClientDetailsController.java @@ -47,7 +47,7 @@ public class OauthClientDetailsController { /** * 通过ID查询 - * @param id clientId + * @param clientId 客户端id * @return SysOauthClientDetails */ @GetMapping("/{clientId}") diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/AppServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/AppServiceImpl.java index 2c044471..cade5f61 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/AppServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/AppServiceImpl.java @@ -50,29 +50,29 @@ public class AppServiceImpl implements AppService { /** * 发送手机验证码 TODO: 调用短信网关发送验证码,测试返回前端 - * @param mobile mobile + * @param phone 手机号 * @return code */ @Override - public R sendSmsCode(String mobile) { + public R sendSmsCode(String phone) { List userList = userMapper - .selectList(Wrappers.query().lambda().eq(SysUser::getPhone, mobile)); + .selectList(Wrappers.query().lambda().eq(SysUser::getPhone, phone)); if (CollUtil.isEmpty(userList)) { - log.info("手机号未注册:{}", mobile); + log.info("手机号未注册:{}", phone); return R.ok(Boolean.FALSE, "手机号未注册"); } - Object codeObj = redisTemplate.opsForValue().get(CacheConstants.DEFAULT_CODE_KEY + mobile); + Object codeObj = redisTemplate.opsForValue().get(CacheConstants.DEFAULT_CODE_KEY + phone); if (codeObj != null) { - log.info("手机号验证码未过期:{},{}", mobile, codeObj); + log.info("手机号验证码未过期:{},{}", phone, codeObj); return R.ok(Boolean.FALSE, "验证码发送过频繁"); } String code = RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE)); - log.info("手机号生成验证码成功:{},{}", mobile, code); - redisTemplate.opsForValue().set(CacheConstants.DEFAULT_CODE_KEY + mobile, code, SecurityConstants.CODE_TIME, + log.info("手机号生成验证码成功:{},{}", phone, code); + redisTemplate.opsForValue().set(CacheConstants.DEFAULT_CODE_KEY + phone, code, SecurityConstants.CODE_TIME, TimeUnit.SECONDS); return R.ok(Boolean.TRUE, code); }