fix 81462 【垂直越权】专项项目库未做垂直越权

This commit is contained in:
lijiarao
2024-01-31 19:50:02 +08:00
parent 38261fabc3
commit 1ee87a2e96
@@ -5,11 +5,13 @@ import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultCommon;
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.projectLibrary.service.ILawsSpecialProjectLibraryService;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -44,6 +46,7 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param req
* @return
*/
@RequiresPermissions("specialProjectLibrary:search")
@AutoLog(value = "专项项目库-分页列表查询")
@ApiOperation(value="专项项目库-分页列表查询", notes="专项项目库-分页列表查询")
@GetMapping(value = "/page")
@@ -62,6 +65,7 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param req
* @return
*/
@RequiresPermissions("specialProjectLibrary:search")
@AutoLog(value = "专项项目库-列表查询")
@ApiOperation(value="专项项目库-列表查询", notes="专项项目库-列表查询")
@GetMapping(value = "/list")
@@ -70,19 +74,6 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
return Result.OK(list);
}
/**
* 添加
*
* @param lawsSpecialProjectLibrary
* @return
*/
@AutoLog(value = "专项项目库-添加")
@ApiOperation(value="专项项目库-添加", notes="专项项目库-添加")
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
lawsSpecialProjectLibraryService.add(lawsSpecialProjectLibrary);
return Result.OK("操作成功!");
}
/**
* 编辑
@@ -90,12 +81,13 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param lawsSpecialProjectLibrary
* @return
*/
@RequiresPermissions("specialProjectLibrary:edit")
@AutoLog(value = "专项项目库-编辑")
@ApiOperation(value="专项项目库-编辑", notes="专项项目库-编辑")
@PostMapping(value = "/edit")
public Result<T> edit(@Validated @RequestBody LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
lawsSpecialProjectLibraryService.editById(lawsSpecialProjectLibrary);
return Result.OK("操作成功!");
return Result.OK(ResultCommon.EDIT_OK);
}
/**
@@ -104,16 +96,16 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param map
* @return
*/
@AutoLog(value = "专项项目库-通过id删除")
@ApiOperation(value="专项项目库-通过id删除", notes="专项项目库-通过id删除")
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
}
lawsSpecialProjectLibraryService.deleteById(map.get("id"));
return Result.OK("删除成功!");
}
//@AutoLog(value = "专项项目库-通过id删除")
//@ApiOperation(value="专项项目库-通过id删除", notes="专项项目库-通过id删除")
//@PostMapping(value = "/delete")
//public Result<T> delete(@RequestBody Map<String, String> map) {
// if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
// return Result.error("请选择数据!");
// }
// lawsSpecialProjectLibraryService.deleteById(map.get("id"));
// return Result.OK("删除成功!");
//}
/**
* 批量删除
@@ -121,15 +113,16 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param map
* @return
*/
@RequiresPermissions("specialProjectLibrary:batchDel")
@AutoLog(value = "专项项目库-批量删除")
@ApiOperation(value="专项项目库-批量删除", notes="专项项目库-批量删除")
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
return Result.error("请选择数据!");
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
}
this.lawsSpecialProjectLibraryService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK("批量删除成功!");
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK);
}
/**
@@ -138,16 +131,16 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param id
* @return
*/
@AutoLog(value = "专项项目库-通过id查询")
@ApiOperation(value="专项项目库-通过id查询", notes="专项项目库-通过id查询")
@GetMapping(value = "/queryById")
public Result<LawsSpecialProjectLibrary> queryById(@RequestParam(name="id",required=true) String id) {
LawsSpecialProjectLibrary lawsSpecialProjectLibrary = lawsSpecialProjectLibraryService.queryById(id);
if(lawsSpecialProjectLibrary==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsSpecialProjectLibrary);
}
//@AutoLog(value = "专项项目库-通过id查询")
//@ApiOperation(value="专项项目库-通过id查询", notes="专项项目库-通过id查询")
//@GetMapping(value = "/queryById")
//public Result<LawsSpecialProjectLibrary> queryById(@RequestParam(name="id",required=true) String id) {
// LawsSpecialProjectLibrary lawsSpecialProjectLibrary = lawsSpecialProjectLibraryService.queryById(id);
// if(lawsSpecialProjectLibrary==null) {
// return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
// }
// return Result.OK(lawsSpecialProjectLibrary);
//}
/**
* 导出excel
@@ -155,6 +148,9 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
* @param request
* @param lawsSpecialProjectLibrary
*/
@RequiresPermissions("specialProjectLibrary:export")
@AutoLog(value = "专项项目库-导出")
@ApiOperation(value="专项项目库-导出")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
return super.exportXls(request, lawsSpecialProjectLibrary, LawsSpecialProjectLibrary.class, "专项项目库");