xiongzhu 3 years ago
parent
commit
6d83fbef80

+ 2 - 0
src/main/java/com/izouma/nineth/domain/BaseEntity.java

@@ -25,6 +25,8 @@ public abstract class BaseEntity {
     @ExcelProperty("ID")
     @ExcelProperty("ID")
     @Id
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO)
     @GeneratedValue(strategy = GenerationType.AUTO)
+//    @GeneratedValue(generator = "snowFlakeId")
+//    @GenericGenerator(name = "snowFlakeId", strategy = "com.izouma.nineth.utils.SnowflakeIdGenerator")
     private Long id;
     private Long id;
 
 
     @ExcelIgnore
     @ExcelIgnore

+ 7 - 1
src/main/java/com/izouma/nineth/domain/User.java

@@ -39,7 +39,13 @@ import java.util.Set;
 @NoArgsConstructor
 @NoArgsConstructor
 @Builder
 @Builder
 @ApiModel(value = "用户", description = "用户")
 @ApiModel(value = "用户", description = "用户")
-public class User extends BaseEntity implements Serializable {
+public class User extends BaseEntityNoID implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+//    @GeneratedValue(generator = "snowFlakeId")
+//    @GenericGenerator(name = "snowFlakeId", strategy = "com.izouma.nineth.utils.SnowflakeIdGenerator")
+    private Long id;
 
 
     //    @Pattern(regexp = Constants.Regex.USERNAME)
     //    @Pattern(regexp = Constants.Regex.USERNAME)
     @Size(min = 1, max = 50)
     @Size(min = 1, max = 50)