feat(商城): 代码优化

master
wayn 1 year ago
parent 76f46b09e5
commit d87a897f5b

@ -29,7 +29,7 @@ public class IMailServiceImpl implements IMailService {
map.put("tos", tos); map.put("tos", tos);
map.put("notifyUrl", notifyUrl); map.put("notifyUrl", notifyUrl);
// 异步发送邮件 // 异步发送邮件
rabbitTemplate.convertAndSend("EmailDirectExchange", "EmailDirectRouting", map, correlationData); rabbitTemplate.convertAndSend("email_direct_exchange", "email_direct_routing", map, correlationData);
} }
} }

@ -1,6 +1,7 @@
package com.wayn.mobile.api.service.impl; package com.wayn.mobile.api.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUnit;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alipay.api.AlipayApiException; import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient; import com.alipay.api.AlipayClient;
@ -383,7 +384,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
.build(); .build();
delayRabbitTemplate.convertAndSend(MQConstants.ORDER_DELAY_EXCHANGE, MQConstants.ORDER_DELAY_ROUTING, message, messagePostProcessor -> { delayRabbitTemplate.convertAndSend(MQConstants.ORDER_DELAY_EXCHANGE, MQConstants.ORDER_DELAY_ROUTING, message, messagePostProcessor -> {
// 延迟10s // 延迟10s
long delayTime = WaynConfig.getUnpaidOrderCancelDelayTime() * 1000L; long delayTime = WaynConfig.getUnpaidOrderCancelDelayTime() * DateUnit.MINUTE.getMillis();
messagePostProcessor.getMessageProperties().setDelay(Math.toIntExact(delayTime)); messagePostProcessor.getMessageProperties().setDelay(Math.toIntExact(delayTime));
return messagePostProcessor; return messagePostProcessor;
}); });

Loading…
Cancel
Save