mirror of https://github.com/halo-dev/halo
Refactor Option entity
parent
cd3a5845fa
commit
3100c9eb29
|
@ -1,6 +1,5 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Category entity.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.model.enums.CommentStatus;
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -9,7 +8,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Comment entity.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Link entity
|
||||
|
|
|
@ -2,7 +2,6 @@ package cc.ryanc.halo.model.entity;
|
|||
|
||||
|
||||
import cc.ryanc.halo.model.enums.LogType;
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -10,7 +9,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Log entity.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Menu entity
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Setting entity.
|
||||
|
@ -29,20 +27,27 @@ public class Option extends BaseEntity {
|
|||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设置项 Key
|
||||
* option key
|
||||
*/
|
||||
@Column(name = "option_key", columnDefinition = "varchar(100) not null")
|
||||
private String optionKey;
|
||||
|
||||
/**
|
||||
* 设置项 Value
|
||||
* option value
|
||||
*/
|
||||
@Column(name = "option_value", columnDefinition = "varchar(1023) not null")
|
||||
private String optionValue;
|
||||
|
||||
/**
|
||||
* source,default is system
|
||||
*/
|
||||
@Column(name = "source", columnDefinition = "varchar(127) default 'system'")
|
||||
private String source;
|
||||
|
||||
@Override
|
||||
public void prePersist() {
|
||||
super.prePersist();
|
||||
id = null;
|
||||
source = "system";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package cc.ryanc.halo.model.entity;
|
||||
|
||||
import cc.ryanc.halo.utils.DateUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,11 +5,8 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Tag entity
|
||||
|
|
Loading…
Reference in New Issue