History module

This commit is contained in:
insanity 2017-08-23 13:01:22 +09:00
parent 1e467e64c5
commit dc22b4777d
5 changed files with 39 additions and 6 deletions

View File

@ -1,10 +1,13 @@
package com.loafle.overflow.module.history.dao;
import com.loafle.overflow.module.history.model.History;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 8. 23.
*/
@Repository
public class HistoryDAO {
public interface HistoryDAO extends JpaRepository<History, Long> {
}

View File

@ -1,6 +1,6 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.meta.model.MetaHistoryType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository;
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaHistoryTypeDAO extends JpaRepository<MetaInfraType, Integer> {
public interface MetaHistoryTypeDAO extends JpaRepository<MetaHistoryType, Integer> {
}

View File

@ -7,7 +7,7 @@ import java.util.Date;
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INFRA_TYPE", schema = "public")
@Table(name = "META_HISTORY_TYPE", schema = "public")
public class MetaHistoryType {
private int id;
private String name;

View File

@ -1,7 +1,7 @@
package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.dao.MetaHistoryTypeDAO;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.meta.model.MetaHistoryType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -16,7 +16,7 @@ public class MetaHistoryTypeService {
@Autowired
private MetaHistoryTypeDAO hisotyTypeDAO;
public List<MetaInfraType> readAll() {
public List<MetaHistoryType> readAll() {
return this.hisotyTypeDAO.findAll();
}
}

View File

@ -0,0 +1,30 @@
package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaHistoryType;
import com.loafle.overflow.spring.AppConfigTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
/**
* Created by snoop on 17. 7. 27.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfigTest.class})
public class MetaHistoryTypeServiceTest {
@Autowired
private MetaHistoryTypeService historyTypeService;
@Test
public void readAll() throws Exception {
List<MetaHistoryType> historyTypes = this.historyTypeService.readAll();
}
}