diff --git a/src/main/java/com/xkrs/controller/FireAndRangerController.java b/src/main/java/com/xkrs/controller/FireAndRangerController.java index 34a51cb..26cbe4c 100644 --- a/src/main/java/com/xkrs/controller/FireAndRangerController.java +++ b/src/main/java/com/xkrs/controller/FireAndRangerController.java @@ -1,8 +1,6 @@ package com.xkrs.controller; import com.xkrs.service.FireAndRangerService; -import org.springframework.security.access.annotation.Secured; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -20,40 +18,40 @@ public class FireAndRangerController { /** * 将火点分配给某个人 + * * @param map * @param token * @return */ - @PreAuthorize("hasAnyAuthority('auth_general_user')") @PostMapping("/addFireAndRanger") - public String addFireAndRanger(@RequestBody Map map, @RequestHeader(value="Authorization") String token) throws UnsupportedEncodingException { + public String addFireAndRanger(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) throws UnsupportedEncodingException { String rangerName = (String) map.get("rangerName"); String fireCode = (String) map.get("fireCode"); String handler = (String) map.get("handler"); String verifier = (String) map.get("verifier"); - return fireAndRangerService.addFireAndRanger(rangerName,fireCode,handler,verifier,token); + return fireAndRangerService.addFireAndRanger(rangerName, fireCode, handler, verifier, token); } /** * 护林员查看自己的火点任务 + * * @param token * @return */ - @PreAuthorize("hasAnyAuthority('auth_rangers')") @GetMapping("/selectFireInformation") - public String selectFireInformation(@RequestHeader(value="Authorization") String token){ + public String selectFireInformation(@RequestHeader(value = "Authorization") String token) { return fireAndRangerService.selectFireInformation(token); } /** * 根据火点编码查询核查信息 + * * @param map * @return */ - @PreAuthorize("hasAnyAuthority('auth_general_user')") @PostMapping("/findFireAndRanger") - public String findFireAndRangerByFireCode(@RequestBody Map map, @RequestHeader(value="Authorization") String token) throws Exception { + public String findFireAndRangerByFireCode(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) throws Exception { String fireCode = (String) map.get("fireCode"); - return fireAndRangerService.findFireAndRangerByFireCode(fireCode,token); + return fireAndRangerService.findFireAndRangerByFireCode(fireCode, token); } } diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index fd6c285..ba81a44 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -19,7 +19,6 @@ import org.apache.hc.core5.util.TextUtils; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -184,7 +183,6 @@ public class FirePointController { * @return */ @GetMapping("/selectUserName") - @PreAuthorize("hasAnyAuthority('auth_general_user')") public String selectUserName(@RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -204,7 +202,6 @@ public class FirePointController { * @return */ @GetMapping("/selectTodayFirePoint") - @PreAuthorize("hasAnyAuthority('auth_general_user')") public String selectTodayFirePoint(@RequestParam("countyCode") String countyCode, @RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -219,7 +216,6 @@ public class FirePointController { * 动态多条件查询火点信息 */ @PostMapping("/selectFirePoint") - @PreAuthorize("hasAnyAuthority('auth_general_user')") public String selectFirePoint(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -304,7 +300,6 @@ public class FirePointController { * 查询近一个月的火点信息 */ @GetMapping("/selectFirePointByMonth") - @PreAuthorize("hasAnyAuthority('auth_general_user')") public String selectFirePointByMonth(@RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); diff --git a/src/main/java/com/xkrs/controller/ForestRangerController.java b/src/main/java/com/xkrs/controller/ForestRangerController.java index 7eef946..7d83440 100644 --- a/src/main/java/com/xkrs/controller/ForestRangerController.java +++ b/src/main/java/com/xkrs/controller/ForestRangerController.java @@ -1,7 +1,6 @@ package com.xkrs.controller; import com.xkrs.service.ForestRangerService; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -18,39 +17,39 @@ public class ForestRangerController { /** * 根据区县编码查询相关护林员的信息 + * * @param rangerCountyCode * @return */ @GetMapping("/findByRangerCountyCode") - @PreAuthorize("hasAnyAuthority('auth_general_user')") - public String findByRangerCountyCode(@RequestParam("rangerCountyCode") String rangerCountyCode, @RequestHeader(value="Authorization") String token){ + public String findByRangerCountyCode(@RequestParam("rangerCountyCode") String rangerCountyCode, @RequestHeader(value = "Authorization") String token) { return forestRangerService.findByRangerCountyCode(rangerCountyCode); } /** * 根据区县编码查询该区县所有护林员的信息 + * * @param countyCode * @param token * @return */ @GetMapping("/findAllByRangerCountyCode") - @PreAuthorize("hasAnyAuthority('auth_general_user')") - public String findAllByRangerCountyCode(@RequestParam("countyCode") String countyCode, @RequestHeader(value="Authorization") String token){ - return forestRangerService.findAllByRangerCountyCode(countyCode,token); + public String findAllByRangerCountyCode(@RequestParam("countyCode") String countyCode, @RequestHeader(value = "Authorization") String token) { + return forestRangerService.findAllByRangerCountyCode(countyCode, token); } /** * 根据手机号修改护林员的位置 + * * @param map * @return */ @PostMapping("/updateLatAndLonByPhone") - @PreAuthorize("hasAnyAuthority('auth_general_user')") - public String updateLatAndLonByPhone(@RequestBody Map map, @RequestHeader(value="Authorization") String token){ + public String updateLatAndLonByPhone(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { String rangerLatitude = (String) map.get("rangerLatitude"); String rangerLongitude = (String) map.get("rangerLongitude"); String rangerPhone = (String) map.get("rangerPhone"); - return forestRangerService.updateLatAndLonByPhone(rangerLatitude,rangerLongitude,rangerPhone); + return forestRangerService.updateLatAndLonByPhone(rangerLatitude, rangerLongitude, rangerPhone); } } diff --git a/src/main/java/com/xkrs/controller/SysUserController.java b/src/main/java/com/xkrs/controller/SysUserController.java index 29b3357..9a29d65 100644 --- a/src/main/java/com/xkrs/controller/SysUserController.java +++ b/src/main/java/com/xkrs/controller/SysUserController.java @@ -17,7 +17,6 @@ import com.xkrs.service.RedisService; import com.xkrs.service.SysUserService; import com.xkrs.utils.RandomUtil; import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; @@ -179,7 +178,6 @@ public class SysUserController { * @return */ @RequestMapping(value = "/general/delete", method = RequestMethod.DELETE) - @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user')") public String deleteCustomUser(@RequestParam(value = "userId", required = false) int id) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -193,7 +191,6 @@ public class SysUserController { } @RequestMapping(value = "/update", method = RequestMethod.POST) - @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_administor')") public String updateUser(@Validated({SysUserQoUpdate.class}) @RequestBody SysUserQo userQo, BindingResult bindingResult) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -233,7 +230,6 @@ public class SysUserController { * @return */ @GetMapping("/selectAllUser") - @PreAuthorize("hasAnyAuthority('auth_administor')") public String selectAllUser(@RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -258,7 +254,6 @@ public class SysUserController { * @return */ @PostMapping("/operateActiveFlag") - @PreAuthorize("hasAnyAuthority('auth_administor')") public String operateActiveFlag(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { Integer userId = (Integer) map.get("userId"); String keepType = (String) map.get("keepType"); @@ -288,7 +283,6 @@ public class SysUserController { * @return */ @PostMapping("/updatePassword") - @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") public String updatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -312,7 +306,6 @@ public class SysUserController { * @return */ @PostMapping("/adminUpdatePassword") - @PreAuthorize("hasAnyAuthority('auth_administor')") public String adminUpdatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); @@ -420,7 +413,6 @@ public class SysUserController { * @return */ @PostMapping("/updateExpireDate") - @PreAuthorize("hasAnyAuthority('auth_administor')") public String updateExpireDate(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { Integer userId = (Integer) map.get("userId"); Integer timeNum = (Integer) map.get("timeNum"); @@ -444,7 +436,6 @@ public class SysUserController { * @return */ @PostMapping("/updateOverTime") - @PreAuthorize("hasAnyAuthority('auth_administor')") public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { Integer userId = (Integer) map.get("userId"); String overTime = (String) map.get("overTime");