added auth crawler

This commit is contained in:
snoop 2017-08-30 19:50:08 +09:00
parent 9eec640d32
commit 7621db7035
3 changed files with 33 additions and 1 deletions

View File

@ -2,6 +2,9 @@ package com.loafle.overflow.module.auth.service;
import com.loafle.overflow.module.auth.dao.AuthCrawlerDAO;
import com.loafle.overflow.module.auth.model.AuthCrawler;
import com.loafle.overflow.module.infra.model.Infra;
import com.loafle.overflow.module.infra.service.InfraService;
import com.loafle.overflow.module.meta.model.MetaCrawler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,7 +17,19 @@ public class AuthCrawlerService {
@Autowired
private AuthCrawlerDAO authCrawlerDAO;
@Autowired
private InfraService infraService;
public AuthCrawler regist(AuthCrawler authCrawler) {
return this.authCrawlerDAO.save(authCrawler);
}
public boolean checkAuthCrawler(long infraId, MetaCrawler crawler, String authJson) {
Infra infra = this.infraService.read(infraId);
// FIXME: Check Crawler
return false;
}
}

View File

@ -98,7 +98,7 @@ public class SensorService {
}
@Transactional
public Sensor registSensorConfig(Sensor sensor, List<SensorItem> sensorItemList) {
public Sensor registSensorConfig(Sensor sensor, List<SensorItem> sensorItemList, String etcJson) {
this.sensorDAO.save(sensor);

View File

@ -16,6 +16,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by insanity on 17. 6. 28.
@ -70,6 +72,21 @@ public class SensorServiceTest {
}
@Test
public void testJsonToMap() throws IOException {
String json = "{\"interval\":5}";
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> mm = new HashMap<>();
mm = objectMapper.readValue(json, HashMap.class);
System.out.println(mm.get("interval"));
}
// @Test
// public void readAllByTarget() throws Exception {
// Target target = new Target();