From fda2a3120b5a396f07e628b2128444e7d261962f Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 15 Feb 2024 15:19:09 +0800 Subject: [PATCH 01/35] =?UTF-8?q?TASK:=E8=AF=95=E7=94=A8=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/service/impl/AccountServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index a386cdc3..4c7507f5 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -503,7 +503,7 @@ public class AccountServiceImpl extends ServiceImpl impl account.setIsTrial(1); account.setIsBeginner(1); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(3, ChronoUnit.DAYS).toEpochMilli()); + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); accountMapper.updateById(account); }else { account.setUserName(trialOrder.getUserName()); @@ -511,7 +511,7 @@ public class AccountServiceImpl extends ServiceImpl impl account.setUserEmail(trialOrder.getEmail()); account.setLanguage(Language.ENGLISH.name()); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(3, ChronoUnit.DAYS).toEpochMilli()); + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); account.setCreateDate(new Date()); account.setIsTrial(1); account.setIsBeginner(1); @@ -551,7 +551,7 @@ public class AccountServiceImpl extends ServiceImpl impl account.setIsTrial(1); account.setIsBeginner(1); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(3, ChronoUnit.DAYS).toEpochMilli()); + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); accountMapper.updateById(account); }else { account.setUserName(trialOrder.getUserName()); @@ -559,7 +559,7 @@ public class AccountServiceImpl extends ServiceImpl impl account.setUserEmail(trialOrder.getEmail()); account.setLanguage(Language.ENGLISH.name()); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(3, ChronoUnit.DAYS).toEpochMilli()); + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); account.setCreateDate(new Date()); account.setIsTrial(1); account.setIsBeginner(1); From 95aee1daaef0fbfe7d3dbb5c62524e26ebb222d2 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 9 Apr 2024 11:55:15 +0800 Subject: [PATCH 02/35] =?UTF-8?q?BUGFIX:=E8=AF=95=E7=94=A8=E8=AE=A2?= =?UTF-8?q?=E5=8D=95;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/controller/ThirdPartyController.java | 4 ++-- .../java/com/ai/da/mapper/entity/TrialOrder.java | 1 + .../java/com/ai/da/service/AccountService.java | 2 +- .../ai/da/service/impl/AccountServiceImpl.java | 16 +++++++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/controller/ThirdPartyController.java b/src/main/java/com/ai/da/controller/ThirdPartyController.java index 2572ed5b..7132d9b2 100644 --- a/src/main/java/com/ai/da/controller/ThirdPartyController.java +++ b/src/main/java/com/ai/da/controller/ThirdPartyController.java @@ -42,8 +42,8 @@ public class ThirdPartyController { @CrossOrigin @ApiOperation(value = "Add user information") @PostMapping("/addTrialUser") - public Response addTrialUser(@RequestBody AccountTrialDTO accountTrialDTO) { - return Response.success(accountService.addTrialUser(accountTrialDTO)); + public Response addTrialUser(@RequestBody AccountTrialDTO accountTrialDTO, HttpServletRequest request) { + return Response.success(accountService.addTrialUser(accountTrialDTO, request)); } @CrossOrigin diff --git a/src/main/java/com/ai/da/mapper/entity/TrialOrder.java b/src/main/java/com/ai/da/mapper/entity/TrialOrder.java index 904d1a75..72183c97 100644 --- a/src/main/java/com/ai/da/mapper/entity/TrialOrder.java +++ b/src/main/java/com/ai/da/mapper/entity/TrialOrder.java @@ -64,4 +64,5 @@ public class TrialOrder implements Serializable { */ private Integer status; private Integer isDeleted; + private String ip; } diff --git a/src/main/java/com/ai/da/service/AccountService.java b/src/main/java/com/ai/da/service/AccountService.java index 2b1f20f1..aa646554 100644 --- a/src/main/java/com/ai/da/service/AccountService.java +++ b/src/main/java/com/ai/da/service/AccountService.java @@ -102,7 +102,7 @@ public interface AccountService extends IService { Boolean completeGuidance(); - Boolean addTrialUser(AccountTrialDTO accountTrialDTO); + Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request); IPage trialOrderList(TrialOrderDTO trialOrderDTO); diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 680a1047..af3247ab 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -468,7 +468,20 @@ public class AccountServiceImpl extends ServiceImpl impl } @Override - public Boolean addTrialUser(AccountTrialDTO accountTrialDTO) { + public Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request) { + // 获取用户申请试用IP + String ipAddress = RequestInfoUtil.getIpAddress(request); + // 先检测试用订单 + QueryWrapper trialOrderQueryWrapper = new QueryWrapper<>(); + trialOrderQueryWrapper.lambda().eq(TrialOrder::getIp, ipAddress); + trialOrderQueryWrapper.lambda().and(wrapper -> + wrapper.eq(TrialOrder::getEmail, accountTrialDTO.getEmail()) + .or() // OR + .like(TrialOrder::getUserName, accountTrialDTO.getUserName())); + List trialOrders = trialOrderMapper.selectList(trialOrderQueryWrapper); + if (CollectionUtil.isNotEmpty(trialOrders)) { + throw new BusinessException("You have submitted a trial application, please wait for approval."); + } // 先检测用户名和邮箱 QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Account::getUserEmail, accountTrialDTO.getEmail()) @@ -489,6 +502,7 @@ public class AccountServiceImpl extends ServiceImpl impl TrialOrder trialOrder = CopyUtil.copyObject(accountTrialDTO, TrialOrder.class); trialOrder.setCreateTime(LocalDateTime.now()); trialOrder.setStatus(0); + trialOrder.setIp(ipAddress); trialOrderMapper.insert(trialOrder); SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,1); SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,1); From d1772be7379a5940a7fc456d0b9723d7cb42c630 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 23 Apr 2024 10:10:51 +0800 Subject: [PATCH 03/35] =?UTF-8?q?BUGFIX:=E7=99=BB=E5=BD=95=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index af3247ab..0797b276 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -289,7 +289,7 @@ public class AccountServiceImpl extends ServiceImpl impl private Account getOneByEmail(String email) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(Account::getUserEmail, email); + queryWrapper.lambda().like(Account::getUserEmail, email).eq(Account::getUserEmail, email); queryWrapper.lambda().last("limit 1"); List accountList = accountMapper.selectList(queryWrapper); if (CollectionUtil.isEmpty(accountList)) { From 5a69a770acf7f9ac96f6ea74bcd46c5e583757d5 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 23 Apr 2024 10:22:26 +0800 Subject: [PATCH 04/35] =?UTF-8?q?BUGFIX:=E7=99=BB=E5=BD=95=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 0797b276..a129d357 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -289,7 +289,7 @@ public class AccountServiceImpl extends ServiceImpl impl private Account getOneByEmail(String email) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(Account::getUserEmail, email).eq(Account::getUserEmail, email); + queryWrapper.lambda().last("BINARY user_email = '" + email + "'"); queryWrapper.lambda().last("limit 1"); List accountList = accountMapper.selectList(queryWrapper); if (CollectionUtil.isEmpty(accountList)) { From faeb59bae5059e38522967b16d9af926a8f90b8d Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 23 Apr 2024 10:32:24 +0800 Subject: [PATCH 05/35] =?UTF-8?q?BUGFIX:=E7=99=BB=E5=BD=95=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D=E5=9B=9E=E9=80=80?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index a129d357..af3247ab 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -289,7 +289,7 @@ public class AccountServiceImpl extends ServiceImpl impl private Account getOneByEmail(String email) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().last("BINARY user_email = '" + email + "'"); + queryWrapper.lambda().eq(Account::getUserEmail, email); queryWrapper.lambda().last("limit 1"); List accountList = accountMapper.selectList(queryWrapper); if (CollectionUtil.isEmpty(accountList)) { From c3ae729466f09fdba8063edc590ae5485d15aedd Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 23 Apr 2024 10:50:45 +0800 Subject: [PATCH 06/35] =?UTF-8?q?BUGFIX:=E7=99=BB=E5=BD=95=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/RabbitMQ/MQConsumer.java | 106 +++++++++--------- .../ai/da/common/config/MyTaskScheduler.java | 2 +- .../da/service/impl/AccountServiceImpl.java | 4 +- 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java index 77f46dbd..c04093dd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java @@ -104,58 +104,58 @@ public class MQConsumer { log.info("=============end listening==========="); } - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer1(Message msg, Channel channel) { - generate(msg, channel, "consumer 1"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer2(Message msg, Channel channel) { - generate(msg, channel, "consumer 2"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer3(Message msg, Channel channel) { - generate(msg, channel, "consumer 3"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer4(Message msg, Channel channel) { - generate(msg, channel, "consumer 4"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer5(Message msg, Channel channel) { - generate(msg, channel, "consumer 5"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer6(Message msg, Channel channel) { - generate(msg, channel, "consumer 6"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer7(Message msg, Channel channel) { - generate(msg, channel, "consumer 7"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer8(Message msg, Channel channel) { - generate(msg, channel, "consumer 8"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer9(Message msg, Channel channel) { - generate(msg, channel, "consumer 9"); - } +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer1(Message msg, Channel channel) { +// generate(msg, channel, "consumer 1"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer2(Message msg, Channel channel) { +// generate(msg, channel, "consumer 2"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer3(Message msg, Channel channel) { +// generate(msg, channel, "consumer 3"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer4(Message msg, Channel channel) { +// generate(msg, channel, "consumer 4"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer5(Message msg, Channel channel) { +// generate(msg, channel, "consumer 5"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer6(Message msg, Channel channel) { +// generate(msg, channel, "consumer 6"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer7(Message msg, Channel channel) { +// generate(msg, channel, "consumer 7"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer8(Message msg, Channel channel) { +// generate(msg, channel, "consumer 8"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer9(Message msg, Channel channel) { +// generate(msg, channel, "consumer 9"); +// } } diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 93ff24f6..ee5b4d28 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -19,7 +19,7 @@ public class MyTaskScheduler { // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") - @Scheduled(cron = "0 0 0 */15 * ?") +// @Scheduled(cron = "0 0 0 */15 * ?") public void checkExpiry() { // 检测正式用户是否快要过期 QueryWrapper qw = new QueryWrapper<>(); diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index af3247ab..198db146 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -289,8 +289,7 @@ public class AccountServiceImpl extends ServiceImpl impl private Account getOneByEmail(String email) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(Account::getUserEmail, email); - queryWrapper.lambda().last("limit 1"); + queryWrapper.eq("BINARY user_email", email); List accountList = accountMapper.selectList(queryWrapper); if (CollectionUtil.isEmpty(accountList)) { throw new BusinessException("email.does.not.exist", ResultEnum.PROMPT.getCode()); @@ -298,6 +297,7 @@ public class AccountServiceImpl extends ServiceImpl impl return accountList.get(0); } + private Account getOneByUserName(String userName) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(Account::getUserName, userName); From 7454e160765c204fcfa6984b35e583993ab9234d Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 23 Apr 2024 10:52:10 +0800 Subject: [PATCH 07/35] =?UTF-8?q?BUGFIX:=E7=99=BB=E5=BD=95=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/RabbitMQ/MQConsumer.java | 106 +++++++++--------- .../ai/da/common/config/MyTaskScheduler.java | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java index c04093dd..77f46dbd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConsumer.java @@ -104,58 +104,58 @@ public class MQConsumer { log.info("=============end listening==========="); } -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer1(Message msg, Channel channel) { -// generate(msg, channel, "consumer 1"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer2(Message msg, Channel channel) { -// generate(msg, channel, "consumer 2"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer3(Message msg, Channel channel) { -// generate(msg, channel, "consumer 3"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer4(Message msg, Channel channel) { -// generate(msg, channel, "consumer 4"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer5(Message msg, Channel channel) { -// generate(msg, channel, "consumer 5"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer6(Message msg, Channel channel) { -// generate(msg, channel, "consumer 6"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer7(Message msg, Channel channel) { -// generate(msg, channel, "consumer 7"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer8(Message msg, Channel channel) { -// generate(msg, channel, "consumer 8"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer9(Message msg, Channel channel) { -// generate(msg, channel, "consumer 9"); -// } + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer1(Message msg, Channel channel) { + generate(msg, channel, "consumer 1"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer2(Message msg, Channel channel) { + generate(msg, channel, "consumer 2"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer3(Message msg, Channel channel) { + generate(msg, channel, "consumer 3"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer4(Message msg, Channel channel) { + generate(msg, channel, "consumer 4"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer5(Message msg, Channel channel) { + generate(msg, channel, "consumer 5"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer6(Message msg, Channel channel) { + generate(msg, channel, "consumer 6"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer7(Message msg, Channel channel) { + generate(msg, channel, "consumer 7"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer8(Message msg, Channel channel) { + generate(msg, channel, "consumer 8"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer9(Message msg, Channel channel) { + generate(msg, channel, "consumer 9"); + } } diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index ee5b4d28..93ff24f6 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -19,7 +19,7 @@ public class MyTaskScheduler { // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") -// @Scheduled(cron = "0 0 0 */15 * ?") + @Scheduled(cron = "0 0 0 */15 * ?") public void checkExpiry() { // 检测正式用户是否快要过期 QueryWrapper qw = new QueryWrapper<>(); From e70580c3889ddd85a94a95dcaea3f97773fdeb84 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 30 Apr 2024 10:19:40 +0800 Subject: [PATCH 08/35] =?UTF-8?q?BUGFIX:=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 24 ++++++ .../ai/da/common/config/MyTaskScheduler.java | 81 ++++++++++++++++++- .../com/ai/da/common/utils/SendEmailUtil.java | 50 +++++++++++- .../da/service/impl/AccountServiceImpl.java | 33 ++++---- 4 files changed, 171 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 14913240..4186fc61 100644 --- a/pom.xml +++ b/pom.xml @@ -170,6 +170,30 @@ commons-pool2 + + org.apache.poi + poi + 5.2.1 + + + + org.apache.poi + poi-ooxml + 5.2.1 + + + + commons-io + commons-io + 2.11.0 + + + + org.apache.logging.log4j + log4j-api + 2.17.1 + + diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 93ff24f6..d012ec10 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -2,13 +2,25 @@ package com.ai.da.common.config; import com.ai.da.common.utils.SendEmailUtil; import com.ai.da.mapper.AccountMapper; +import com.ai.da.mapper.TrialOrderMapper; import com.ai.da.mapper.entity.Account; +import com.ai.da.mapper.entity.TrialOrder; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.springframework.scheduling.annotation.EnableScheduling; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; import javax.annotation.Resource; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; @Component @@ -17,6 +29,14 @@ public class MyTaskScheduler { @Resource private AccountMapper accountMapper; + @Resource + private TrialOrderMapper trialOrderMapper; + + @PostConstruct + public void executeWeeklyHeavyStockReport() { + sendTrialOrderExcelToManagements(); + } + // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") @Scheduled(cron = "0 0 0 */15 * ?") @@ -53,4 +73,63 @@ public class MyTaskScheduler { } } } + @Scheduled(cron = "0 0 8 * * ?") + public void sendTrialOrderExcelToManagements() { + // 获取前一天日期 + LocalDate yesterday = LocalDate.now().minusDays(1); + + // 查询前一天的试用订单 + QueryWrapper qw = new QueryWrapper<>(); + qw.lambda().between(TrialOrder::getCreateTime, yesterday.atStartOfDay(), yesterday.atTime(23, 59, 59)); + List trialOrders = trialOrderMapper.selectList(qw); + + if (!trialOrders.isEmpty()) { + // 创建Excel工作簿 + try (Workbook workbook = new XSSFWorkbook()) { + // 创建工作表 + Sheet sheet = workbook.createSheet("Trial Orders"); + // 创建标题行 + Row headerRow = sheet.createRow(0); + headerRow.createCell(0).setCellValue("ID"); + headerRow.createCell(1).setCellValue("Title"); + headerRow.createCell(2).setCellValue("Surname"); + headerRow.createCell(3).setCellValue("Given Name"); + headerRow.createCell(4).setCellValue("Username"); + headerRow.createCell(5).setCellValue("Email"); + headerRow.createCell(6).setCellValue("Country"); + headerRow.createCell(7).setCellValue("Occupation"); + headerRow.createCell(8).setCellValue("Create Time"); + headerRow.createCell(9).setCellValue("Update Time"); + headerRow.createCell(10).setCellValue("Status"); + + // 填充数据 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + int rowNum = 1; + for (TrialOrder trialOrder : trialOrders) { + Row row = sheet.createRow(rowNum++); + row.createCell(0).setCellValue(trialOrder.getId()); + row.createCell(1).setCellValue(trialOrder.getTitle()); + row.createCell(2).setCellValue(trialOrder.getSurname()); + row.createCell(3).setCellValue(trialOrder.getGivenName()); + row.createCell(4).setCellValue(trialOrder.getUserName()); + row.createCell(5).setCellValue(trialOrder.getEmail()); + row.createCell(6).setCellValue(trialOrder.getCountry()); + row.createCell(7).setCellValue(trialOrder.getOccupation()); + row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter)); + row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter)); + row.createCell(10).setCellValue(trialOrder.getStatus()); + } + + // 保存Excel文件 + String fileName = "trialOrder-" + yesterday.format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx"; + try (FileOutputStream fileOut = new FileOutputStream(fileName)) { + workbook.write(fileOut); + SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName); + + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } } diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 1fcba907..943d12ab 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -9,12 +9,14 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.ses.v20201002.SesClient; +import com.tencentcloudapi.ses.v20201002.models.Attachment; import com.tencentcloudapi.ses.v20201002.models.SendEmailRequest; import com.tencentcloudapi.ses.v20201002.models.SendEmailResponse; import com.tencentcloudapi.ses.v20201002.models.Template; import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; +import java.util.Base64; import java.util.Date; /** @@ -130,7 +132,8 @@ public class SendEmailUtil { private final static Long YOUR_TRIAL_TEMPLATE_ID = 117214L; private final static Long APPROVAL_TEMPLATE_ID = 117215L; private final static Long NOTIFICATION_TEMPLATE_ID = 117216L; - public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType) { + private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L; + public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) { try { // 实例化一个认证对象 Credential cred = new Credential(SECRET_ID, SECRET_KEy); @@ -162,7 +165,11 @@ public class SendEmailUtil { break; case 3: subject = "Approval Confirmation for AiDA System Trial Access"; - template.setTemplateID(NOTIFICATION_TEMPLATE_ID); + if (country.equals("China")) { + template.setTemplateID(NOTIFICATION_CHINESE_TEMPLATE_ID); + }else { + template.setTemplateID(NOTIFICATION_TEMPLATE_ID); + } template.setTemplateData(buildNotificationData(trialOrder)); break; default: @@ -180,6 +187,45 @@ public class SendEmailUtil { throw new BusinessException("failed.to.send.mail"); } } + + public static void sendExcelEmail(String receiverAddress, String senderAddress, byte[] fileContent, String fileName) { + try { + // 实例化一个认证对象 + Credential cred = new Credential(SECRET_ID, SECRET_KEy); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("ses.tencentcloudapi.com"); + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + SesClient client = new SesClient(cred, "ap-hongkong", clientProfile); + SendEmailRequest req = new SendEmailRequest(); + if (StringUtils.isEmpty(senderAddress)) { + senderAddress = SEND_ADDRESS; + } + req.setFromEmailAddress(senderAddress); + req.setDestination(new String[]{receiverAddress}); + + // 根据邮件类型设置不同的主题和模板 + String subject = ""; + Template template = new Template(); + subject = "昨日试用订单数据"; + template.setTemplateID(YOUR_TRIAL_TEMPLATE_ID); + + req.setSubject(subject); + req.setTemplate(template); + + Attachment attachment = new Attachment(); + attachment.setFileName(fileName); // 设置附件文件名 + // 设置附件内容 + attachment.setContent(Base64.getEncoder().encodeToString(fileContent)); + req.setAttachments(new Attachment[] {attachment}); + // 发送邮件 + SendEmailResponse resp = client.SendEmail(req); + log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); + } catch (TencentCloudSDKException e) { + log.info("邮件发送失败###{}", e.toString()); + throw new BusinessException("failed.to.send.mail"); + } + } private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L; public static void sendWillBeExpiredEmail(Account account, String senderAddress) { try { diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 198db146..592459d9 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -9,9 +9,7 @@ import com.ai.da.common.response.ResultEnum; import com.ai.da.common.security.jwt.JWTTokenHelper; import com.ai.da.common.utils.*; import com.ai.da.mapper.AccountMapper; -import com.ai.da.mapper.LibraryMapper; import com.ai.da.mapper.TrialOrderMapper; -import com.ai.da.mapper.UserLikeGroupMapper; import com.ai.da.mapper.entity.Account; import com.ai.da.mapper.entity.AccountLoginLog; import com.ai.da.mapper.entity.TrialOrder; @@ -32,7 +30,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.checkerframework.checker.units.qual.A; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -504,9 +501,9 @@ public class AccountServiceImpl extends ServiceImpl impl trialOrder.setStatus(0); trialOrder.setIp(ipAddress); trialOrderMapper.insert(trialOrder); - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,1); - SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,1); - SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,1); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,1, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,1, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,1, trialOrder.getCountry()); // 判断当前的试用订单是否自动批准 if (AutoApproved.getStatus()) { // 改变试用订单状态,新增试用用户 @@ -534,10 +531,14 @@ public class AccountServiceImpl extends ServiceImpl impl accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); - SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry()); + if (trialOrder.getCountry().equals("China")) { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } @@ -584,10 +585,14 @@ public class AccountServiceImpl extends ServiceImpl impl accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); - SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry()); + if (trialOrder.getCountry().equals("China")) { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } From d2e917e3cea917e7f9f8d3d93a6f33d0af23e462 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 30 Apr 2024 10:27:39 +0800 Subject: [PATCH 09/35] =?UTF-8?q?BUGFIX:=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/config/MyTaskScheduler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index d012ec10..14e679ab 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -125,7 +125,8 @@ public class MyTaskScheduler { try (FileOutputStream fileOut = new FileOutputStream(fileName)) { workbook.write(fileOut); SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName); - + SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); } } catch (IOException e) { e.printStackTrace(); From de865b918f6c6ccf8eecf400148451311ef478f4 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 30 Apr 2024 10:32:55 +0800 Subject: [PATCH 10/35] =?UTF-8?q?BUGFIX:=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 8 ++++---- src/main/java/com/ai/da/common/utils/SendEmailUtil.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 14e679ab..919f7944 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -32,10 +32,10 @@ public class MyTaskScheduler { @Resource private TrialOrderMapper trialOrderMapper; - @PostConstruct - public void executeWeeklyHeavyStockReport() { - sendTrialOrderExcelToManagements(); - } +// @PostConstruct +// public void executeWeeklyHeavyStockReport() { +// sendTrialOrderExcelToManagements(); +// } // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 943d12ab..e9389317 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -133,6 +133,7 @@ public class SendEmailUtil { private final static Long APPROVAL_TEMPLATE_ID = 117215L; private final static Long NOTIFICATION_TEMPLATE_ID = 117216L; private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L; + private final static Long TRIAL_ORDER_LIST_ID = 122273L; public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) { try { // 实例化一个认证对象 @@ -208,7 +209,7 @@ public class SendEmailUtil { String subject = ""; Template template = new Template(); subject = "昨日试用订单数据"; - template.setTemplateID(YOUR_TRIAL_TEMPLATE_ID); + template.setTemplateID(TRIAL_ORDER_LIST_ID); req.setSubject(subject); req.setTemplate(template); From a54f7e7c306f89f1deb7fd0a086803777eac6ecd Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 1 May 2024 11:54:19 +0800 Subject: [PATCH 11/35] =?UTF-8?q?BUGFIX:=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/config/MyTaskScheduler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 919f7944..79889833 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -127,6 +127,7 @@ public class MyTaskScheduler { SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); } } catch (IOException e) { e.printStackTrace(); From bc85e3307455e4a91add8c44ec26a53eca9698e8 Mon Sep 17 00:00:00 2001 From: xupei Date: Thu, 16 May 2024 18:19:01 +0800 Subject: [PATCH 12/35] =?UTF-8?q?paypal=20=E6=94=B6=E6=AC=BE=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=88=87=E6=8D=A2=E5=88=B0live?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/paypal-sandbox.properties | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/paypal-sandbox.properties b/src/main/resources/paypal-sandbox.properties index 1b48960c..3b0eaef2 100644 --- a/src/main/resources/paypal-sandbox.properties +++ b/src/main/resources/paypal-sandbox.properties @@ -1,12 +1,12 @@ # developer-sandbox-xp -paypal.client-id=ATbaebYi7-GXWRWJqwRLYMzKEbwjh4BFRqD4Y13i4lZq0rplWIM_IpPrtPKpdkAt_KrPXd6IJTwsDqa5 -paypal.client-secret=EHWWJqGmmbfjLXqCUpGrvxRYBPPtWvA3hR5ZaAyHlGSVJiHoQPS8skbNaJ9h39VObnchUbgiY2pPu__s -paypal.receiver.email=sb-ukxfk29608925@business.example.com -paypal.mode=sandbox +#paypal.client-id=ATbaebYi7-GXWRWJqwRLYMzKEbwjh4BFRqD4Y13i4lZq0rplWIM_IpPrtPKpdkAt_KrPXd6IJTwsDqa5 +#paypal.client-secret=EHWWJqGmmbfjLXqCUpGrvxRYBPPtWvA3hR5ZaAyHlGSVJiHoQPS8skbNaJ9h39VObnchUbgiY2pPu__s +#paypal.receiver.email=sb-ukxfk29608925@business.example.com +#paypal.mode=sandbox # local #paypal.webhook_id=31797347YC028794L # dev -paypal.webhook_id=51V87014T6406322F +#paypal.webhook_id=51V87014T6406322F # aida-sandbox-kim #paypal.client-id=AbDDH8jnTrKqjnWLFgEu6LogYzVz2ZLuirE4W54t1M4lrofrP5OzXfhbxqktLLFB-rAO9KeYQVYFJ_tO @@ -16,8 +16,8 @@ paypal.webhook_id=51V87014T6406322F #paypal.webhook_id=1WH327112B602422N # aida-live-kim -#paypal.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2VwZwa2DMvGEzTfCTgz -#paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc -#paypal.receiver.email=kimwong@code-create.com.hk -#paypal.mode=live -#paypal.webhook_id=41L14847MC833625B \ No newline at end of file +paypal.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2VwZwa2DMvGEzTfCTgz +paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc +paypal.receiver.email=kimwong@code-create.com.hk +paypal.mode=live +paypal.webhook_id=41L14847MC833625B \ No newline at end of file From 9f4dbda1524279489b573e990613f5be0c061011 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 10:39:00 +0800 Subject: [PATCH 13/35] =?UTF-8?q?TASK:=E6=97=A0=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/common/config/MyTaskScheduler.java | 5 +++ .../com/ai/da/common/utils/SendEmailUtil.java | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index f505796e..6e443ba9 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -127,6 +127,11 @@ public class MyTaskScheduler { } catch (IOException e) { e.printStackTrace(); } + }else { + SendEmailUtil.sendNoExcelEmail("1023316923@qq.com", null); + SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null); + SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null); + SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null); } } } diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 6653c7da..73c4eb17 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -134,6 +134,8 @@ public class SendEmailUtil { private final static Long NOTIFICATION_TEMPLATE_ID = 117216L; private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L; private final static Long TRIAL_ORDER_LIST_ID = 122273L; + private final static Long NO_TRIAL_ORDER_LIST_ID = 122591L; + public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) { try { // 实例化一个认证对象 @@ -227,6 +229,40 @@ public class SendEmailUtil { throw new BusinessException("failed.to.send.mail"); } } + + + public static void sendNoExcelEmail(String receiverAddress, String senderAddress) { + try { + // 实例化一个认证对象 + Credential cred = new Credential(SECRET_ID, SECRET_KEy); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("ses.tencentcloudapi.com"); + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + SesClient client = new SesClient(cred, "ap-hongkong", clientProfile); + SendEmailRequest req = new SendEmailRequest(); + if (StringUtils.isEmpty(senderAddress)) { + senderAddress = SEND_ADDRESS; + } + req.setFromEmailAddress(senderAddress); + req.setDestination(new String[]{receiverAddress}); + + // 根据邮件类型设置不同的主题和模板 + String subject = ""; + Template template = new Template(); + subject = "昨日试用订单数据"; + template.setTemplateID(NO_TRIAL_ORDER_LIST_ID); + + req.setSubject(subject); + req.setTemplate(template); + // 发送邮件 + SendEmailResponse resp = client.SendEmail(req); + log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); + } catch (TencentCloudSDKException e) { + log.info("邮件发送失败###{}", e.toString()); + throw new BusinessException("failed.to.send.mail"); + } + } private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L; public static void sendWillBeExpiredEmail(Account account, String senderAddress) { try { From 51db8b4ec2de3ced1065c2376d4ca228910999af Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 11:36:53 +0800 Subject: [PATCH 14/35] =?UTF-8?q?TASK:=E6=97=A0=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.properties | 13 +++++++++---- src/main/resources/application-prod.properties | 12 ++++++++---- src/main/resources/application-test.properties | 12 ++++++++---- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 55672070..0d7a298c 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -2,10 +2,15 @@ server.port=5567 #datasource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.username=aida_con -spring.datasource.password=123456 -#spring.datasource.password=QWa998345 +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.username=aida_con +spring.datasource.primary.password=123456 + + +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.username=aida_con +spring.datasource.secondary.password=123456 #security spring.security.jwtSecret=JWTSECRET diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index af7d6688..147a635b 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -2,10 +2,14 @@ server.port=5567 #datasource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.username=root -spring.datasource.password=QWa998345 -#spring.datasource.password=QWa998345 +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.username=root +spring.datasource.primary.password=QWa998345 + +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.username=aida_con +spring.datasource.secondary.password=123456 #security spring.security.jwtSecret=JWTSECRET diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 59ce6439..77222db5 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -2,10 +2,14 @@ server.port=5567 #datasource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.username=aida_con -spring.datasource.password=123456 -#spring.datasource.password=QWa998345 +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.username=root +spring.datasource.primary.password=QWa998345 + +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.username=aida_con +spring.datasource.secondary.password=123456 #security spring.security.jwtSecret=JWTSECRET From a726ceca5953165bfe52d93341871bacc86b6076 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 11:40:38 +0800 Subject: [PATCH 15/35] =?UTF-8?q?TASK:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.properties | 14 +++++++++----- src/main/resources/application-test.properties | 14 +++++++++----- src/main/resources/application.properties | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index af7d6688..66c958ee 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,11 +1,15 @@ server.port=5567 #datasource -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.username=root -spring.datasource.password=QWa998345 -#spring.datasource.password=QWa998345 +spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.username=root +spring.datasource.primary.password=QWa998345 + +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.username=aida_con +spring.datasource.secondary.password=123456 #security spring.security.jwtSecret=JWTSECRET diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 28eaf8ac..f86bba1a 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -1,11 +1,15 @@ server.port=5567 #datasource -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.username=aida_con -spring.datasource.password=123456 -#spring.datasource.password=QWa998345 +spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.username=root +spring.datasource.primary.password=QWa998345 + +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.username=aida_con +spring.datasource.secondary.password=123456 #security spring.security.jwtSecret=JWTSECRET diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 974fee23..4135ec12 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,4 +5,4 @@ #spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=dev +spring.profiles.active=test From c73876e8b02f77f480f34dece3059b9cec4c95ce Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 12:13:35 +0800 Subject: [PATCH 16/35] =?UTF-8?q?TASK:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/RabbitMQ/MQConfig.java | 8 +++---- src/main/resources/application-dev.properties | 3 +-- .../resources/application-prod.properties | 21 ++++++++++++------- .../resources/application-test.properties | 21 ++++++++++++------- src/main/resources/application.properties | 2 +- 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 7079f02a..637fc94e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -12,16 +12,16 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== // public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-dev"; + public static final String GENERATE_QUEUE = "generate-queue-prod"; // public static final String SR_QUEUE = "SR-queue-local"; - public static final String SR_QUEUE = "SR-queue-dev"; + public static final String SR_QUEUE = "SR-queue-prod"; // public static final String SR_RESULT_QUEUE = "SuperResolution-local"; - public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; + public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; public MQConfig() { } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 63a1a5be..b57dad01 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,5 +1,6 @@ server.port=5567 +#datasource spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.primary.username=aida_con @@ -10,8 +11,6 @@ spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_ spring.datasource.secondary.username=aida_con spring.datasource.secondary.password=123456 - - #security spring.security.jwtSecret=JWTSECRET spring.security.jwtTokenHeader=Authorization diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 66c958ee..14ff67a9 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -19,7 +19,8 @@ spring.security.jwtTokenPrefix=Bearer- spring.security.jwtExpiration=8640000000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ - /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,/api/inquiry/** + /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\ + /api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR spring.security.authApi=/auth/login @@ -27,8 +28,7 @@ rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8 #mybatis mybatis-plus.global-config.banner=false -mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml -#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.mapper-locations=classpath:mapper/*/*.xml mybatis-plus.global-config.db-config.logic-delete-field=isDeleted mybatis-plus.global-config.db-config.logic-delete-value=1 mybatis-plus.global-config.db-config.logic-not-delete-value=0 @@ -47,6 +47,7 @@ spring.servlet.multipart.max-request-size= 10MB access.python.ip=http://18.167.251.121 #access.python.ip=http://18.167.251.121:9991/ access.python.port=9990 +access.python.sr=http://18.167.251.121:9994 minio.endpoint=https://www.minio.aida.com.hk:9000 minio.accessKey=admin @@ -75,7 +76,13 @@ spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.max-wait=5 -redis.key.consumptionOrder=ConsumptionOrder -redis.key.cancelSet=CancelSet -redis.key.exceptionMap=ExceptionMap -redis.key.resultMap=ResultMap \ No newline at end of file +redis.key.orderForGenerate=OrderForGenerate +redis.key.generateCancelSet=GenerateCancelSet +redis.key.generateExceptionMap=Generate:Exception +redis.key.resultMap=ResultMap +redis.key.orderForSR=OrderForSR +redis.key.SRCancelSet=SRCancelSet +redis.key.SRExceptionMap=SRExceptionMap +redis.key.taskList=TaskList +redis.key.credits.pre-deduction=Credits:PreDeduction +redis.key.generateResult=Generate:Result \ No newline at end of file diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index f86bba1a..31595f52 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -19,7 +19,8 @@ spring.security.jwtTokenPrefix=Bearer- spring.security.jwtExpiration=8640000000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ - /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/** + /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\ + /api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR spring.security.authApi=/auth/login @@ -27,8 +28,7 @@ rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8 #mybatis mybatis-plus.global-config.banner=false -mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml -#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.mapper-locations=classpath:mapper/*/*.xml mybatis-plus.global-config.db-config.logic-delete-field=isDeleted mybatis-plus.global-config.db-config.logic-delete-value=1 mybatis-plus.global-config.db-config.logic-not-delete-value=0 @@ -47,6 +47,7 @@ spring.servlet.multipart.max-request-size= 10MB access.python.ip=http://18.167.251.121 #access.python.ip=http://18.167.251.121:9991/ access.python.port=9992 +access.python.sr=http://18.167.251.121:9994 minio.endpoint=https://www.minio.aida.com.hk:9000 minio.accessKey=admin @@ -75,7 +76,13 @@ spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.max-wait=5 -redis.key.consumptionOrder=ConsumptionOrder -redis.key.cancelSet=CancelSet -redis.key.exceptionMap=ExceptionMap -redis.key.resultMap=ResultMap \ No newline at end of file +redis.key.orderForGenerate=OrderForGenerate +redis.key.generateCancelSet=GenerateCancelSet +redis.key.generateExceptionMap=Generate:Exception +redis.key.resultMap=ResultMap +redis.key.orderForSR=OrderForSR +redis.key.SRCancelSet=SRCancelSet +redis.key.SRExceptionMap=SRExceptionMap +redis.key.taskList=TaskList +redis.key.credits.pre-deduction=Credits:PreDeduction +redis.key.generateResult=Generate:Result \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4135ec12..974fee23 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,4 +5,4 @@ #spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=test +spring.profiles.active=dev From 12c447d6b0512aa7fba8c29c479d617ed89224de Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 12:14:20 +0800 Subject: [PATCH 17/35] =?UTF-8?q?TASK:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 637fc94e..7079f02a 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -12,16 +12,16 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== // public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-prod"; + public static final String GENERATE_QUEUE = "generate-queue-dev"; // public static final String SR_QUEUE = "SR-queue-local"; - public static final String SR_QUEUE = "SR-queue-prod"; + public static final String SR_QUEUE = "SR-queue-dev"; // public static final String SR_RESULT_QUEUE = "SuperResolution-local"; - public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; + public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; public MQConfig() { } From f1eb48ae741c7b835f4d410e885fccff6c46e265 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 19:25:50 +0800 Subject: [PATCH 18/35] =?UTF-8?q?TASK:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java | 8 ++++---- src/main/resources/application-prod.properties | 2 +- src/main/resources/application.properties | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 7079f02a..637fc94e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -12,16 +12,16 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== // public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-dev"; + public static final String GENERATE_QUEUE = "generate-queue-prod"; // public static final String SR_QUEUE = "SR-queue-local"; - public static final String SR_QUEUE = "SR-queue-dev"; + public static final String SR_QUEUE = "SR-queue-prod"; // public static final String SR_RESULT_QUEUE = "SuperResolution-local"; - public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; + public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; public MQConfig() { } diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 14ff67a9..20d02502 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -47,7 +47,7 @@ spring.servlet.multipart.max-request-size= 10MB access.python.ip=http://18.167.251.121 #access.python.ip=http://18.167.251.121:9991/ access.python.port=9990 -access.python.sr=http://18.167.251.121:9994 +access.python.sr=http://18.167.251.121:9995 minio.endpoint=https://www.minio.aida.com.hk:9000 minio.accessKey=admin diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 974fee23..605b072c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,4 +5,4 @@ #spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=dev +spring.profiles.active=prod From b063cad76439fdb53e86920d0f26a4f7f7310a49 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 19:40:52 +0800 Subject: [PATCH 19/35] =?UTF-8?q?TASK:=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index e69de29b..00000000 From 4dbd5a1fad9fce3048a90e961b7b23eb4c510764 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 20:27:58 +0800 Subject: [PATCH 20/35] =?UTF-8?q?TASK:=E6=A3=80=E6=9F=A5=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E9=87=8A;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/security/filter/AuthenticationFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 9e404107..9c2d4d27 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -89,7 +89,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { private void extracted(HttpServletRequest request) throws AuthenticationException { String jwtToken = request.getHeader(properties.getJwtTokenHeader()); - log.debug("后台检查令牌:{}", jwtToken); +// log.debug("后台检查令牌:{}", jwtToken); if (StrUtil.isBlank(jwtToken)) { String ipAddress = RequestInfoUtil.getIpAddress(request); From ae2191f369304fd4272d061aed74ede1a5d47964 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 21:03:56 +0800 Subject: [PATCH 21/35] =?UTF-8?q?TASK:=E6=A3=80=E6=9F=A5=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E9=87=8A;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/common/RabbitMQ/GenerateConsumer.java | 118 +++++++++--------- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 3e8e6a6e..876dfd2c 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -154,63 +154,63 @@ public class GenerateConsumer { } - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer1(Message msg, Channel channel) { - generate(msg, channel, "consumer 1"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer2(Message msg, Channel channel) { - generate(msg, channel, "consumer 2"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer3(Message msg, Channel channel) { - generate(msg, channel, "consumer 3"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer4(Message msg, Channel channel) { - generate(msg, channel, "consumer 4"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer5(Message msg, Channel channel) { - generate(msg, channel, "consumer 5"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer6(Message msg, Channel channel) { - generate(msg, channel, "consumer 6"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer7(Message msg, Channel channel) { - generate(msg, channel, "consumer 7"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer8(Message msg, Channel channel) { - generate(msg, channel, "consumer 8"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer9(Message msg, Channel channel) { - generate(msg, channel, "consumer 9"); - } - - @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) - @RabbitHandler - public void getGenerateResult(Message msg, Channel channel) { - processGenerateResult(msg, channel); - } +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer1(Message msg, Channel channel) { +// generate(msg, channel, "consumer 1"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer2(Message msg, Channel channel) { +// generate(msg, channel, "consumer 2"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer3(Message msg, Channel channel) { +// generate(msg, channel, "consumer 3"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer4(Message msg, Channel channel) { +// generate(msg, channel, "consumer 4"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer5(Message msg, Channel channel) { +// generate(msg, channel, "consumer 5"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer6(Message msg, Channel channel) { +// generate(msg, channel, "consumer 6"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer7(Message msg, Channel channel) { +// generate(msg, channel, "consumer 7"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer8(Message msg, Channel channel) { +// generate(msg, channel, "consumer 8"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer9(Message msg, Channel channel) { +// generate(msg, channel, "consumer 9"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) +// @RabbitHandler +// public void getGenerateResult(Message msg, Channel channel) { +// processGenerateResult(msg, channel); +// } } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index 6ad261bd..b8ba32f2 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } - @RabbitListener(queues = MQConfig.SR_QUEUE) - @RabbitHandler - public void SRConsumer1(Message msg, Channel channel) { - superResolution(msg, channel, "consumer 1"); - } - - - @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) - @RabbitHandler - public void SRResultConsumer1(Message msg, Channel channel) { - getSRResult(msg, channel, "consumer 1"); - } +// @RabbitListener(queues = MQConfig.SR_QUEUE) +// @RabbitHandler +// public void SRConsumer1(Message msg, Channel channel) { +// superResolution(msg, channel, "consumer 1"); +// } +// +// +// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) +// @RabbitHandler +// public void SRResultConsumer1(Message msg, Channel channel) { +// getSRResult(msg, channel, "consumer 1"); +// } } From 980e1547cd955e0062cb34f9c9a923ca35442836 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 21:07:20 +0800 Subject: [PATCH 22/35] =?UTF-8?q?TASK:=E6=A3=80=E6=9F=A5=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E9=87=8A;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/common/RabbitMQ/GenerateConsumer.java | 118 +++++++++--------- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 876dfd2c..3e8e6a6e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -154,63 +154,63 @@ public class GenerateConsumer { } -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer1(Message msg, Channel channel) { -// generate(msg, channel, "consumer 1"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer2(Message msg, Channel channel) { -// generate(msg, channel, "consumer 2"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer3(Message msg, Channel channel) { -// generate(msg, channel, "consumer 3"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer4(Message msg, Channel channel) { -// generate(msg, channel, "consumer 4"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer5(Message msg, Channel channel) { -// generate(msg, channel, "consumer 5"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer6(Message msg, Channel channel) { -// generate(msg, channel, "consumer 6"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer7(Message msg, Channel channel) { -// generate(msg, channel, "consumer 7"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer8(Message msg, Channel channel) { -// generate(msg, channel, "consumer 8"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer9(Message msg, Channel channel) { -// generate(msg, channel, "consumer 9"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) -// @RabbitHandler -// public void getGenerateResult(Message msg, Channel channel) { -// processGenerateResult(msg, channel); -// } + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer1(Message msg, Channel channel) { + generate(msg, channel, "consumer 1"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer2(Message msg, Channel channel) { + generate(msg, channel, "consumer 2"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer3(Message msg, Channel channel) { + generate(msg, channel, "consumer 3"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer4(Message msg, Channel channel) { + generate(msg, channel, "consumer 4"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer5(Message msg, Channel channel) { + generate(msg, channel, "consumer 5"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer6(Message msg, Channel channel) { + generate(msg, channel, "consumer 6"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer7(Message msg, Channel channel) { + generate(msg, channel, "consumer 7"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer8(Message msg, Channel channel) { + generate(msg, channel, "consumer 8"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer9(Message msg, Channel channel) { + generate(msg, channel, "consumer 9"); + } + + @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) + @RabbitHandler + public void getGenerateResult(Message msg, Channel channel) { + processGenerateResult(msg, channel); + } } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index b8ba32f2..6ad261bd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } -// @RabbitListener(queues = MQConfig.SR_QUEUE) -// @RabbitHandler -// public void SRConsumer1(Message msg, Channel channel) { -// superResolution(msg, channel, "consumer 1"); -// } -// -// -// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) -// @RabbitHandler -// public void SRResultConsumer1(Message msg, Channel channel) { -// getSRResult(msg, channel, "consumer 1"); -// } + @RabbitListener(queues = MQConfig.SR_QUEUE) + @RabbitHandler + public void SRConsumer1(Message msg, Channel channel) { + superResolution(msg, channel, "consumer 1"); + } + + + @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) + @RabbitHandler + public void SRResultConsumer1(Message msg, Channel channel) { + getSRResult(msg, channel, "consumer 1"); + } } From 6b07c84c80c00238bcfbdca46fd352992732893c Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 17 May 2024 21:14:39 +0800 Subject: [PATCH 23/35] =?UTF-8?q?TASK:=E6=A3=80=E6=9F=A5=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E9=87=8A;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 20d02502..e9d15e0d 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -69,7 +69,7 @@ spring.rabbitmq.virtual-host=/ spring.redis.host=172.31.11.32 #spring.redis.host=18.167.251.121 spring.redis.port=6379 -spring.redis.database=1 +spring.redis.database=2 spring.redis.password=Aidlab spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-idle=8 From b6704c3caf82a057abc5c2705d9501cd5c5945da Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 18 May 2024 00:34:18 +0800 Subject: [PATCH 24/35] =?UTF-8?q?TASK:=E5=8F=96=E6=B6=88=E7=9B=91=E5=90=AC?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/common/RabbitMQ/GenerateConsumer.java | 118 +++++++++--------- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 3e8e6a6e..876dfd2c 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -154,63 +154,63 @@ public class GenerateConsumer { } - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer1(Message msg, Channel channel) { - generate(msg, channel, "consumer 1"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer2(Message msg, Channel channel) { - generate(msg, channel, "consumer 2"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer3(Message msg, Channel channel) { - generate(msg, channel, "consumer 3"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer4(Message msg, Channel channel) { - generate(msg, channel, "consumer 4"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer5(Message msg, Channel channel) { - generate(msg, channel, "consumer 5"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer6(Message msg, Channel channel) { - generate(msg, channel, "consumer 6"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer7(Message msg, Channel channel) { - generate(msg, channel, "consumer 7"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer8(Message msg, Channel channel) { - generate(msg, channel, "consumer 8"); - } - - @RabbitListener(queues = MQConfig.GENERATE_QUEUE) - @RabbitHandler - public void generateConsumer9(Message msg, Channel channel) { - generate(msg, channel, "consumer 9"); - } - - @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) - @RabbitHandler - public void getGenerateResult(Message msg, Channel channel) { - processGenerateResult(msg, channel); - } +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer1(Message msg, Channel channel) { +// generate(msg, channel, "consumer 1"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer2(Message msg, Channel channel) { +// generate(msg, channel, "consumer 2"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer3(Message msg, Channel channel) { +// generate(msg, channel, "consumer 3"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer4(Message msg, Channel channel) { +// generate(msg, channel, "consumer 4"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer5(Message msg, Channel channel) { +// generate(msg, channel, "consumer 5"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer6(Message msg, Channel channel) { +// generate(msg, channel, "consumer 6"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer7(Message msg, Channel channel) { +// generate(msg, channel, "consumer 7"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer8(Message msg, Channel channel) { +// generate(msg, channel, "consumer 8"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) +// @RabbitHandler +// public void generateConsumer9(Message msg, Channel channel) { +// generate(msg, channel, "consumer 9"); +// } +// +// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) +// @RabbitHandler +// public void getGenerateResult(Message msg, Channel channel) { +// processGenerateResult(msg, channel); +// } } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index 6ad261bd..b8ba32f2 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } - @RabbitListener(queues = MQConfig.SR_QUEUE) - @RabbitHandler - public void SRConsumer1(Message msg, Channel channel) { - superResolution(msg, channel, "consumer 1"); - } - - - @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) - @RabbitHandler - public void SRResultConsumer1(Message msg, Channel channel) { - getSRResult(msg, channel, "consumer 1"); - } +// @RabbitListener(queues = MQConfig.SR_QUEUE) +// @RabbitHandler +// public void SRConsumer1(Message msg, Channel channel) { +// superResolution(msg, channel, "consumer 1"); +// } +// +// +// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) +// @RabbitHandler +// public void SRResultConsumer1(Message msg, Channel channel) { +// getSRResult(msg, channel, "consumer 1"); +// } } From b8048704ba2a2cf0b533251227b893ef0b1d7735 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 18 May 2024 01:00:42 +0800 Subject: [PATCH 25/35] =?UTF-8?q?TASK:=E7=9B=91=E5=90=AC;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/common/RabbitMQ/GenerateConsumer.java | 118 +++++++++--------- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- .../resources/application-prod.properties | 6 +- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 876dfd2c..3e8e6a6e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -154,63 +154,63 @@ public class GenerateConsumer { } -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer1(Message msg, Channel channel) { -// generate(msg, channel, "consumer 1"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer2(Message msg, Channel channel) { -// generate(msg, channel, "consumer 2"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer3(Message msg, Channel channel) { -// generate(msg, channel, "consumer 3"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer4(Message msg, Channel channel) { -// generate(msg, channel, "consumer 4"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer5(Message msg, Channel channel) { -// generate(msg, channel, "consumer 5"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer6(Message msg, Channel channel) { -// generate(msg, channel, "consumer 6"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer7(Message msg, Channel channel) { -// generate(msg, channel, "consumer 7"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer8(Message msg, Channel channel) { -// generate(msg, channel, "consumer 8"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer9(Message msg, Channel channel) { -// generate(msg, channel, "consumer 9"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) -// @RabbitHandler -// public void getGenerateResult(Message msg, Channel channel) { -// processGenerateResult(msg, channel); -// } + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer1(Message msg, Channel channel) { + generate(msg, channel, "consumer 1"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer2(Message msg, Channel channel) { + generate(msg, channel, "consumer 2"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer3(Message msg, Channel channel) { + generate(msg, channel, "consumer 3"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer4(Message msg, Channel channel) { + generate(msg, channel, "consumer 4"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer5(Message msg, Channel channel) { + generate(msg, channel, "consumer 5"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer6(Message msg, Channel channel) { + generate(msg, channel, "consumer 6"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer7(Message msg, Channel channel) { + generate(msg, channel, "consumer 7"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer8(Message msg, Channel channel) { + generate(msg, channel, "consumer 8"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer9(Message msg, Channel channel) { + generate(msg, channel, "consumer 9"); + } + + @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) + @RabbitHandler + public void getGenerateResult(Message msg, Channel channel) { + processGenerateResult(msg, channel); + } } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index b8ba32f2..6ad261bd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } -// @RabbitListener(queues = MQConfig.SR_QUEUE) -// @RabbitHandler -// public void SRConsumer1(Message msg, Channel channel) { -// superResolution(msg, channel, "consumer 1"); -// } -// -// -// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) -// @RabbitHandler -// public void SRResultConsumer1(Message msg, Channel channel) { -// getSRResult(msg, channel, "consumer 1"); -// } + @RabbitListener(queues = MQConfig.SR_QUEUE) + @RabbitHandler + public void SRConsumer1(Message msg, Channel channel) { + superResolution(msg, channel, "consumer 1"); + } + + + @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) + @RabbitHandler + public void SRResultConsumer1(Message msg, Channel channel) { + getSRResult(msg, channel, "consumer 1"); + } } diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index e9d15e0d..67ed6466 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -66,10 +66,10 @@ spring.rabbitmq.username=rabbit spring.rabbitmq.password=123456 spring.rabbitmq.virtual-host=/ -spring.redis.host=172.31.11.32 -#spring.redis.host=18.167.251.121 +#spring.redis.host=172.31.11.32 +spring.redis.host=18.167.251.121 spring.redis.port=6379 -spring.redis.database=2 +spring.redis.database=1 spring.redis.password=Aidlab spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-idle=8 From bf072e35f5762ca23ab474a81539b8f58cb3238b Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 18 May 2024 01:16:15 +0800 Subject: [PATCH 26/35] =?UTF-8?q?TASK:=E7=9B=91=E5=90=AC;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 67ed6466..20d02502 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -66,8 +66,8 @@ spring.rabbitmq.username=rabbit spring.rabbitmq.password=123456 spring.rabbitmq.virtual-host=/ -#spring.redis.host=172.31.11.32 -spring.redis.host=18.167.251.121 +spring.redis.host=172.31.11.32 +#spring.redis.host=18.167.251.121 spring.redis.port=6379 spring.redis.database=1 spring.redis.password=Aidlab From 14c99f6c6b06fa5b1527f2302653304ab00e28bc Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 18 May 2024 01:31:26 +0800 Subject: [PATCH 27/35] =?UTF-8?q?TASK:=E7=9B=91=E5=90=AC;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 3e8e6a6e..4e576307 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -116,7 +116,7 @@ public class GenerateConsumer { try { log.info("tasks_id : {} start ", generateResult.get("tasks_id")); if (generateResult.get("status").equals("SUCCESS")) { - String url = generateResult.get("image_url"); + String url = generateResult.get("data"); String taskId = generateResult.get("tasks_id"); String category = generateResult.get("category"); generateService.processGenerateResult(taskId, url, category); From 8f5a86db0bd93957822a61c7f69988df2bac84f0 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 18 May 2024 08:19:55 +0800 Subject: [PATCH 28/35] =?UTF-8?q?TASK:=E7=9B=91=E5=90=AC;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 4e576307..3e8e6a6e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -116,7 +116,7 @@ public class GenerateConsumer { try { log.info("tasks_id : {} start ", generateResult.get("tasks_id")); if (generateResult.get("status").equals("SUCCESS")) { - String url = generateResult.get("data"); + String url = generateResult.get("image_url"); String taskId = generateResult.get("tasks_id"); String category = generateResult.get("category"); generateService.processGenerateResult(taskId, url, category); From 6e64eb741a3be378bf4694b5a36407cfe62f38f8 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Mon, 20 May 2024 22:32:45 +0800 Subject: [PATCH 29/35] =?UTF-8?q?TASK:=E9=82=AE=E7=AE=B1;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index d8340592..57300f41 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -482,7 +482,7 @@ public class AccountServiceImpl extends ServiceImpl impl } // 先检测用户名和邮箱 QueryWrapper qw = new QueryWrapper<>(); - qw.eq("BINARY email", accountTrialDTO.getEmail()); + qw.eq("BINARY user_email", accountTrialDTO.getEmail()); List accountList = accountMapper.selectList(qw); if (CollectionUtil.isNotEmpty(accountList)) { if (accountList.get(0).getIsTrial() == 1) { @@ -558,7 +558,7 @@ public class AccountServiceImpl extends ServiceImpl impl trialOrderMapper.updateById(trialOrder); QueryWrapper qw = new QueryWrapper<>(); - qw.eq("BINARY email", trialOrder.getEmail()); + qw.eq("BINARY user_email", trialOrder.getEmail()); List accountList = accountMapper.selectList(qw); Account account = new Account(); From e40401f61f0902ddece12e982a06c0b3eedd8390 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 21 May 2024 14:27:17 +0800 Subject: [PATCH 30/35] =?UTF-8?q?paypal=20webhook=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/paypal-sandbox.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/paypal-sandbox.properties b/src/main/resources/paypal-sandbox.properties index 3b0eaef2..e6c46b5e 100644 --- a/src/main/resources/paypal-sandbox.properties +++ b/src/main/resources/paypal-sandbox.properties @@ -20,4 +20,5 @@ paypal.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2V paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc paypal.receiver.email=kimwong@code-create.com.hk paypal.mode=live -paypal.webhook_id=41L14847MC833625B \ No newline at end of file +#paypal.webhook_id=41L14847MC833625B +paypal.webhook_id=1D107312EX592781K \ No newline at end of file From 2845c2c8b913cacc2f0c1c154494dc89507fed3c Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 22 May 2024 10:26:29 +0800 Subject: [PATCH 31/35] BUGFIX:male_top; --- src/main/java/com/ai/da/python/PythonService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index eaa1c786..d8c9cab9 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -673,7 +673,7 @@ public class PythonService { } if (attributeRetrievalAttrDict.getOpeningType() != null) { nonNullFields.add("openingType"); - if (tableName.equals("male_outwear")) { + if (tableName.equals("male_outwear") || tableName.equals("male_top")) { nonNullFields.remove("openingType"); attributeRetrievalAttrDict.setOpeningType(null); } From 205f0d54c52498400d92006b1a4a59eddd158f25 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 22 May 2024 14:09:16 +0800 Subject: [PATCH 32/35] BUGFIX:workspace; --- .../ai/da/controller/WorkspaceController.java | 4 ++-- .../com/ai/da/service/WorkspaceService.java | 2 +- .../da/service/impl/WorkspaceServiceImpl.java | 23 +++++++++++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/controller/WorkspaceController.java b/src/main/java/com/ai/da/controller/WorkspaceController.java index b0c089f0..d44abf2e 100644 --- a/src/main/java/com/ai/da/controller/WorkspaceController.java +++ b/src/main/java/com/ai/da/controller/WorkspaceController.java @@ -44,8 +44,8 @@ public class WorkspaceController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入workspace") - public Response detail(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) { - Workspace detail = workspaceService.getByIdNew(id); + public Response detail(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) { + WorkspaceVO detail = workspaceService.getByIdNew(id); return Response.success(detail); } diff --git a/src/main/java/com/ai/da/service/WorkspaceService.java b/src/main/java/com/ai/da/service/WorkspaceService.java index 17a66f29..a60395ca 100644 --- a/src/main/java/com/ai/da/service/WorkspaceService.java +++ b/src/main/java/com/ai/da/service/WorkspaceService.java @@ -35,7 +35,7 @@ public interface WorkspaceService extends IService { List getEnumValues(String enumName); - Workspace getByIdNew(Long id); + WorkspaceVO getByIdNew(Long id); List getMannequins(String sex); diff --git a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java index 6d1478ec..34b7bf9a 100644 --- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java @@ -249,7 +249,7 @@ public class WorkspaceServiceImpl extends ServiceImpl qwOld = new QueryWrapper<>(); qwOld.lambda().eq(Workspace::getAccountId, accountId); @@ -260,7 +260,26 @@ public class WorkspaceServiceImpl extends ServiceImpl Date: Wed, 22 May 2024 15:12:37 +0800 Subject: [PATCH 33/35] BUGFIX:design; --- src/main/java/com/ai/da/python/PythonService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index d8c9cab9..37c292d4 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -959,7 +959,7 @@ public class PythonService { QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Dressing::getApparel, validateElementVO.getModelSex()); if (validateElementVO.getSingleOverall().equals(SingleOverallEnum.SINGLE.getRealName())) { - qw.lambda().eq(Dressing::getApparel, validateElementVO.getSwitchCategory()); + qw.lambda().eq(Dressing::getStyleCategory, validateElementVO.getSwitchCategory()); } List dressings = dressingMapper.selectList(qw); if (CollectionUtil.isEmpty(dressings)) { From 02b3a407a99920e14217f2840b6635cf369f30b5 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 23 May 2024 16:38:40 +0800 Subject: [PATCH 34/35] =?UTF-8?q?BUGFIX:=E8=89=B2=E5=9D=97=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/model/vo/CollectionColorVO.java | 2 ++ .../java/com/ai/da/model/vo/UserLikeCollectionVO.java | 2 ++ src/main/java/com/ai/da/python/PythonService.java | 2 +- .../da/service/impl/CollectionElementServiceImpl.java | 10 +++++----- .../com/ai/da/service/impl/CollectionServiceImpl.java | 7 +++++++ 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/model/vo/CollectionColorVO.java b/src/main/java/com/ai/da/model/vo/CollectionColorVO.java index 057cca64..475e159a 100644 --- a/src/main/java/com/ai/da/model/vo/CollectionColorVO.java +++ b/src/main/java/com/ai/da/model/vo/CollectionColorVO.java @@ -3,10 +3,12 @@ package com.ai.da.model.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import javax.validation.constraints.NotBlank; @Data +@EqualsAndHashCode @ApiModel("设计Collection颜色板 响应") public class CollectionColorVO { diff --git a/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java b/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java index 4e5f5721..ac87037f 100644 --- a/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java +++ b/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java @@ -3,10 +3,12 @@ package com.ai.da.model.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.List; @Data +@EqualsAndHashCode @ApiModel("用户关联的collection-响应") public class UserLikeCollectionVO { diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 37c292d4..9c00eb84 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -673,7 +673,7 @@ public class PythonService { } if (attributeRetrievalAttrDict.getOpeningType() != null) { nonNullFields.add("openingType"); - if (tableName.equals("male_outwear") || tableName.equals("male_top")) { + if (tableName.equals("male_outwear") || tableName.equals("male_top") || tableName.equals("male_bottom")) { nonNullFields.remove("openingType"); attributeRetrievalAttrDict.setOpeningType(null); } diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index fc1455ec..dccabd81 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -187,11 +187,11 @@ public class CollectionElementServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.in("id", ids); - CollectionElement collectionElement = new CollectionElement(); - collectionElement.setCollectionId(0L); - collectionElementMapper.update(collectionElement, queryWrapper); +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.in("id", ids); +// CollectionElement collectionElement = new CollectionElement(); +// collectionElement.setCollectionId(0L); + collectionElementMapper.deleteBatchIds(ids); } @Override diff --git a/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java index 6b911d49..6cd25d76 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java @@ -1,5 +1,6 @@ package com.ai.da.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.ai.da.common.config.exception.BusinessException; import com.ai.da.common.enums.CollectionLevel1TypeEnum; import com.ai.da.common.enums.DesignTypeEnum; @@ -129,6 +130,12 @@ public class CollectionServiceImpl extends ServiceImpl collect = response.getColorBoards().stream() + .distinct() + .collect(Collectors.toList()); + response.setColorBoards(collect); + } return response; } From 37de7d927613068a2fa29fa67d60d39c4784ff3d Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 24 May 2024 15:18:01 +0800 Subject: [PATCH 35/35] BUGFIX:design; --- .../com/ai/da/service/impl/DesignServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index f5fe6222..05365f52 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -300,7 +300,7 @@ public class DesignServiceImpl extends ServiceImpl impleme //generate转化为collection(生成) saveCollectionElemntsByGenerates(elementVO, collectionId); //保存颜色版 - List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); + collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); //保存design Long designId = saveOne(designDTO, collectionId, userInfo.getId()); //计算library @@ -725,8 +725,10 @@ public class DesignServiceImpl extends ServiceImpl impleme DesignCollectionDTO designCollectionDTO = CopyUtil.copyObject(reDesignDTO, DesignCollectionDTO.class); ValidateElementVO elementVO = collectionElementService.validateElement(designCollectionDTO); //计算并删除对应的未关联的element - collectionElementService.batchDelete( - calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds())); + List longs = calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds()); + if (!CollectionUtils.isEmpty(longs)) { + collectionElementService.batchDelete(longs); + } Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId()); //删除老的关联的design deleteByCollectionId(reDesignDTO.getCollectionId()); @@ -740,7 +742,8 @@ public class DesignServiceImpl extends ServiceImpl impleme private List calculateNoRelationElement(Long collectionId, List usedElementIds) { List collectionElements = collectionElementService.getByCollectionId(collectionId); if (CollectionUtils.isEmpty(collectionElements)) { - throw new BusinessException("get collection elements cannot be empty"); +// throw new BusinessException("get collection elements cannot be empty"); + return new ArrayList<>(); } if (CollectionUtils.isEmpty(usedElementIds)) { return collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toList());