From 43f0578e80af82ecae6c61b51bd0539c6b960603 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期二, 16 八月 2022 19:08:32 +0800 Subject: [PATCH] 服务范围优化 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java | 187 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 172 insertions(+), 15 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..72a50a7 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,24 @@ package com.panzhihua.service_community.api; +import java.time.Instant; +import java.util.List; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import com.panzhihua.common.model.dtos.community.convenient.ExportMerchantDTO; +import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; +import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; +import com.panzhihua.common.model.dtos.community.convenient.PageSearchDTO; +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 +48,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: 便民服务接口 @@ -381,7 +389,7 @@ } /** - * 分页查询便民服务商家 + * 分页查询便民服务商家 运营后台 * @param pageConvenientMerchantDTO * @return */ @@ -425,8 +433,8 @@ * @return */ @GetMapping("/service-category/all") - public R getAllServiceCategories() { - return convenientServiceCategoryService.getAllServiceCategories(); + public R getAllServiceCategories(@RequestParam("areaCode") String areaCode) { + return convenientServiceCategoryService.getAllServiceCategories(areaCode); } /** @@ -559,4 +567,153 @@ public R onShelfOrOffShelfProduct(@RequestBody OnShelfOrOffShelfProductDTO onShelfOrOffShelfProductDTO) { return convenientProductService.onShelfOrOffShelfProduct(onShelfOrOffShelfProductDTO); } + + /** + * 获取所有产品分类 + * @return + * @param merchantId + */ + @GetMapping("/product-category/all") + public R getAllProductCategory(@RequestParam("merchantId") Long merchantId) { + return convenientProductCategoryService.getAllProductCategory(merchantId); + } + + /** + * 获取该社区商家数量大于0的分类 + * @param communityId + * @return + */ + @GetMapping("/service-category/suitable") + public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId,@RequestParam("areaCode")String areaCode) { + return convenientServiceCategoryService.getSuitableServiceCategories(communityId,areaCode); + } + + /** + * 获取该社区下的热门商家 + * @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(@RequestBody PageClassifyMerchantDTO pageClassifyMerchantDTO) { + return convenientMerchantService.getClassifyMerchants(pageClassifyMerchantDTO); + } + + /** + * 小程序获取商家详情 + * @param merchantId + * @return + */ + @GetMapping("/merchant/detail") + public R getMerchantDetail(@RequestParam("merchantId") Long merchantId) { + return convenientMerchantService.getMerchantDetail(merchantId); + } + + /** + * 小程序获取商家产品 + * @param merchantId + * @return + */ + @GetMapping("/product/list") + public R getMerchantProduct(@RequestParam("merchantId") Long merchantId) { + return convenientProductService.getMerchantProduct(merchantId); + } + + /** + * 获取产品详情 + * @param productId + * @return + */ + @GetMapping("/product/detail") + public R getProductDetail(@RequestParam("productId") Long productId) { + return convenientProductService.getProduct(productId); + } + + /** + * 搜索商家信息 + * @param pageSearchDTO + * @return + */ + @PostMapping("/merchant/search") + public R pageSearchMerchant(@RequestBody PageSearchDTO pageSearchDTO) { + return convenientMerchantService.pageSearchMerchant(pageSearchDTO); + } + + /** + * 搜索商品信息 + * @param pageSearchDTO + * @return + */ + @PostMapping("/product/search") + public R pageSearchProduct(@RequestBody PageSearchDTO pageSearchDTO) { + return convenientProductService.pageSearchProduct(pageSearchDTO); + } + + /** + * 增加商家店铺咨询量 + * @param merchantId + * @return + */ + @GetMapping("/merchant/consult") + public R consultMerchant(@RequestParam("merchantId") Long merchantId) { + return convenientMerchantService.consultMerchant(merchantId); + } + + /** + * 增加商家店铺浏览量 + * @param merchantId + * @return + */ + @GetMapping("/merchant/incr-view") + public R incrMerchantView(@RequestParam("merchantId") Long merchantId) { + return convenientMerchantService.incrMerchantView(merchantId); + } + + /** + * 增加产品浏览量 + * @param productId + * @return + */ + @GetMapping("/product/incr-view") + public R incrProductView(@RequestParam("productId") Long productId) { + return convenientProductService.incrProductView(productId); + } + + /** + * 获取商家导出数据 + * @param exportMerchantDTO + * @return + */ + @PostMapping("/merchant/export") + public R exportMerchant(@RequestBody ExportMerchantDTO exportMerchantDTO) { + return convenientMerchantService.exportMerchant(exportMerchantDTO); + } + + /** + * 定时任务每隔半小时将商家浏览量和咨询量总值计入指定商家数据中 + * @return + */ + @PostMapping("/timedTaskWriteDataToMerchantJobHandler") + public R timedTaskWriteDataToMerchantJobHandler() { + return convenientMerchantService.timedTaskWriteDataToMerchantJobHandler(); + } + + /** + * 获取商家上下架产品数量 + * @param merchantId + * @return + */ + @GetMapping("/product/shelf-num") + public R getProductShelfNum(@RequestParam("merchantId") Long merchantId) { + return convenientProductService.getProductShelfNum(merchantId); + } } -- Gitblit v1.7.1