diff --git a/src/main/java/Application.java b/src/main/java/com/loafle/bridge/Application.java similarity index 97% rename from src/main/java/Application.java rename to src/main/java/com/loafle/bridge/Application.java index 5e4b74f..6f75650 100644 --- a/src/main/java/Application.java +++ b/src/main/java/com/loafle/bridge/Application.java @@ -1,4 +1,4 @@ -package hello; +package com.loafle.bridge; //import org.h2.server.web.WebServlet; diff --git a/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java b/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java index 570a73f..dc8eddb 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java +++ b/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java @@ -1,7 +1,71 @@ package com.loafle.bridge.discoveryport.entity; +import javax.persistence.*; +import java.util.Date; + /** * Created by root on 16. 11. 15. */ + +@Entity public class DiscoveryPort { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + @Column(nullable = false) + private String type; + + @Column(nullable = false) + private short portNumber; + + @Temporal(value = TemporalType.TIMESTAMP) + private Date createDate; + + @Temporal(value = TemporalType.TIMESTAMP) + private Date updateDate; + + public DiscoveryPort() { + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public short getPortNumber() { + return portNumber; + } + + public void setPortNumber(short portNumber) { + this.portNumber = portNumber; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } } diff --git a/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java b/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java new file mode 100644 index 0000000..9fb056f --- /dev/null +++ b/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java @@ -0,0 +1,7 @@ +package com.loafle.bridge.discoveryport.entity; + +/** + * Created by root on 16. 11. 15. + */ +public class ServiceScanHistory { +} diff --git a/src/main/java/com/loafle/bridge/discoveryport/repository/DiscoveryPortRepository.java b/src/main/java/com/loafle/bridge/discoveryport/repository/DiscoveryPortRepository.java index 1df4db2..537299d 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/repository/DiscoveryPortRepository.java +++ b/src/main/java/com/loafle/bridge/discoveryport/repository/DiscoveryPortRepository.java @@ -1,7 +1,13 @@ package com.loafle.bridge.discoveryport.repository; +import com.loafle.bridge.discoveryport.entity.DiscoveryPort; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + /** * Created by root on 16. 11. 15. */ -public class DiscoveryPortRepository { + +@RepositoryRestResource(collectionResourceRel = "discoveryPort", path = "discoveryPort") +public interface DiscoveryPortRepository extends JpaRepository{ } diff --git a/src/test/java/hello/HelloControllerTest.java b/src/test/java/hello/HelloControllerTest.java index d14446b..7cb72f8 100644 --- a/src/test/java/hello/HelloControllerTest.java +++ b/src/test/java/hello/HelloControllerTest.java @@ -2,6 +2,7 @@ package hello; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.loafle.bridge.Application; import hello.entity.Member; import hello.repository.MemberRepository; import org.apache.log4j.Logger; @@ -30,7 +31,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal */ @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = hello.Application.class) +@ContextConfiguration(classes = Application.class) @WebIntegrationTest public class HelloControllerTest { diff --git a/src/test/java/hello/repository/MemberRepositoryTest.java b/src/test/java/hello/repository/MemberRepositoryTest.java index 5dd8fab..a1ca9de 100644 --- a/src/test/java/hello/repository/MemberRepositoryTest.java +++ b/src/test/java/hello/repository/MemberRepositoryTest.java @@ -1,6 +1,6 @@ package hello.repository; -import hello.Application; +import com.loafle.bridge.Application; import hello.entity.Member; import org.junit.After; import org.junit.Before;