| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.service_community.service.McsConfigService; |
| | | import com.panzhihua.service_community.service.McsEvaluateService; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | import com.panzhihua.service_community.service.McsInformationService; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | import com.panzhihua.service_community.service.McsProductService; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | private McsGameService mcsGameService; |
| | | @Resource |
| | | private McsInformationService mcsInformationService; |
| | | @Resource |
| | | private McsEvaluateService mcsEvaluateService; |
| | | @Resource |
| | | private McsProductService mcsProductService; |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | |
| | | public R deleteMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId) { |
| | | return mcsInformationService.deleteMcsInfo(infoId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/page") |
| | | public R pageMcsEvaluate(@RequestBody PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | return mcsEvaluateService.pageMcsEvaluate(pageMcsEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询评价记录详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @GetMapping("/evaluate/get") |
| | | public R getMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return mcsEvaluateService.getMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | /** |
| | | * 删除评价记录 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/evaluate/delete") |
| | | public R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return mcsEvaluateService.deleteMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/game/add") |
| | | public R addMcsGame(@RequestBody McsGameDTO mcsGameDTO) { |
| | | return mcsGameService.addMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/game/put") |
| | | public R putMcsGame(@RequestBody McsGameDTO mcsGameDTO) { |
| | | return mcsGameService.putMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/publish") |
| | | public R publishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.publishMcsGame(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 结束戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/finish") |
| | | public R finishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.finishMcsGame(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳游戏/资讯顶部统计数据 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/statistics/top") |
| | | public R getTopStatistics(@RequestParam("type") Integer type, @RequestParam("userId") Long userId) { |
| | | if (type.equals(1)) { |
| | | //戳戳游戏 |
| | | return mcsGameService.getTopStatistics(userId); |
| | | } else if (type.equals(2)) { |
| | | //戳戳资讯 |
| | | return mcsInformationService.getTopStatistics(userId); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/information/add") |
| | | public R addMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO) { |
| | | return mcsInformationService.addMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/information/put") |
| | | public R putMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO) { |
| | | return mcsInformationService.putMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/information/publish") |
| | | public R publishMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId) { |
| | | return mcsInformationService.publishMcsInfo(infoId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/product/add") |
| | | public R addMcsProduct(@RequestBody McsProductDTO mcsProductDTO) { |
| | | return mcsProductService.addMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/product/put") |
| | | public R putMcsProduct(@RequestBody McsProductDTO mcsProductDTO) { |
| | | return mcsProductService.putMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除产品信息 |
| | | * @param productId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/product/delete") |
| | | public R deleteMcsProduct(@RequestParam("productId") Long productId, @RequestParam("userId") Long userId) { |
| | | return mcsProductService.deleteMcsProduct(productId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架产品信息 |
| | | * @param setShelfForProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/product/setShelf") |
| | | public R setShelfForMcsProduct(@RequestBody SetShelfForProductDTO setShelfForProductDTO) { |
| | | return mcsProductService.setShelfForMcsProduct(setShelfForProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询产品信息 |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/product/page") |
| | | public R pageMcsProduct(@RequestBody PageMcsProductDTO pageMcsProductDTO) { |
| | | return mcsProductService.pageMcsProduct(pageMcsProductDTO); |
| | | } |
| | | } |