diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 2730d77..8385289 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -39,6 +39,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/queryFirePoint").permitAll() .antMatchers(HttpMethod.POST, "/insertFirePoint").permitAll() .antMatchers(HttpMethod.POST, "/insertFirePointChannelPrecise").permitAll() + .antMatchers(HttpMethod.GET, "/queryFirePointBroadcast").permitAll() .antMatchers(HttpMethod.POST, "/api/user/updateSysUser").permitAll() .antMatchers(HttpMethod.GET, "/selectGlobalConfigDict").permitAll() .antMatchers(HttpMethod.GET, "/selectGlobalConfigValue").permitAll() diff --git a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java index 5ab871a..05f5645 100644 --- a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java @@ -7,10 +7,7 @@ import com.xkrs.straw.service.DispatchFirePointService; import com.xkrs.straw.utils.FirePointSubscribeManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -73,4 +70,15 @@ public class DispatchFirePointController { return firePointService.insertFirePointChannelPrecise(firePointQo); } + /** + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + @GetMapping("/queryFirePointBroadcast") + public String queryFirePointBroadcast(@RequestParam("limit") Integer limit) { + return firePointService.queryFirePointBroadcast(limit); + } + + } diff --git a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java index 363be23..35d9bd4 100644 --- a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java +++ b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java @@ -14,4 +14,10 @@ public interface DispatchFirePointService { */ String insertFirePointChannelPrecise(AllFirePointQo firePointQo); + /** + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + String queryFirePointBroadcast(Integer limit); } diff --git a/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java b/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java index d2a801f..07c9630 100644 --- a/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java +++ b/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java @@ -9,6 +9,7 @@ import com.xkrs.straw.dao.FirePointPreciseDao; import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.helper.GeoCodeHelper; import com.xkrs.straw.model.bean.DataWrapper2; +import com.xkrs.straw.model.bean.FirePointQueryResultBean; import com.xkrs.straw.model.entity.FirePointChannelConfigEntity; import com.xkrs.straw.model.entity.FirePointOrdinaryEntity; import com.xkrs.straw.model.entity.FirePointPreciseEntity; @@ -301,4 +302,19 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { } } + /** + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + @Override + public String queryFirePointBroadcast(Integer limit) { + FirePointQueryResultBean firePointQueryResult = firePointQueryManager.queryFirePointBroadcast(limit); + if (firePointQueryResult.isSuccess()) { + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointQueryResult.getList(), locale); + } else { + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, firePointQueryResult.getErrorMessage(), locale); + } + } + } diff --git a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java index 7cc2e5f..b8b4709 100644 --- a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java +++ b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java @@ -38,6 +38,11 @@ public class FirePointQueryManager { @Resource private FirePointPreciseDao firePointPreciseDao; + /** + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ public FirePointQueryResultBean queryFirePointBroadcast(Integer limit) { int size = (limit != null && limit > 0) ? limit : 10; PageRequest pageRequest = PageRequest.of(1, size, Sort.by(Sort.Direction.DESC, "satelliteTime"));