fix(p1r): 移除余额快照未声明响应字段
This commit is contained in:
parent
46194eec91
commit
ea44af47a0
@ -273,7 +273,6 @@ public class AccountEntitlementServiceImpl implements AccountEntitlementService
|
||||
vo.setTotalQuota(toInt(snapshot.getTotalAmount()));
|
||||
vo.setExpiresAt(snapshotExpiresAt(snapshot.getSnapshot()));
|
||||
vo.setCapturedAt(snapshot.getSnapshotAt());
|
||||
vo.setSource(snapshot.getSourceType());
|
||||
}
|
||||
|
||||
private void fillBalanceSnapshot(AppBalanceSnapshotEntryRespVO vo, AccountBalanceSnapshotDO snapshot) {
|
||||
@ -284,7 +283,6 @@ public class AccountEntitlementServiceImpl implements AccountEntitlementService
|
||||
vo.setTotalQuota(toInt(snapshot.getTotalAmount()));
|
||||
vo.setExpiresAt(snapshotExpiresAt(snapshot.getSnapshot()));
|
||||
vo.setCapturedAt(snapshot.getSnapshotAt());
|
||||
vo.setSource(snapshot.getSourceType());
|
||||
}
|
||||
|
||||
private MemberEntitlementAuditLogDO latestLog(List<MemberEntitlementAuditLogDO> logs) {
|
||||
|
||||
@ -24,7 +24,5 @@ public class AdminBalanceSnapshotEntryRespVO {
|
||||
private LocalDateTime expiresAt;
|
||||
@Schema(description = "快照捕获时间")
|
||||
private LocalDateTime capturedAt;
|
||||
@Schema(description = "快照来源")
|
||||
private String source;
|
||||
|
||||
}
|
||||
|
||||
@ -24,7 +24,5 @@ public class AppBalanceSnapshotEntryRespVO {
|
||||
private LocalDateTime expiresAt;
|
||||
@Schema(description = "快照捕获时间")
|
||||
private LocalDateTime capturedAt;
|
||||
@Schema(description = "快照来源")
|
||||
private String source;
|
||||
|
||||
}
|
||||
|
||||
@ -158,10 +158,17 @@ class AccountEntitlementServiceTest extends BaseMockitoUnitTest {
|
||||
assertEquals(BigDecimal.valueOf(80), page.getList().get(0).getBalance());
|
||||
assertEquals(40, page.getList().get(0).getUsedQuota());
|
||||
assertEquals(120, page.getList().get(0).getTotalQuota());
|
||||
assertEquals("quota_adjustment", page.getList().get(0).getSource());
|
||||
verifyNoInteractions(entitlementMapper, quotaMapper);
|
||||
}
|
||||
|
||||
@Test
|
||||
void should_notExposeSourceField_whenBalanceSnapshotResponseSerialized() {
|
||||
assertThrows(NoSuchFieldException.class,
|
||||
() -> AdminBalanceSnapshotEntryRespVO.class.getDeclaredField("source"));
|
||||
assertThrows(NoSuchFieldException.class,
|
||||
() -> AppBalanceSnapshotEntryRespVO.class.getDeclaredField("source"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void should_listAppBalanceSnapshots_forCurrentUserOnly() {
|
||||
PageParam pageParam = pageParam();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user