From 66480b674733576f7b86c5f7be2a2a4bbacf9b1a Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 14 Oct 2025 15:43:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B0=81=E7=A6=81=E5=A4=A9?= =?UTF-8?q?=E6=95=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/user/api/AppUserAccountClientApi.java | 4 ++++ .../other/inner/model/cmd/user/ApprovalAccountCmd.java | 3 +++ .../service/app/user/UserDataViolationServiceImpl.java | 4 ++-- .../user/user/AppUserDataViolationServiceImpl.java | 3 +-- .../rds/service/user/user/BaseInfoService.java | 9 +++++++++ .../service/user/user/impl/BaseInfoServiceImpl.java | 10 ++++++++++ .../user/account/AppUserAccountClientEndpoint.java | 6 ++++++ .../service/user/user/UserAccountClientService.java | 2 ++ .../user/user/impl/UserAccountClientServiceImpl.java | 5 +++++ 9 files changed, 42 insertions(+), 4 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/AppUserAccountClientApi.java b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/AppUserAccountClientApi.java index 139ed084..4078eee9 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/AppUserAccountClientApi.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/AppUserAccountClientApi.java @@ -113,6 +113,10 @@ public interface AppUserAccountClientApi { ResultResponse updateAccountStatus(@RequestParam("userId") Long userId, @RequestParam("accountStatus") AccountStatusEnum accountStatus); + @GetMapping(value = "/updateAccountStatusDays") + ResultResponse updateAccountStatusDays(@RequestParam("userId") Long userId, + @RequestParam("accountStatus") AccountStatusEnum accountStatus, @RequestParam Integer days); + @PostMapping("/pgeApprovalUserAccountStatusLog") ResultResponse> pgeApprovalUserAccountStatusLog( @RequestBody UserAccountStatusLogQryCmd cmd); diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/user/ApprovalAccountCmd.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/user/ApprovalAccountCmd.java index 84646852..6248ddeb 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/user/ApprovalAccountCmd.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/user/ApprovalAccountCmd.java @@ -60,6 +60,9 @@ public class ApprovalAccountCmd extends CommonCommand { if (ConsoleAccountStatusEnum.FREEZE.eq(accountStatusEnum)) { return String.format("【冻结-%s天】%s", days, desc); } + if (ConsoleAccountStatusEnum.ARCHIVE.eq(accountStatusEnum)) { + return String.format("【封禁-%s天】%s", days, desc); + } return desc; } diff --git a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserDataViolationServiceImpl.java b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserDataViolationServiceImpl.java index 5b6c436a..59b0183e 100644 --- a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserDataViolationServiceImpl.java +++ b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserDataViolationServiceImpl.java @@ -99,8 +99,8 @@ public class UserDataViolationServiceImpl implements UserDataViolationService { else if (ConsoleAccountStatusEnum.ARCHIVE.eq(param.getAccountStatusEnum())) { ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE, ResponseAssert.requiredSuccess( - appUserAccountClient.updateAccountStatus(param.getBeApprovalUserId(), - AccountStatusEnum.ARCHIVE))); + appUserAccountClient.updateAccountStatusDays(param.getBeApprovalUserId(), + AccountStatusEnum.ARCHIVE, param.getDays()))); ResponseAssert.requiredSuccess(newsletterClient.send( new NewsletterResultCmd() diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/AppUserDataViolationServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/AppUserDataViolationServiceImpl.java index 05f9c957..cd48d159 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/AppUserDataViolationServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/AppUserDataViolationServiceImpl.java @@ -96,8 +96,7 @@ public class AppUserDataViolationServiceImpl implements AppUserDataViolationServ else if (ConsoleAccountStatusEnum.ARCHIVE.eq(param.getAccountStatusEnum())) { ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE, ResponseAssert.requiredSuccess( - appUserAccountClient.updateAccountStatus(param.getBeApprovalUserId(), - AccountStatusEnum.ARCHIVE))); + appUserAccountClient.updateAccountStatus(param.getBeApprovalUserId(), AccountStatusEnum.ARCHIVE))); ResponseAssert.requiredSuccess(newsletterClient.send( new NewsletterResultCmd() diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/BaseInfoService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/BaseInfoService.java index cbdd1927..e760e516 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/BaseInfoService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/BaseInfoService.java @@ -121,6 +121,15 @@ public interface BaseInfoService extends BaseService { */ boolean updateAccountStatus(Long userId, AccountStatusEnum accountStatus); + /** + * 修改封禁账户状态. + * + * @param userId 用户id + * @param accountStatus 账号状态 + * @return true/false + */ + boolean updateAccountStatusDays(Long userId, AccountStatusEnum accountStatus, Integer days); + /** * 删除用户. * diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/BaseInfoServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/BaseInfoServiceImpl.java index 71857d0a..5bbccb4d 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/BaseInfoServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/BaseInfoServiceImpl.java @@ -234,6 +234,16 @@ public class BaseInfoServiceImpl extends BaseServiceImpl .execute(); } + + @Override + public boolean updateAccountStatusDays(Long userId, AccountStatusEnum accountStatus, Integer days) { + return update() + .set(BaseInfo::getAccountStatus, accountStatus) + .set(Objects.equals(accountStatus, AccountStatusEnum.ARCHIVE), BaseInfo::getFreezingTime, TimestampUtils.nowPlusDays(days)) + .eq(BaseInfo::getId, userId) + .execute(); + } + @Override public boolean deleteUser(Long userId) { return update() diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/account/AppUserAccountClientEndpoint.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/account/AppUserAccountClientEndpoint.java index 752d8a7c..bd4523e6 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/account/AppUserAccountClientEndpoint.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/account/AppUserAccountClientEndpoint.java @@ -156,6 +156,12 @@ public class AppUserAccountClientEndpoint implements AppUserAccountClientApi { userAccountClientService.updateAccountStatus(userId, accountStatus)); } + @Override + public ResultResponse updateAccountStatusDays(Long userId, AccountStatusEnum accountStatus, Integer days) { + return ResultResponse.success( + userAccountClientService.updateAccountStatusDays(userId, accountStatus, days)); + } + @Override public ResultResponse> pgeApprovalUserAccountStatusLog( UserAccountStatusLogQryCmd cmd) { diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserAccountClientService.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserAccountClientService.java index 7d37a5ed..32b63a06 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserAccountClientService.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserAccountClientService.java @@ -91,6 +91,8 @@ public interface UserAccountClientService { boolean updateAccountStatus(Long userId, AccountStatusEnum accountStatus); + boolean updateAccountStatusDays(Long userId, AccountStatusEnum accountStatus, Integer days); + PageResult pgeApprovalUserAccountStatusLog(UserAccountStatusLogQryCmd cmd); List lastApprovalUserAccountStatusLog(Long beApprovalUser, Integer size); diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserAccountClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserAccountClientServiceImpl.java index 591c0071..0a056fca 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserAccountClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserAccountClientServiceImpl.java @@ -264,6 +264,11 @@ public class UserAccountClientServiceImpl implements UserAccountClientService { return baseInfoService.updateAccountStatus(userId, accountStatus); } + @Override + public boolean updateAccountStatusDays(Long userId, AccountStatusEnum accountStatus, Integer days) { + return baseInfoService.updateAccountStatusDays(userId, accountStatus, days); + } + @Override public PageResult pgeApprovalUserAccountStatusLog( UserAccountStatusLogQryCmd cmd) {