| | |
| | | import cn.hutool.core.lang.tree.TreeUtil; |
| | | import cn.hutool.core.util.BooleanUtil; |
| | | import com.oying.annotation.Log; |
| | | import com.oying.annotation.rest.AnonymousGetMapping; |
| | | import com.oying.utils.R; |
| | | import com.oying.modules.pc.store.domain.StoreCategory; |
| | | import com.oying.modules.pc.store.domain.dto.*; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | private final StoreCategoryService storeCategoryService; |
| | | |
| | | @GetMapping(value = "/list") |
| | | @AnonymousGetMapping(value = "/list") |
| | | @ApiOperation("查询店铺类目") |
| | | //@PreAuthorize("@el.check('merchant:storeCategory:list')" + |
| | | // " and @storeMerchantOwnershipService.check(#storeId)") |
| | | public ResponseEntity<?> getList(@PathVariable Long storeId, |
| | | @RequestParam(value = "recursive", required = false) Boolean recursive) { |
| | | public ResponseEntity<?> getStoreCategories(@PathVariable Long storeId, |
| | | @RequestParam(value = "recursive", required = false) Boolean recursive) { |
| | | |
| | | StoreCategoryQueryCriteria criteria = new StoreCategoryQueryCriteria(); |
| | | criteria.setStoreId(storeId); |
| | |
| | | @ApiOperation("查询店铺类目") |
| | | //@PreAuthorize("@el.check('merchant:storeCategory:list')" + |
| | | // " and @storeMerchantOwnershipService.check(#storeId)") |
| | | public ResponseEntity<?> getById(@PathVariable Long categoryId, |
| | | public ResponseEntity<?> getStoreCategoryById(@PathVariable Long categoryId, |
| | | @RequestParam(value = "recursive", required = false) Boolean recursive) { |
| | | |
| | | StoreCategory storeCategory = storeCategoryService.getById(categoryId); |
| | |
| | | @DeleteMapping |
| | | @Log("删除店铺类目") |
| | | @ApiOperation("删除店铺类目") |
| | | @PreAuthorize("@el.check('storeCategory:del')" + |
| | | " and @storeMerchantOwnershipService.check(#storeId)") |
| | | /*@PreAuthorize("@el.check('storeCategory:del')" + |
| | | " and @storeMerchantOwnershipService.check(#storeId)")*/ |
| | | public ResponseEntity<?> deleteStoreCategory(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | storeCategoryService.deleteAll(ids); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | @PostMapping(value = "/delete") |
| | | @Log("删除店铺类目") |
| | | @ApiOperation("删除店铺类目") |
| | | /*@PreAuthorize("@el.check('storeCategory:del')" + |
| | | " and @storeMerchantOwnershipService.check(#storeId)")*/ |
| | | public ResponseEntity<?> delStoreCategory(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | storeCategoryService.deleteAll(ids); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | } |