| | |
| | | package com.oying.modules.pc.category.rest; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.pc.category.converter.PlatformCategoryViewAssembler; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | //@PreAuthorize("@el.check('admin:platformCategory:updateById')") |
| | | public ResponseEntity<?> updateById(@PathVariable Long categoryId, |
| | | @Validated @RequestBody PlatformCategoryUpdateRequest request) { |
| | | request.setCategoryId(ObjectUtils.defaultIfNull(request.getCategoryId(), categoryId)); |
| | | PlatformCategoryUpdateDto updateDto = new PlatformCategoryUpdateDto(); |
| | | BeanUtils.copyProperties(request, updateDto); |
| | | updateDto.setCategoryId(categoryId); |
| | | categoryService.update(updateDto); |
| | | return ResponseEntity.noContent().build(); |
| | | } |