|  |  |  | 
|---|
|  |  |  | import com.doumee.service.business.ProblemsService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | //@RequiresPermissions("business:problems:create") | 
|---|
|  |  |  | @RequiresPermissions("business:problems:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody Problems problems) { | 
|---|
|  |  |  | return ApiResponse.success(problemsService.create(problems)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID删除") | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | //@RequiresPermissions("business:problems:delete") | 
|---|
|  |  |  | @RequiresPermissions("business:problems:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id) { | 
|---|
|  |  |  | problemsService.deleteById(id); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("批量删除") | 
|---|
|  |  |  | @GetMapping("/delete/batch") | 
|---|
|  |  |  | //@RequiresPermissions("business:problems:delete") | 
|---|
|  |  |  | @RequiresPermissions("business:problems:delete") | 
|---|
|  |  |  | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
|---|
|  |  |  | String [] idArray = ids.split(","); | 
|---|
|  |  |  | List<Integer> idList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID修改") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | //@RequiresPermissions("business:problems:update") | 
|---|
|  |  |  | @RequiresPermissions("business:problems:updateById") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody Problems problems) { | 
|---|
|  |  |  | problemsService.updateById(problems); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | //@RequiresPermissions("business:problems:query") | 
|---|
|  |  |  | @RequiresPermissions("business:problems:query") | 
|---|
|  |  |  | public ApiResponse<PageData<Problems>> findPage (@RequestBody PageWrap<Problems> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(problemsService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|