From 347909bae241fff128b628ea6d12992d7e5b4b10 Mon Sep 17 00:00:00 2001 From: xin <1099200748@qq.com> Date: Fri, 30 May 2025 18:35:43 +0800 Subject: [PATCH] 响应信息主体 --- oying-system/src/main/java/com/oying/modules/pc/category/rest/PlatformCategoryCustomerController.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/oying-system/src/main/java/com/oying/modules/pc/category/rest/PlatformCategoryCustomerController.java b/oying-system/src/main/java/com/oying/modules/pc/category/rest/PlatformCategoryCustomerController.java new file mode 100644 index 0000000..fff0767 --- /dev/null +++ b/oying-system/src/main/java/com/oying/modules/pc/category/rest/PlatformCategoryCustomerController.java @@ -0,0 +1,43 @@ +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)); + } +} -- Gitblit v1.9.3