【代码优化】SYSTEM:微信小程序的订阅

This commit is contained in:
YunaiV
2024-07-31 19:48:02 +08:00
parent 1f65dd2ec9
commit ba18788517
10 changed files with 26 additions and 22 deletions

View File

@ -7,8 +7,8 @@ package cn.iocoder.yudao.module.pay.enums;
*/
public interface MessageTemplateConstants {
//======================= 小程序订阅消息 =======================
// ======================= 小程序订阅消息 =======================
String WALLET_RECHARGER_PAID = "充值成功通知";
String WXA_WALLET_RECHARGER_PAID = "充值成功通知";
}

View File

@ -39,7 +39,7 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString
import static cn.iocoder.yudao.framework.common.util.number.MoneyUtils.fenToYuanStr;
import static cn.iocoder.yudao.module.pay.convert.wallet.PayWalletRechargeConvert.INSTANCE;
import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.pay.enums.MessageTemplateConstants.WALLET_RECHARGER_PAID;
import static cn.iocoder.yudao.module.pay.enums.MessageTemplateConstants.WXA_WALLET_RECHARGER_PAID;
import static cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum.*;
/**
@ -147,7 +147,7 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
// 2. 构建并发送模版消息
socialClientApi.sendWxaSubscribeMessage(new SocialWxaSubscribeMessageSendReqDTO()
.setUserId(wallet.getUserId()).setUserType(wallet.getUserType())
.setTemplateTitle(WALLET_RECHARGER_PAID)
.setTemplateTitle(WXA_WALLET_RECHARGER_PAID)
.setPage("pages/user/wallet/money") // 钱包详情界面
.addMessage("character_string1", String.valueOf(payOrderId)) // 支付单编号
.addMessage("amount2", fenToYuanStr(walletRecharge.getTotalPrice())) // 充值金额