refactor(core): 统一使用产品名称替换产品ID

将 ApplePurchaseServiceImpl、GooglePlayEntitlementApplier 与 GooglePlayWalletBenefitService 中记录的 productId 改为 productName,保持日志与业务语义一致。
This commit is contained in:
2026-04-09 14:04:26 +08:00
parent 9b4819900d
commit 52727dfd7c
3 changed files with 4 additions and 4 deletions

View File

@@ -177,7 +177,7 @@ public class GooglePlayEntitlementApplier {
entitlement.setActive(true); entitlement.setActive(true);
return; return;
} }
walletBenefitService.grant(userId, order.getId(), product.getProductId(), amount); walletBenefitService.grant(userId, order.getId(), product.getName(), amount);
entitlement.setActive(true); entitlement.setActive(true);
entitlement.setQuantity(amount); entitlement.setQuantity(amount);
entitlement.setStartTime(new Date()); entitlement.setStartTime(new Date());

View File

@@ -20,7 +20,7 @@ public class GooglePlayWalletBenefitService {
private final KeyboardUserWalletService walletService; private final KeyboardUserWalletService walletService;
private final KeyboardWalletTransactionService walletTransactionService; private final KeyboardWalletTransactionService walletTransactionService;
public void grant(Long userId, Long orderId, String productId, BigDecimal amount) { public void grant(Long userId, Long orderId, String productName, BigDecimal amount) {
KeyboardUserWallet wallet = getOrCreateWallet(userId); KeyboardUserWallet wallet = getOrCreateWallet(userId);
BigDecimal before = defaultBalance(wallet.getBalance()); BigDecimal before = defaultBalance(wallet.getBalance());
BigDecimal after = before.add(amount); BigDecimal after = before.add(amount);
@@ -28,7 +28,7 @@ public class GooglePlayWalletBenefitService {
wallet.setUpdatedAt(new Date()); wallet.setUpdatedAt(new Date());
walletService.saveOrUpdate(wallet); walletService.saveOrUpdate(wallet);
walletTransactionService.createTransaction(userId, orderId, amount, GOOGLE_PLAY_WALLET_TX_TYPE, walletTransactionService.createTransaction(userId, orderId, amount, GOOGLE_PLAY_WALLET_TX_TYPE,
before, after, productId); before, after, productName);
} }
public boolean revoke(Long userId, Long orderId, BigDecimal amount) { public boolean revoke(Long userId, Long orderId, BigDecimal amount) {

View File

@@ -783,7 +783,7 @@ public class ApplePurchaseServiceImpl implements ApplePurchaseService {
(short) 2, // 交易类型2-苹果内购充值 (short) 2, // 交易类型2-苹果内购充值
before, before,
after, after,
product.getProductId() product.getName()
); );
// 8. 记录充值成功日志 // 8. 记录充值成功日志