Skip to content

Commit f2c3db6

Browse files
committed
fix: 修复Lombok @Builder.Default配置 - 在IdSegment的初始化字段上添加@Builder.Default注解 - 解决Lombok Builder警告和编译问题
1 parent eba0d21 commit f2c3db6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/layor/tinyflow/entity/IdSegment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ public class IdSegment {
2121
private String bizTag;
2222

2323
@Column(name = "max_id", nullable = false)
24+
@Builder.Default
2425
private long maxId = 1L;
2526

2627
@Column(name = "step", nullable = false)
28+
@Builder.Default
2729
private int step = 100_000;
2830

2931
@Column(name = "version", nullable = false)
32+
@Builder.Default
3033
private int version = 0;
3134

3235
@Column(name = "created_at", nullable = false)
36+
@Builder.Default
3337
private LocalDateTime createdAt = LocalDateTime.now();
3438

3539
@Column(name = "updated_at", nullable = false)
40+
@Builder.Default
3641
private LocalDateTime updatedAt = LocalDateTime.now();
3742
}

src/test/java/com/layor/tinyflow/Controller/ShortUrlControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ void testGetUrlClickStats_Success() throws Exception {
175175

176176
verify(shortUrlService, times(1)).getUrlClickStats();
177177
}
178-
}
178+
}

0 commit comments

Comments
 (0)