Collector

This commit is contained in:
insanity 2016-11-15 18:55:51 +09:00
parent 25485fea7e
commit 1db6a3ae7b
2 changed files with 113 additions and 2 deletions

View File

@ -1,7 +1,112 @@
package com.loafle.bridge.collector.entity;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 16. 11. 15.
*/
public class Collector {
enum License {
LICENSE1,
LICENSE2,
LICENSE3,
LICENSE4,
LICENSE5;
}
@Entity
public class Collector {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(nullable = false)
private String productId;
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false)
private Date installedDate;
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
private Date updatedDate;
@Enumerated(EnumType.STRING)
private License licenseType;
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
private Date licenseDueDate;
@Column(nullable = false)
private String configPath;
@Column(nullable = false)
private String collectorVersion;
public Collector() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public Date getInstalledDate() {
return installedDate;
}
public void setInstalledDate(Date installedDate) {
this.installedDate = installedDate;
}
public License getLicenseType() {
return licenseType;
}
public void setLicenseType(License licenseType) {
this.licenseType = licenseType;
}
public Date getLicenseDueDate() {
return licenseDueDate;
}
public void setLicenseDueDate(Date licenseDueDate) {
this.licenseDueDate = licenseDueDate;
}
public String getConfigPath() {
return configPath;
}
public void setConfigPath(String configPath) {
this.configPath = configPath;
}
public String getCollectorVersion() {
return collectorVersion;
}
public void setCollectorVersion(String collectorVersion) {
this.collectorVersion = collectorVersion;
}
public Date getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
}

View File

@ -1,7 +1,13 @@
package com.loafle.bridge.collector.repository;
import com.loafle.bridge.collector.entity.Collector;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
/**
* Created by root on 16. 11. 15.
*/
public class CollectorRepository {
@RepositoryRestResource(collectionResourceRel = "collector", path = "collector")
public interface CollectorRepository extends JpaRepository<Collector, Long> {
}