Merge branch 'release/3.0' into dev/dev_xp

# Conflicts:
#	src/main/java/com/ai/da/python/PythonService.java
#	src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java
This commit is contained in:
2024-06-11 15:23:24 +08:00
15 changed files with 74 additions and 64 deletions

View File

@@ -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() {
}

View File

@@ -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");
}
}

View File

@@ -34,7 +34,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<Account> qw = new QueryWrapper<>();
@@ -68,7 +68,7 @@ public class MyTaskScheduler {
}
}
}
// @Scheduled(cron = "0 0 8 * * ?")
@Scheduled(cron = "0 0 8 * * ?")
public void sendTrialOrderExcelToManagements() {
// 获取前一天日期
LocalDate yesterday = LocalDate.now().minusDays(1);

View File

@@ -23,7 +23,7 @@ public class PaypalTask {
@Resource
private PayPalCheckoutService payPalCheckoutService;
// @Scheduled(cron = "0/30 * * * * ?")
@Scheduled(cron = "0/30 * * * * ?")
public void orderConfirm() throws SerializeException {
log.info("PayPal orderConfirm 被执行......");

View File

@@ -136,7 +136,7 @@ public class SendEmailUtil {
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) {
public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country, boolean link) {
try {
// 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
@@ -173,7 +173,7 @@ public class SendEmailUtil {
}else {
template.setTemplateID(NOTIFICATION_TEMPLATE_ID);
}
template.setTemplateData(buildNotificationData(trialOrder));
template.setTemplateData(buildNotificationData(trialOrder, link));
break;
default:
break;
@@ -345,7 +345,7 @@ public class SendEmailUtil {
}
// 构建试用订单通过通知数据
private static String buildNotificationData(TrialOrder trialOrder) {
private static String buildNotificationData(TrialOrder trialOrder, boolean link) {
JSONObject jsonObject = new JSONObject();
// 设置试用订单通过通知相关数据
jsonObject.put("title", trialOrder.getTitle());
@@ -353,6 +353,11 @@ public class SendEmailUtil {
jsonObject.put("givenName", trialOrder.getGivenName());
jsonObject.put("userName", trialOrder.getUserName());
jsonObject.put("email", trialOrder.getEmail());
if (link) {
jsonObject.put("days", 14);
}else {
jsonObject.put("days", 5);
}
return jsonObject.toJSONString();
}