101captain
2021-11-09 e7f03acfa5ee4ad4fd6d1ee9e9ae9a5655488f6d
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java
@@ -1,13 +1,15 @@
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.PageMerchantProductDTO;
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;
@@ -387,7 +389,7 @@
    }
    /**
     * 分页查询便民服务商家
     * 分页查询便民服务商家 运营后台
     * @param pageConvenientMerchantDTO
     * @return
     */
@@ -569,10 +571,11 @@
    /**
     * 获取所有产品分类
     * @return
     * @param merchantId
     */
    @GetMapping("/product-category/all")
    public R getAllProductCategory() {
        return convenientProductCategoryService.getAllProductCategory();
    public R getAllProductCategory(@RequestParam("merchantId") Long merchantId) {
        return convenientProductCategoryService.getAllProductCategory(merchantId);
    }
    /**
@@ -617,11 +620,100 @@
    /**
     * 小程序获取商家产品
     * @param pageMerchantProductDTO
     * @param merchantId
     * @return
     */
    @PostMapping("/merchant/product")
    public R getMerchantProduct(@RequestBody PageMerchantProductDTO pageMerchantProductDTO) {
        return convenientProductService.getMerchantProduct(pageMerchantProductDTO);
    @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);
    }
}