refactor(core): 统一使用产品名称替换产品ID
将 ApplePurchaseServiceImpl、GooglePlayEntitlementApplier 与 GooglePlayWalletBenefitService 中记录的 productId 改为 productName,保持日志与业务语义一致。
This commit is contained in:
@@ -177,7 +177,7 @@ public class GooglePlayEntitlementApplier {
|
||||
entitlement.setActive(true);
|
||||
return;
|
||||
}
|
||||
walletBenefitService.grant(userId, order.getId(), product.getProductId(), amount);
|
||||
walletBenefitService.grant(userId, order.getId(), product.getName(), amount);
|
||||
entitlement.setActive(true);
|
||||
entitlement.setQuantity(amount);
|
||||
entitlement.setStartTime(new Date());
|
||||
|
||||
@@ -20,7 +20,7 @@ public class GooglePlayWalletBenefitService {
|
||||
private final KeyboardUserWalletService walletService;
|
||||
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);
|
||||
BigDecimal before = defaultBalance(wallet.getBalance());
|
||||
BigDecimal after = before.add(amount);
|
||||
@@ -28,7 +28,7 @@ public class GooglePlayWalletBenefitService {
|
||||
wallet.setUpdatedAt(new Date());
|
||||
walletService.saveOrUpdate(wallet);
|
||||
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) {
|
||||
|
||||
@@ -783,7 +783,7 @@ public class ApplePurchaseServiceImpl implements ApplePurchaseService {
|
||||
(short) 2, // 交易类型:2-苹果内购充值
|
||||
before,
|
||||
after,
|
||||
product.getProductId()
|
||||
product.getName()
|
||||
);
|
||||
|
||||
// 8. 记录充值成功日志
|
||||
|
||||
Reference in New Issue
Block a user