feat(web): 增加数据资源定义
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
package com.eshore.gringotts.web.domain.resource.entity;
|
||||||
|
|
||||||
|
import com.eshore.gringotts.core.Constants;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EntityListeners;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Entity
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
@Table(name = Constants.TABLE_PREFIX + "data_resource_api")
|
||||||
|
public class ApiResource extends DataResource {
|
||||||
|
private String url;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.eshore.gringotts.web.domain.resource.entity;
|
||||||
|
|
||||||
|
import com.eshore.gringotts.core.Constants;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.DiscriminatorColumn;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EntityListeners;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Inheritance;
|
||||||
|
import javax.persistence.InheritanceType;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Entity
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
@Table(name = Constants.TABLE_PREFIX + "data_resource")
|
||||||
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
|
public class DataResource {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(generator = "snowflake")
|
||||||
|
@GenericGenerator(name = "snowflake", strategy = "com.eshore.gringotts.web.configuration.SnowflakeIdGenerator")
|
||||||
|
private Long id;
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
@CreatedDate
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
@LastModifiedDate
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.eshore.gringotts.web.domain.resource.entity;
|
||||||
|
|
||||||
|
import com.eshore.gringotts.core.Constants;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EntityListeners;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Entity
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
@Table(name = Constants.TABLE_PREFIX + "data_resource_dataset")
|
||||||
|
public class DatasetResource extends DataResource{
|
||||||
|
private String path;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user