New file |
| | |
| | | package com.oying.modules.pc.category.rest; |
| | | |
| | | import com.oying.modules.pc.category.converter.PlatformCategoryViewAssembler; |
| | | import com.oying.modules.pc.category.domain.PlatformCategory; |
| | | import com.oying.modules.pc.category.view.PlatformCategoryCustomerView; |
| | | import com.oying.modules.pc.category.domain.dto.PlatformCategoryQueryCriteria; |
| | | import com.oying.modules.pc.category.service.PlatformCategoryService; |
| | | import com.oying.utils.R; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author lzp |
| | | * @date 2025-04-28 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "平台类目(客户端)") |
| | | @RequestMapping("/api/pc/customer/platformCategory") |
| | | public class PlatformCategoryCustomerController { |
| | | |
| | | private final PlatformCategoryService categoryService; |
| | | private final PlatformCategoryViewAssembler assembler; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation("查询平台类目") |
| | | //@PreAuthorize("@el.check('customer:platformCategory:list')") |
| | | public ResponseEntity<?> queryPlatformCategory() { |
| | | PlatformCategoryQueryCriteria criteria = new PlatformCategoryQueryCriteria(); |
| | | criteria.setActive(1); |
| | | List<PlatformCategory> platformCategoryList = categoryService.queryAll(criteria); |
| | | List<PlatformCategoryCustomerView> responseList = platformCategoryList.stream().map(assembler::toCustomerPlatformCategoryResponse).collect(Collectors.toList()); |
| | | return ResponseEntity.ok(R.success(responseList)); |
| | | } |
| | | } |