From 3cf73650c9043d910d2b65d77b018fe1ed2ade37 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期三, 22 九月 2021 18:55:31 +0800 Subject: [PATCH] 便民服务小程序 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java | 68 ++++++++++++++++++++++++++++------ 1 files changed, 56 insertions(+), 12 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java index f430ed0..722152b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java @@ -1,5 +1,21 @@ package com.panzhihua.service_community.api; +import java.util.List; + +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.PagePopularMerchantDTO; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.panzhihua.common.model.dtos.community.ComCvtBusinessDTO; import com.panzhihua.common.model.dtos.community.ComCvtCategoryDTO; import com.panzhihua.common.model.dtos.community.ComCvtServeDTO; @@ -29,19 +45,8 @@ import com.panzhihua.service_community.service.ConvenientProductCategoryService; import com.panzhihua.service_community.service.ConvenientProductService; import com.panzhihua.service_community.service.ConvenientServiceCategoryService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; +import lombok.extern.slf4j.Slf4j; /** * @description: 便民服务接口 @@ -559,4 +564,43 @@ public R onShelfOrOffShelfProduct(@RequestBody OnShelfOrOffShelfProductDTO onShelfOrOffShelfProductDTO) { return convenientProductService.onShelfOrOffShelfProduct(onShelfOrOffShelfProductDTO); } + + /** + * 获取所有产品分类 + * @return + */ + @GetMapping("/product-category/all") + public R getAllProductCategory() { + return convenientProductCategoryService.getAllProductCategory(); + } + + /** + * 获取该社区商家数量大于0的分类 + * @param communityId + * @return + */ + @GetMapping("/service-category/suitable") + public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId) { + return convenientServiceCategoryService.getSuitableServiceCategories(communityId); + } + + /** + * 获取该社区下的热门商家 + * @param pagePopularMerchantDTO + * @return + */ + @PostMapping("/merchant/popular") + public R getPopularMerchants(@RequestBody PagePopularMerchantDTO pagePopularMerchantDTO) { + return convenientMerchantService.getPopularMerchants(pagePopularMerchantDTO); + } + + /** + * 分页获取服务类型下商家信息 + * @param pageClassifyMerchantDTO + * @return + */ + @PostMapping("/merchant/classify") + public R getClassifyMerchants(PageClassifyMerchantDTO pageClassifyMerchantDTO) { + return convenientMerchantService.getClassifyMerchants(pageClassifyMerchantDTO); + } } -- Gitblit v1.7.1