From 15c1d716e6a89b38e6af36b62fc372b93779df01 Mon Sep 17 00:00:00 2001 From: puhanshu <hansgoallout@163.com> Date: 星期三, 22 九月 2021 23:02:50 +0800 Subject: [PATCH] 便民服务小程序 --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityConvenientApi.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityConvenientApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityConvenientApi.java index ae9d382..4878d3c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityConvenientApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityConvenientApi.java @@ -1,7 +1,14 @@ package com.panzhihua.applets.api; import javax.annotation.Resource; +import javax.validation.Valid; +import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; +import com.panzhihua.common.model.dtos.community.convenient.PageMerchantProductDTO; +import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; +import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; +import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; +import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; import org.springframework.web.bind.annotation.*; import com.panzhihua.common.controller.BaseController; @@ -15,6 +22,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; + +import java.util.Objects; /** * @description: 社区便民服务商家接口 @@ -30,6 +39,7 @@ @Resource private CommunityService communityService; + @Deprecated @ApiOperation(value = "分页查询便民服务商家", response = ComCvtBusinessVO.class) @PostMapping("/business/area/page") public R pageComCvtBusiness(@RequestBody PageComCvtBusinessAppletsDTO comCvtBusinessAppletsDTO) { @@ -40,10 +50,43 @@ return communityService.pageComCvtBusinessByServiceArea(comCvtBusinessAppletsDTO); } + @Deprecated @ApiOperation(value = "查询便民服务商家详情", response = ComCvtBusinessDetailVO.class) @GetMapping("/business/get") public R getComCvtBusinessServeDetail(@RequestParam("id") Long id) { return communityService.getComCvtBusinessServeDetail(id); } + @ApiOperation(value = "获取商家数量大于0的服务类型", response = ConvenientServiceCategoryVO.class) + @GetMapping("/service-category/suitable") + public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId) { + if (Objects.isNull(communityId)) { + return R.fail("社区id不能为空"); + } + return communityService.getSuitableServiceCategories(communityId); + } + + @ApiOperation(value = "分页获取热门商家", response = ConvenientMerchantVO.class) + @PostMapping("/merchant/popular") + public R getPopularMerchants(@RequestBody @Valid PagePopularMerchantDTO pagePopularMerchantDTO) { + return communityService.getPopularMerchants(pagePopularMerchantDTO); + } + + @ApiOperation(value = "分页获取服务类型下商家", response = ConvenientMerchantVO.class) + @PostMapping("/merchant/classify") + public R getClassifyMerchants(@RequestBody @Valid PageClassifyMerchantDTO pageClassifyMerchantDTO) { + return communityService.getClassifyMerchants(pageClassifyMerchantDTO); + } + + @ApiOperation(value = "商家详情", response = ConvenientMerchantVO.class) + @GetMapping("/merchant/detail") + public R getMerchantDetail(@RequestParam("merchantId") Long merchantId) { + return communityService.getMerchantDetail(merchantId); + } + + @ApiOperation(value = "分页获取商家产品", response = ConvenientProductVO.class) + @PostMapping("/merchant/product") + public R getMerchantProduct(@RequestBody @Valid PageMerchantProductDTO pageMerchantProductDTO) { + return communityService.getMerchantProduct(pageMerchantProductDTO); + } } -- Gitblit v1.7.1