| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Objects; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | 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.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtBusinessAppletsDTO; |
| | | 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 com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtBusinessDetailVO; |
| | | import com.panzhihua.common.model.vos.community.ComCvtBusinessVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductLevelInfoVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Deprecated |
| | | @ApiOperation(value = "分页查询便民服务商家", response = ComCvtBusinessVO.class) |
| | | @PostMapping("/business/area/page") |
| | | public R pageComCvtBusiness(@RequestBody PageComCvtBusinessAppletsDTO comCvtBusinessAppletsDTO) { |
| | |
| | | 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,this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取热门商家", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/popular") |
| | | public R getPopularMerchants(@RequestBody @Valid PagePopularMerchantDTO pagePopularMerchantDTO) { |
| | | pagePopularMerchantDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.getPopularMerchants(pagePopularMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取服务类型下商家", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/classify") |
| | | public R getClassifyMerchants(@RequestBody @Valid PageClassifyMerchantDTO pageClassifyMerchantDTO) { |
| | | pageClassifyMerchantDTO.setAreaCode(this.getAreaCode()); |
| | | 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 = ConvenientProductLevelInfoVO.class) |
| | | @GetMapping("/product/list") |
| | | public R getMerchantProduct(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.getMerchantProduct(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取产品详情", response = ConvenientProductVO.class) |
| | | @GetMapping("/product/detail") |
| | | public R getProductDetail(@RequestParam("productId") Long productId) { |
| | | return communityService.getProductDetail(productId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家分页搜索", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/search") |
| | | public R pageSearchMerchant(@RequestBody @Valid PageSearchDTO pageSearchDTO) { |
| | | return communityService.pageSearchMerchant(pageSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品分页搜索", response = ConvenientProductVO.class) |
| | | @PostMapping("/product/search") |
| | | public R pageSearchProduct(@RequestBody @Valid PageSearchDTO pageSearchDTO) { |
| | | return communityService.pageSearchProduct(pageSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家咨询量") |
| | | @GetMapping("/merchant/incr-consult") |
| | | public R incrMerchantConsult(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.consultMerchant(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家浏览量") |
| | | @GetMapping("/merchant/incr-view") |
| | | public R incrMerchantView(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.incrMerchantView(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加产品浏览量") |
| | | @GetMapping("/product/incr-view") |
| | | public R incrProductView(@RequestParam("productId") Long productId) { |
| | | return communityService.incrProductView(productId); |
| | | } |
| | | } |