对比新文件 |
| | |
| | | package com.doumee.api.system; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictBiz; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.OperaType; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.dto.QuerySystemDictDTO; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.doumee.dao.system.vo.SystemDictListVO; |
| | | import com.doumee.service.system.SystemDictService; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | | * @date 2023/03/21 14:49 |
| | | */ |
| | | @Api(tags = "绯荤粺瀛楀吀") |
| | | @RestController |
| | | @RequestMapping("/system/dict") |
| | | public class SystemDictController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SystemDictService systemDictService; |
| | | |
| | | @Autowired |
| | | private SystemDictBiz systemDictBiz; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("鏂板缓") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("system:dict:create") |
| | | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemDict systemDict) { |
| | | return ApiResponse.success(systemDictBiz.create(systemDict)); |
| | | } |
| | | |
| | | @ApiOperation("鍒犻櫎") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("system:dict:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | systemDictService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("鎵归噺鍒犻櫎") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("system:dict:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | systemDictService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("淇敼") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("system:dict:update") |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemDict systemDict) { |
| | | systemDictBiz.updateById(systemDict); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("鍒嗛〉鏌ヨ") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("system:dict:query") |
| | | public ApiResponse<PageData<SystemDictListVO>> findPage (@RequestBody PageWrap<QuerySystemDictDTO> pageWrap) { |
| | | return ApiResponse.success(systemDictService.findPage(pageWrap)); |
| | | } |
| | | } |