diff --git a/.gitignore b/.gitignore index ccc7c08..9a20abc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ hs_err_pid* .idea/ *.iml -target/ \ No newline at end of file +/target/ \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/noauthagent/model/NoAuthAgent.java b/src/main/java/com/loafle/overflow/noauthagent/model/NoAuthAgent.java index 524cf58..67d262a 100644 --- a/src/main/java/com/loafle/overflow/noauthagent/model/NoAuthAgent.java +++ b/src/main/java/com/loafle/overflow/noauthagent/model/NoAuthAgent.java @@ -1,5 +1,7 @@ package com.loafle.overflow.noauthagent.model; +import com.loafle.overflow.noauthagent.type.AuthType; + import javax.persistence.*; import java.util.Date; diff --git a/src/main/java/com/loafle/overflow/noauthagent/model/AuthType.java b/src/main/java/com/loafle/overflow/noauthagent/type/AuthType.java similarity index 85% rename from src/main/java/com/loafle/overflow/noauthagent/model/AuthType.java rename to src/main/java/com/loafle/overflow/noauthagent/type/AuthType.java index 8a519c1..0abca85 100644 --- a/src/main/java/com/loafle/overflow/noauthagent/model/AuthType.java +++ b/src/main/java/com/loafle/overflow/noauthagent/type/AuthType.java @@ -1,4 +1,4 @@ -package com.loafle.overflow.noauthagent.model; +package com.loafle.overflow.noauthagent.type; /** * Created by root on 17. 5. 31. diff --git a/src/main/java/com/loafle/overflow/target/model/Target.java b/src/main/java/com/loafle/overflow/target/model/Target.java new file mode 100644 index 0000000..6870b70 --- /dev/null +++ b/src/main/java/com/loafle/overflow/target/model/Target.java @@ -0,0 +1,38 @@ +package com.loafle.overflow.target.model; + +import com.loafle.overflow.target.type.TargetType; + +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 5. + */ +@Entity +public class Target { + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + private Long id; + + @Column(name="TEMP_KEY", unique=true, nullable=false) + private String tempKey; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="DATE", nullable=false) + private Date date; + + @Column(name="API_KEY", unique = true, nullable=false) + private String apiKey; + + @Column(name="AUTH_STATUS", nullable=false) + @Enumerated(EnumType.STRING) + private TargetType authStatus; + + @Column(name="LOCAL_IP", nullable=false) + private long localIP; + + @Column(name="HOST_NAME") + private String hostName; + +} diff --git a/src/main/java/com/loafle/overflow/target/type/TargetType.java b/src/main/java/com/loafle/overflow/target/type/TargetType.java new file mode 100644 index 0000000..159b368 --- /dev/null +++ b/src/main/java/com/loafle/overflow/target/type/TargetType.java @@ -0,0 +1,21 @@ +package com.loafle.overflow.target.type; + +/** + * Created by root on 17. 6. 5. + */ +public enum TargetType { + + MACHINE("MACHINE"), + DATABASE("DATABASE"), + WAS("WAS"), + OTHER("OTHER"); + + private String stringValue; + TargetType(String string) {stringValue = string;} + + @Override + public String toString() { + return stringValue; + } + +}