Merge remote-tracking branch 'origin/master'

This commit is contained in:
geek 2017-06-26 15:59:58 +09:00
commit fc97953724
5 changed files with 65 additions and 31 deletions

View File

@ -43,7 +43,7 @@ public class MetaProbeTaskType {
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}

View File

@ -51,27 +51,6 @@ public class ProbeTask {
this.probe = probe;
}
// @Basic
// @Column(name = "TYPE_ID", nullable = false)
// public short getTypeId() {
// return typeId;
// }
//
// public void setTypeId(short typeId) {
// this.typeId = typeId;
// }
//
// @Basic
// @Column(name = "PROBE_ID", nullable = false)
// public long getProbeId() {
// return probeId;
// }
//
// public void setProbeId(long probeId) {
// this.probeId = probeId;
// }
@Basic
@Column(name = "DATA", nullable = true, length = 255)
public String getData() {
return data;
@ -81,8 +60,7 @@ public class ProbeTask {
this.data = data;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
@ -91,7 +69,6 @@ public class ProbeTask {
this.createDate = createDate;
}
@Basic
@Column(name = "SEND_DATE", nullable = true)
public Date getSendDate() {
return sendDate;
@ -101,7 +78,6 @@ public class ProbeTask {
this.sendDate = sendDate;
}
@Basic
@Column(name = "START_DATE", nullable = true)
public Date getStartDate() {
return startDate;
@ -111,7 +87,6 @@ public class ProbeTask {
this.startDate = startDate;
}
@Basic
@Column(name = "END_DATE", nullable = true)
public Date getEndDate() {
return endDate;
@ -121,7 +96,6 @@ public class ProbeTask {
this.endDate = endDate;
}
@Basic
@Column(name = "SUCCEED", nullable = true)
public Boolean getSucceed() {
return succeed;

View File

@ -5,6 +5,7 @@ import com.loafle.overflow.db.api.DBInput;
import com.loafle.overflow.db.api.DBOutput;
import com.loafle.overflow.module.domain.dao.DomainDAO;
import com.loafle.overflow.module.email.dao.EmailAuthDAO;
import com.loafle.overflow.module.infra.dao.*;
import com.loafle.overflow.module.member.dao.MemberDAO;
import com.loafle.overflow.module.noauthprobe.dao.NoAuthProbeDAO;
import com.loafle.overflow.module.probe.dao.ProbeDAO;
@ -42,14 +43,21 @@ public class DBProxy {
daoMap.put("member", ctx.getBean(MemberDAO.class));
daoMap.put("probe", ctx.getBean(ProbeDAO.class));
daoMap.put("noauthProbe", ctx.getBean(NoAuthProbeDAO.class));
daoMap.put("emailAuth", ctx.getBean(EmailAuthDAO.class));
daoMap.put("sensor", ctx.getBean(SensorDao.class));
daoMap.put("sensorItem", ctx.getBean(SensorItemDao.class));
daoMap.put("domain", ctx.getBean(DomainDAO.class));
daoMap.put("target", ctx.getBean(DomainDAO.class));
daoMap.put("infra", ctx.getBean(InfraDAO.class));
daoMap.put("infraHost", ctx.getBean(InfraHostDAO.class));
daoMap.put("infraMachine", ctx.getBean(InfraMachineDAO.class));
daoMap.put("infraOS", ctx.getBean(InfraOSDAO.class));
daoMap.put("infraOSApplication", ctx.getBean(InfraOSApplicationDAO.class));
daoMap.put("infraOSDaemon", ctx.getBean(InfraOSDaemonDAO.class));
daoMap.put("infraOSPort", ctx.getBean(InfraOSPortDAO.class));
daoMap.put("infraService", ctx.getBean(InfraServiceDAO.class));
// daoMap.put("target", targetDAO);
// daoMap.put("crawler", crawlerDAO);
// daoMap.put("crawlerInputItem", crawlerInputItemDAO);
// daoMap.put("crawlerInputItemMapping", crawlerInputItemMappingDAO);

View File

@ -238,4 +238,7 @@ INSERT INTO public.infra (id,child_id,create_date,type_id) VALUES (
1,0,'2017-06-26 12:12:11.809',1);
INSERT INTO public.target (id,create_date,infra_id,probe_id) VALUES (
1,'2017-06-26 12:37:22.854',1,1);
1,'2017-06-26 12:37:22.854',1,1);
INSERT INTO public.meta_probe_task_type (id,create_date,description,"name") VALUES (
1,'2017-06-26 15:58:02.397','DISCOVERY START','DISCOVERY');

View File

@ -0,0 +1,49 @@
package com.loafle.overflow.meta.dao;
import com.loafle.overflow.AppConfig;
import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.model.MetaProbeTaskType;
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.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created by snoop on 17. 6. 26.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
public class MetaProbeTaskTypeDAOTest {
@Autowired
private MetaProbeTaskTypeDAO metaProbeTaskTypeDAO;
@Test
public void Create() {
MetaProbeTaskType metaDiscovery = new MetaProbeTaskType();
metaDiscovery.setDescription("DISCOVERY START");
metaDiscovery.setName("DISCOVERY");
List<MetaProbeTaskType> pttlist = new ArrayList<>();
pttlist.add(metaDiscovery);
for(int indexI = 1; indexI <= pttlist.size() ;++indexI) {
MetaProbeTaskType type = pttlist.get(indexI - 1);
type.setId((short)indexI);
this.metaProbeTaskTypeDAO.save(type);
}
}
}