diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 6f4958e..2742346 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -51,6 +51,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.GET,"/websocketTest").permitAll() .antMatchers(HttpMethod.GET,"/selectCityName").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityName").permitAll() + .antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll() // 所有其它请求需要身份认证 .anyRequest().authenticated() .and() diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index a086260..8e9cab5 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -2,6 +2,7 @@ package com.xkrs.controller; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.FirePointDao; import com.xkrs.dao.SysUserDao; import com.xkrs.model.entity.FirePointEntity; import com.xkrs.model.entity.SysUserEntity; @@ -34,6 +35,9 @@ public class FirePointController { @Resource private SysUserDao sysUserDao; + @Resource + private FirePointDao firePointDao; + /** * 添加火点数据 * @param firePointQo @@ -225,4 +229,17 @@ public class FirePointController { List> maps = firePointService.selectCityName(); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps,locale); } + + /** + * 根据火点编码查询火点信息 + * @param fireCode + * @return + */ + @GetMapping("/selectFirePoint") + public String selectFirePoint(@RequestParam("fireCode") String fireCode){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + FirePointEntity byFireCode = firePointDao.findByFireCode(fireCode); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,byFireCode,locale); + } } diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 88c1756..fd9303c 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -86,7 +86,7 @@ public class FirePointServiceImpl implements FirePointService { firePointEntity.setAddTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); firePointEntity.setFireType("0"); log.info("-------发现新火点"); - log.info("---------------开始进行实时通讯,将检测到的火点传给前端"); + /*log.info("---------------开始进行实时通讯,将检测到的火点传给前端"); Map map = new HashMap(3); map.put("countyCode",firePointQo.getCountyCode()); map.put("countyName",firePointQo.getCountyName()); @@ -101,7 +101,7 @@ public class FirePointServiceImpl implements FirePointService { map1.put("fire",map); String websocket = JSON.toJSONString(map1); // 将监测到的火点信息返给前端 - WebSocketServer.broadInfo(websocket); + WebSocketServer.broadInfo(websocket);*/ return firePointDao.save(firePointEntity); }