puhanshu
2021-09-22 3cf73650c9043d910d2b65d77b018fe1ed2ade37
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);
    }
}