From 01f4d7ed7210ddef3e308b305857db1d22b627f2 Mon Sep 17 00:00:00 2001 From: Odboy Date: Wed, 9 Apr 2025 19:46:43 +0800 Subject: [PATCH] =?UTF-8?q?upd:=20=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/system/rest/CaptchaController.java | 8 ++++---- .../application/system/rest/UserController.java | 2 +- .../application/tools/rest/EmailController.java | 4 ++-- .../tools/rest/LocalStorageController.java | 6 +++--- .../application/tools/rest/QiniuController.java | 12 ++++++------ .../application/tools/service/CaptchaService.java | 4 ++-- .../application/tools/service/EmailService.java | 6 +++--- .../tools/service/LocalStorageService.java | 6 +++--- .../tools/service/QiNiuConfigService.java | 6 +++--- .../tools/service/QiniuContentService.java | 8 ++++---- .../tools/service/impl/CaptchaServiceImpl.java | 4 ++-- .../tools/service/impl/EmailServiceImpl.java | 12 ++++++------ .../service/impl/LocalStorageServiceImpl.java | 6 +++--- .../tools/service/impl/QiNiuConfigServiceImpl.java | 6 +++--- .../service/impl/QiniuContentServiceImpl.java | 14 +++++++------- 15 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/CaptchaController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/CaptchaController.java index 7e27f751..3993607d 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/CaptchaController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/CaptchaController.java @@ -31,14 +31,14 @@ public class CaptchaController { @ApiOperation("重置邮箱,发送验证码") @PostMapping(value = "/sendResetEmailCaptcha") public ResponseEntity sendResetEmailCaptcha(@RequestParam String email) { - emailService.sendCaptcha(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey()); + emailService.sendEmailCaptcha(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey()); return new ResponseEntity<>(HttpStatus.OK); } @ApiOperation("重置密码,发送验证码") @PostMapping(value = "/sendResetPasswordCaptcha") public ResponseEntity sendResetPasswordCaptcha(@RequestParam String email) { - emailService.sendCaptcha(email, CodeEnum.EMAIL_RESET_PWD_CODE.getKey()); + emailService.sendEmailCaptcha(email, CodeEnum.EMAIL_RESET_PWD_CODE.getKey()); return new ResponseEntity<>(HttpStatus.OK); } @@ -48,10 +48,10 @@ public class CaptchaController { CodeBiEnum biEnum = CodeBiEnum.find(codeBi); switch (Objects.requireNonNull(biEnum)) { case ONE: - captchaService.checkCode(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey(), email, code); + captchaService.checkCodeAvailable(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey(), email, code); break; case TWO: - captchaService.checkCode(CodeEnum.EMAIL_RESET_PWD_CODE.getKey(), email, code); + captchaService.checkCodeAvailable(CodeEnum.EMAIL_RESET_PWD_CODE.getKey(), email, code); break; default: break; diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java index f1d9c509..ad05f40e 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java @@ -179,7 +179,7 @@ public class UserController { if (!passwordEncoder.matches(password, user.getPassword())) { throw new BadRequestException("密码错误"); } - verificationCodeService.checkCode(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey(), resources.getEmail(), code); + verificationCodeService.checkCodeAvailable(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey(), resources.getEmail(), code); userService.updateEmailByUsername(user.getUsername(), resources.getEmail()); return new ResponseEntity<>(HttpStatus.OK); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/EmailController.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/EmailController.java index 8bce4f1b..28b7b736 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/EmailController.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/EmailController.java @@ -27,13 +27,13 @@ public class EmailController { @ApiOperation("查询配置") @PostMapping(value = "/queryEmailConfig") public ResponseEntity queryEmailConfig() { - return new ResponseEntity<>(emailService.getEmailConfig(), HttpStatus.OK); + return new ResponseEntity<>(emailService.describeEmailConfig(), HttpStatus.OK); } @ApiOperation("配置邮件") @PostMapping(value = "/updateEmailConfig") public ResponseEntity updateEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception { - emailService.updateEmailConfigOnPassChange(emailConfig); + emailService.modifyEmailConfigOnPassChange(emailConfig); return new ResponseEntity<>(HttpStatus.OK); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/LocalStorageController.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/LocalStorageController.java index e77764cc..b16c0e60 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/LocalStorageController.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/LocalStorageController.java @@ -39,14 +39,14 @@ public class LocalStorageController { @PreAuthorize("@el.check('storage:list')") public ResponseEntity> queryFile(QueryLocalStorageRequest criteria) { Page page = new Page<>(criteria.getPage(), criteria.getSize()); - return new ResponseEntity<>(localStorageService.queryLocalStoragePage(criteria, page), HttpStatus.OK); + return new ResponseEntity<>(localStorageService.describeLocalStoragePage(criteria, page), HttpStatus.OK); } @ApiOperation("导出数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('storage:list')") public void exportFile(HttpServletResponse response, QueryLocalStorageRequest criteria) throws IOException { - localStorageService.downloadExcel(localStorageService.selectLocalStorageByCriteria(criteria), response); + localStorageService.downloadExcel(localStorageService.describeLocalStorageList(criteria), response); } @ApiOperation("上传文件") @@ -73,7 +73,7 @@ public class LocalStorageController { @PutMapping @PreAuthorize("@el.check('storage:edit')") public ResponseEntity updateFile(@Validated @RequestBody LocalStorage resources) { - localStorageService.updateLocalStorageById(resources); + localStorageService.modifyLocalStorageById(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/QiniuController.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/QiniuController.java index fc324507..cbddc1fe 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/QiniuController.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/rest/QiniuController.java @@ -43,28 +43,28 @@ public class QiniuController { @ApiOperation("查询七牛云存储配置") @PostMapping(value = "/queryQiNiuConfig") public ResponseEntity queryQiNiuConfig() { - return new ResponseEntity<>(qiNiuConfigService.getConfig(), HttpStatus.OK); + return new ResponseEntity<>(qiNiuConfigService.describeQiniuConfig(), HttpStatus.OK); } @ApiOperation("配置七牛云存储") @PostMapping(value = "/updateQiNiuConfig") public ResponseEntity updateQiNiuConfig(@Validated @RequestBody QiniuConfig qiniuConfig) { - qiNiuConfigService.saveConfig(qiniuConfig); - qiNiuConfigService.updateType(qiniuConfig.getType()); + qiNiuConfigService.saveQiniuConfig(qiniuConfig); + qiNiuConfigService.modifyQiniuConfigType(qiniuConfig.getType()); return new ResponseEntity<>(HttpStatus.OK); } @ApiOperation("导出数据") @GetMapping(value = "/download") public void exportQiNiu(HttpServletResponse response, QueryQiniuRequest criteria) throws IOException { - qiniuContentService.downloadExcel(qiniuContentService.selectQiniuContentByCriteria(criteria), response); + qiniuContentService.downloadExcel(qiniuContentService.describeQiniuContentList(criteria), response); } @ApiOperation("查询文件") @GetMapping public ResponseEntity> queryQiNiu(QueryQiniuRequest criteria) { Page page = new Page<>(criteria.getPage(), criteria.getSize()); - return new ResponseEntity<>(qiniuContentService.queryQiniuContentPage(criteria, page), HttpStatus.OK); + return new ResponseEntity<>(qiniuContentService.describeQiniuContentPage(criteria, page), HttpStatus.OK); } @ApiOperation("上传文件") @@ -89,7 +89,7 @@ public class QiniuController { @GetMapping(value = "/download/{id}") public ResponseEntity downloadQiNiu(@PathVariable Long id) { Map map = new HashMap<>(1); - map.put("url", qiniuContentService.download(qiniuContentService.getById(id))); + map.put("url", qiniuContentService.createFilePreviewUrl(qiniuContentService.getById(id))); return new ResponseEntity<>(map, HttpStatus.OK); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/CaptchaService.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/CaptchaService.java index 62351ca6..f1c9e130 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/CaptchaService.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/CaptchaService.java @@ -11,7 +11,7 @@ public interface CaptchaService { * @param key / * @return / */ - SendEmailRequest renderCode(String email, String key); + SendEmailRequest renderCodeTemplate(String email, String key); /** @@ -20,5 +20,5 @@ public interface CaptchaService { * @param code / * @param key / */ - void checkCode(String key, String email, String code); + void checkCodeAvailable(String key, String email, String code); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/EmailService.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/EmailService.java index 560e308b..de81d3cd 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/EmailService.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/EmailService.java @@ -14,14 +14,14 @@ public interface EmailService extends IService { * @return / * @throws Exception / */ - void updateEmailConfigOnPassChange(EmailConfig emailConfig) throws Exception; + void modifyEmailConfigOnPassChange(EmailConfig emailConfig) throws Exception; /** * 查询配置 * * @return EmailConfig 邮件配置 */ - EmailConfig getEmailConfig(); + EmailConfig describeEmailConfig(); /** * 发送邮件 @@ -36,5 +36,5 @@ public interface EmailService extends IService { * @param email 邮箱地址 * @param key 类型 */ - void sendCaptcha(String email, String key); + void sendEmailCaptcha(String email, String key); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/LocalStorageService.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/LocalStorageService.java index be548a50..0c83d2f4 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/LocalStorageService.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/LocalStorageService.java @@ -20,7 +20,7 @@ public interface LocalStorageService extends IService { * @param page 分页参数 * @return / */ - PageResult queryLocalStoragePage(QueryLocalStorageRequest criteria, Page page); + PageResult describeLocalStoragePage(QueryLocalStorageRequest criteria, Page page); /** * 查询全部数据 @@ -28,7 +28,7 @@ public interface LocalStorageService extends IService { * @param criteria 条件 * @return / */ - List selectLocalStorageByCriteria(QueryLocalStorageRequest criteria); + List describeLocalStorageList(QueryLocalStorageRequest criteria); /** * 上传 @@ -44,7 +44,7 @@ public interface LocalStorageService extends IService { * * @param resources 文件信息 */ - void updateLocalStorageById(LocalStorage resources); + void modifyLocalStorageById(LocalStorage resources); /** * 多选删除 diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiNiuConfigService.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiNiuConfigService.java index 408aec8b..3780226e 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiNiuConfigService.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiNiuConfigService.java @@ -11,19 +11,19 @@ public interface QiNiuConfigService extends IService { * * @return QiniuConfig */ - QiniuConfig getConfig(); + QiniuConfig describeQiniuConfig(); /** * 保存 * * @param type 类型 */ - void saveConfig(QiniuConfig type); + void saveQiniuConfig(QiniuConfig type); /** * 更新 * * @param type 类型 */ - void updateType(String type); + void modifyQiniuConfigType(String type); } diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiniuContentService.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiniuContentService.java index f1ee4b34..2f8d5975 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiniuContentService.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/QiniuContentService.java @@ -20,7 +20,7 @@ public interface QiniuContentService extends IService { * @param page 分页参数 * @return / */ - PageResult queryQiniuContentPage(QueryQiniuRequest criteria, Page page); + PageResult describeQiniuContentPage(QueryQiniuRequest criteria, Page page); /** * 查询全部 @@ -28,7 +28,7 @@ public interface QiniuContentService extends IService { * @param criteria 条件 * @return / */ - List selectQiniuContentByCriteria(QueryQiniuRequest criteria); + List describeQiniuContentList(QueryQiniuRequest criteria); /** * 上传文件 @@ -39,12 +39,12 @@ public interface QiniuContentService extends IService { QiniuContent uploadFile(MultipartFile file); /** - * 下载文件 + * 创建文件预览链接 * * @param content 文件信息 * @return String */ - String download(QiniuContent content); + String createFilePreviewUrl(QiniuContent content); /** * 同步数据 diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/CaptchaServiceImpl.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/CaptchaServiceImpl.java index 7ca98e66..afe21797 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/CaptchaServiceImpl.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/CaptchaServiceImpl.java @@ -25,7 +25,7 @@ public class CaptchaServiceImpl implements CaptchaService { @Override @Transactional(rollbackFor = Exception.class) - public SendEmailRequest renderCode(String email, String key) { + public SendEmailRequest renderCodeTemplate(String email, String key) { SendEmailRequest sendEmailRequest; String content; String redisKey = key + email; @@ -49,7 +49,7 @@ public class CaptchaServiceImpl implements CaptchaService { } @Override - public void checkCode(String key, String email, String code) { + public void checkCodeAvailable(String key, String email, String code) { String value = redisHelper.get(key + email, String.class); if (value == null || !value.equals(code)) { throw new BadRequestException("无效验证码"); diff --git a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/EmailServiceImpl.java b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/EmailServiceImpl.java index 4aed18b5..623c6c71 100644 --- a/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/EmailServiceImpl.java +++ b/cutejava/cutejava-tools/src/main/java/cn/odboy/application/tools/service/impl/EmailServiceImpl.java @@ -31,8 +31,8 @@ public class EmailServiceImpl extends ServiceImpl queryLocalStoragePage(QueryLocalStorageRequest criteria, Page page) { + public PageResult describeLocalStoragePage(QueryLocalStorageRequest criteria, Page page) { return PageUtil.toPage(localStorageMapper.queryLocalStoragePageByArgs(criteria, page)); } @Override - public List selectLocalStorageByCriteria(QueryLocalStorageRequest criteria) { + public List describeLocalStorageList(QueryLocalStorageRequest criteria) { return localStorageMapper.queryLocalStoragePageByArgs(criteria, PageUtil.getCount(localStorageMapper)).getRecords(); } @@ -75,7 +75,7 @@ public class LocalStorageServiceImpl extends ServiceImpl implements QiNiuConfigService { @Override @Cacheable(key = "'config'") - public QiniuConfig getConfig() { + public QiniuConfig describeQiniuConfig() { QiniuConfig qiniuConfig = getById(1L); return qiniuConfig == null ? new QiniuConfig() : qiniuConfig; } @@ -28,7 +28,7 @@ public class QiNiuConfigServiceImpl extends ServiceImpl queryQiniuContentPage(QueryQiniuRequest criteria, Page page) { + public PageResult describeQiniuContentPage(QueryQiniuRequest criteria, Page page) { return PageUtil.toPage(qiniuContentMapper.queryQiniuContentPageByArgs(criteria, page)); } @Override - public List selectQiniuContentByCriteria(QueryQiniuRequest criteria) { + public List describeQiniuContentList(QueryQiniuRequest criteria) { return qiniuContentMapper.queryQiniuContentPageByArgs(criteria, PageUtil.getCount(qiniuContentMapper)).getRecords(); } @@ -59,7 +59,7 @@ public class QiniuContentServiceImpl extends ServiceImpl