diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/Report.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/Report.java new file mode 100644 index 00000000..91eb8dcf --- /dev/null +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/Report.java @@ -0,0 +1,33 @@ +package com.foreverwin.mesnac.anomaly.controller; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-23 + */ + +import com.foreverwin.mesnac.anomaly.service.ReportService; +import com.foreverwin.mesnac.integration.model.IntegrationLog; +import com.foreverwin.modular.core.util.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/REPORT") +public class Report { + + @Autowired + public ReportService reportService; + + @PostMapping("/findIntegrationLog") + public R findIntegrationLog(@RequestBody IntegrationLog integration){ + try{ + return R.ok(reportService.findIntegrationLog(integration)); + }catch(Exception e){ + return R.failed(e.getMessage()); + } + } +} diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java new file mode 100644 index 00000000..5791a316 --- /dev/null +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java @@ -0,0 +1,19 @@ +package com.foreverwin.mesnac.anomaly.mapper; + +import com.foreverwin.mesnac.integration.model.IntegrationLog; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-23 + */ +@Repository +public interface ReportMapper { + + List> findIntegrationLog(@Param("integration") IntegrationLog integration); +} diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java new file mode 100644 index 00000000..e793af6e --- /dev/null +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java @@ -0,0 +1,15 @@ +package com.foreverwin.mesnac.anomaly.service; + +import com.foreverwin.mesnac.integration.model.IntegrationLog; + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-23 + */ +public interface ReportService { + List> findIntegrationLog(IntegrationLog integration); +} diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java new file mode 100644 index 00000000..5dd27879 --- /dev/null +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java @@ -0,0 +1,32 @@ +package com.foreverwin.mesnac.anomaly.service.impl; + +import com.foreverwin.mesnac.anomaly.mapper.ReportMapper; +import com.foreverwin.mesnac.anomaly.service.ReportService; +import com.foreverwin.mesnac.integration.model.IntegrationLog; +import com.foreverwin.modular.core.util.CommonMethods; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-23 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class ReportServiceImpl implements ReportService { + + @Autowired + private ReportMapper reportMapper; + + @Override + public List> findIntegrationLog(IntegrationLog integration) { + String site = CommonMethods.getSite(); + integration.setSite(site); + return reportMapper.findIntegrationLog(integration); + } +} diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml new file mode 100644 index 00000000..6e3cca28 --- /dev/null +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -0,0 +1,31 @@ + + + + + + \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java b/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java index 8301b6dd..4e335fa3 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java @@ -1,12 +1,8 @@ package com.foreverwin.mesnac.integration.controller; -import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.service.IntegrationLogService; -import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -21,9 +17,5 @@ public class IntegrationLogController { @Autowired private IntegrationLogService integrationLogService; - @PostMapping("/findIntegrationLog") - public R findIntegrationLog(@RequestBody IntegrationLog integration){ - return R.ok(integrationLogService.findIntegrationLog(integration)); - } } \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/mapper/IntegrationLogMapper.java b/integration/src/main/java/com/foreverwin/mesnac/integration/mapper/IntegrationLogMapper.java index 332be3c6..375a56dd 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/mapper/IntegrationLogMapper.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/mapper/IntegrationLogMapper.java @@ -1,12 +1,9 @@ package com.foreverwin.mesnac.integration.mapper; -import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; +import com.foreverwin.mesnac.integration.model.IntegrationLog; import org.springframework.stereotype.Repository; -import java.util.List; - /** *

* Mapper 接口 @@ -18,5 +15,4 @@ import java.util.List; @Repository public interface IntegrationLogMapper extends BaseMapper { - List findIntegrationLog(@Param("integration") IntegrationLog integration); } \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java index 6a2fa12c..4d8b2503 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java @@ -3,8 +3,6 @@ package com.foreverwin.mesnac.integration.service; import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.mesnac.integration.model.IntegrationLog; -import java.util.List; - /** *

* 服务类 @@ -17,5 +15,4 @@ public interface IntegrationLogService extends IService { void saveIntegrationLog(IntegrationLog integrationLog); - List findIntegrationLog(IntegrationLog integration); } \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java index 7ed02be8..32e1b2cf 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java @@ -4,14 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper; import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.service.IntegrationLogService; -import com.foreverwin.modular.core.util.CommonMethods; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -import java.util.List; - /** *

* 服务实现类 @@ -34,10 +31,5 @@ public class IntegrationLogServiceImpl extends ServiceImpl findIntegrationLog(IntegrationLog integration) { - String site = CommonMethods.getSite(); - integration.setSite(site); - return integrationLogMapper.findIntegrationLog(integration); - } + } \ No newline at end of file diff --git a/integration/src/main/resources/mapper/IntegrationLogMapper.xml b/integration/src/main/resources/mapper/IntegrationLogMapper.xml index ddd2bc08..15258c76 100644 --- a/integration/src/main/resources/mapper/IntegrationLogMapper.xml +++ b/integration/src/main/resources/mapper/IntegrationLogMapper.xml @@ -462,30 +462,4 @@ ) -