|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.dao.business.model.BaseCategory; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Category; | 
|---|
|  |  |  | import com.doumee.dao.business.model.dto.BaseCategoryRequest; | 
|---|
|  |  |  | import com.doumee.service.business.BaseCategoryService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:create") | 
|---|
|  |  |  | //    @RequiresPermissions("business:basecategory:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody BaseCategoryRequest baseCategory) { | 
|---|
|  |  |  | return ApiResponse.success(baseCategoryService.create(baseCategory)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID修改") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @ApiOperation(value = "根据ID修改-列表属性修改") | 
|---|
|  |  |  | @PostMapping("/updateByIdOrigin") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody BaseCategory baseCategory) { | 
|---|
|  |  |  | baseCategoryService.updateById(baseCategory); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("修改状态") | 
|---|
|  |  |  | @PostMapping("/updateDisableById") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:update") | 
|---|
|  |  |  | public ApiResponse updateDisableById(@RequestBody BaseCategory category) { | 
|---|
|  |  |  | baseCategoryService.updateDisableById(category); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 主键更新 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param baseCategory 实体对象 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("根据ID修改-编辑修改") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:update") | 
|---|
|  |  |  | public ApiResponse update(@RequestBody  BaseCategoryRequest baseCategory){ | 
|---|
|  |  |  | baseCategoryService.update(baseCategory); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询`") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:query") | 
|---|
|  |  |  | public ApiResponse<PageData<BaseCategory>> findPage (@RequestBody PageWrap<BaseCategory> pageWrap) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:basecategory:query") | 
|---|
|  |  |  | //    @RequiresPermissions("business:basecategory:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(baseCategoryService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 条件查询 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param baseCategory 实体对象 | 
|---|
|  |  |  | * @return List<BaseCategory> | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @PostMapping("/findList") | 
|---|
|  |  |  | public ApiResponse<List<BaseCategory>> findList(@RequestBody BaseCategory baseCategory){ | 
|---|
|  |  |  | return ApiResponse.success(baseCategoryService.findList(baseCategory)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|