package com.panzhihua.service_community.api;
|
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO;
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO;
|
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.microCommercialStreet.DisableOrEnableMcsMerchantDTO;
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO;
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO;
|
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.McsMerchantDTO;
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO;
|
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO;
|
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.PageVerifyRecordDTO;
|
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.R;
|
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO;
|
import com.panzhihua.service_community.service.McsConfigService;
|
import com.panzhihua.service_community.service.McsCouponService;
|
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.McsLabelService;
|
import com.panzhihua.service_community.service.McsMerchantService;
|
import com.panzhihua.service_community.service.McsProductService;
|
import com.panzhihua.service_community.service.McsVerifiedRecordService;
|
|
/**
|
* @title: MicroCommercialStreetApi
|
* @projectName: 成都呐喊信息技术有限公司-智慧社区项目
|
* @description: 微商业街相关接口
|
* @author: hans
|
* @date: 2021/12/28 14:18
|
*/
|
@RestController
|
@RequestMapping("/microcommercialstreet")
|
public class MicroCommercialStreetApi {
|
|
@Resource
|
private McsMerchantService mcsMerchantService;
|
@Resource
|
private McsConfigService mcsConfigService;
|
@Resource
|
private McsGameService mcsGameService;
|
@Resource
|
private McsInformationService mcsInformationService;
|
@Resource
|
private McsEvaluateService mcsEvaluateService;
|
@Resource
|
private McsProductService mcsProductService;
|
@Resource
|
private McsLabelService mcsLabelService;
|
@Resource
|
private McsCouponService mcsCouponService;
|
@Resource
|
private McsVerifiedRecordService mcsVerifiedRecordService;
|
|
/**
|
* 新增数字商业街商家
|
* @param mcsMerchantDTO
|
* @return
|
*/
|
@PostMapping("/merchant/add")
|
public R addMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) {
|
return mcsMerchantService.addMcsMerchant(mcsMerchantDTO);
|
}
|
|
/**
|
* 编辑数字商业街商家
|
* @param mcsMerchantDTO
|
* @return
|
*/
|
@PutMapping("/merchant/put")
|
public R putMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) {
|
return mcsMerchantService.putMcsMerchant(mcsMerchantDTO);
|
}
|
|
/**
|
* 查询数字商业街商家详情
|
* @param merchantId
|
* @return
|
*/
|
@GetMapping("/merchant/get")
|
public R getMcsMerchant(@RequestParam("merchantId") Long merchantId) {
|
return mcsMerchantService.getMcsMerchant(merchantId);
|
}
|
|
/**
|
* 删除数字商业街商家
|
* @param merchantId
|
* @param userId
|
* @return
|
*/
|
@DeleteMapping("/merchant/delete")
|
public R deleteMcsMerchant(@RequestParam("merchantId") Long merchantId, @RequestParam("userId") Long userId) {
|
return mcsMerchantService.deleteMcsMerchant(merchantId, userId);
|
}
|
|
/**
|
* 分页查询数字商业街商家
|
* @param pageMcsMerchantDTO
|
* @return
|
*/
|
@PostMapping("/merchant/page")
|
public R pageMcsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) {
|
return mcsMerchantService.pageMcsMerchant(pageMcsMerchantDTO);
|
}
|
|
/**
|
* 禁用/启用数字商业街商家
|
* @param disableOrEnableMcsMerchantDTO
|
* @return
|
*/
|
@PutMapping("/merchant/disable-or-enable")
|
public R disableOrEnableMcsMerchant(@RequestBody DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO) {
|
return mcsMerchantService.disableOrEnableMcsMerchant(disableOrEnableMcsMerchantDTO);
|
}
|
|
/**
|
* 获取所有数字商业街配置
|
* @return
|
*/
|
@GetMapping("/config/all")
|
public R getAllMcsConfig() {
|
return mcsConfigService.getAllMcsConfig();
|
}
|
|
/**
|
* 修改数字商业街配置
|
* @param configs
|
* @return
|
*/
|
@PutMapping("/config/put")
|
public R putMcsConfig(@RequestBody List<McsConfigVO> configs) {
|
return mcsConfigService.putMcsConfig(configs);
|
}
|
|
/**
|
* 分页查询戳戳游戏
|
* @param pageMcsGameDTO
|
* @return
|
*/
|
@PostMapping("/game/page")
|
public R pageMcsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) {
|
return mcsGameService.pageMcsGame(pageMcsGameDTO);
|
}
|
|
/**
|
* 设为/取消游戏热门
|
* @param setPopularForGameDTO
|
* @return
|
*/
|
@PutMapping("/game/setPopular")
|
public R setPopularForGame(@RequestBody SetPopularForGameDTO setPopularForGameDTO) {
|
return mcsGameService.setPopularForGame(setPopularForGameDTO);
|
}
|
|
/**
|
* 上架/下架戳戳游戏
|
* @param setShelfForGameDTO
|
* @return
|
*/
|
@PutMapping("/game/setShelf")
|
public R setShelfForGame(@RequestBody SetShelfForGameDTO setShelfForGameDTO) {
|
return mcsGameService.setShelfForGame(setShelfForGameDTO);
|
}
|
|
/**
|
* 删除戳戳游戏
|
* @param gameId
|
* @param userId
|
* @return
|
*/
|
@DeleteMapping("/game/delete")
|
public R deleteMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) {
|
return mcsGameService.deleteMcsGame(gameId, userId);
|
}
|
|
/**
|
* 分页查询戳戳资讯
|
* @param pageMcsInformationDTO
|
* @return
|
*/
|
@PostMapping("/information/page")
|
public R pageMcsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) {
|
return mcsInformationService.pageMcsInfo(pageMcsInformationDTO);
|
}
|
|
/**
|
* 上架/下架戳戳资讯
|
* @param setShelfForInfoDTO
|
* @return
|
*/
|
@PutMapping("/information/setShelf")
|
public R setShelfForMcsInfo(@RequestBody SetShelfForInfoDTO setShelfForInfoDTO) {
|
return mcsInformationService.setShelfForMcsInfo(setShelfForInfoDTO);
|
}
|
|
/**
|
* 删除戳戳资讯
|
* @param infoId
|
* @param userId
|
* @return
|
*/
|
@DeleteMapping("/information/delete")
|
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) {
|
return mcsGameService.getTopStatistics(userId, type);
|
}
|
|
/**
|
* 新增戳戳资讯
|
* @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 deleteProductDTO
|
* @return
|
*/
|
@PostMapping("/product/delete")
|
public R deleteMcsProduct(@RequestBody DeleteProductDTO deleteProductDTO) {
|
return mcsProductService.deleteMcsProduct(deleteProductDTO);
|
}
|
|
/**
|
* 上架/下架产品信息
|
* @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);
|
}
|
|
/**
|
* 获取产品标签列表
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/label/list")
|
public R getMcsLabelList(@RequestParam("userId") Long userId) {
|
return mcsLabelService.getMcsLabelList(userId);
|
}
|
|
/**
|
* 根据account查询微商业街商家信息
|
* @param account
|
* @return
|
*/
|
@GetMapping("/getMcsMerchantByAccount")
|
public R getMcsMerchantByAccount(@RequestParam("account") String account) {
|
return mcsMerchantService.getMcsMerchantByAccount(account);
|
}
|
|
/**
|
* 完成订单更新/新增商家信息
|
* @param orderNo
|
* @param configId
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/updateAfterOrder")
|
public R updateMcsMerchantAfterOrder(@RequestParam(value = "orderNo") String orderNo,
|
@RequestParam("configId") Long configId,
|
@RequestParam("userId") Long userId) {
|
return mcsMerchantService.updateOrAddMcsMerchantAfterOrder(orderNo, configId, userId);
|
}
|
|
/**
|
* 验证码登录
|
* @param loginDTO
|
* @return
|
*/
|
@PostMapping("/loginWithPhone")
|
public R loginWithPhone(@RequestBody LoginWithPhoneDTO loginDTO) {
|
return mcsMerchantService.loginWithPhone(loginDTO);
|
}
|
|
/**
|
* 首页顶部数据
|
* @return
|
*/
|
@GetMapping("/index/topData")
|
public R getMcsIndexTopData() {
|
return mcsMerchantService.getMcsIndexTopData();
|
}
|
|
/**
|
* 戳戳卷领取
|
* @param gameId
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/coupon/apply")
|
public R applyMcsCoupon(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) {
|
return mcsGameService.applyMcsCoupon(gameId, userId);
|
}
|
|
/**
|
* h5分页查询戳戳资讯
|
* @param pageMcsInformationDTO
|
* @return
|
*/
|
@PostMapping("/information/pageH5")
|
public R pageH5McsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) {
|
return mcsInformationService.pageH5McsInfo(pageMcsInformationDTO);
|
}
|
|
/**
|
* h5分页查询戳戳游戏
|
* @param pageMcsGameDTO
|
* @return
|
*/
|
@PostMapping("/game/pageH5")
|
public R pageH5McsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) {
|
return mcsGameService.pageH5McsGame(pageMcsGameDTO);
|
}
|
|
/**
|
* 游戏详情
|
* @param gameId
|
* @return
|
*/
|
@GetMapping("/game/get")
|
public R getMcsGame(@RequestParam("gameId") Long gameId) {
|
return mcsGameService.getMcsGame(gameId);
|
}
|
|
/**
|
* 资讯详情
|
* @param infoId
|
* @return
|
*/
|
@GetMapping("/info/get")
|
public R getMcsInfo(@RequestParam("infoId") Long infoId) {
|
return mcsInformationService.getMcsInfo(infoId);
|
}
|
|
/**
|
* H5分页查询数字商业街商家
|
* @param pageMcsMerchantDTO
|
* @return
|
*/
|
@PostMapping("/merchant/pageH5")
|
public R pageH5McsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) {
|
return mcsMerchantService.pageH5McsMerchant(pageMcsMerchantDTO);
|
}
|
|
/**
|
* 我的戳戳卷
|
* @param type
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/myCoupon")
|
public R getMyCoupon(@RequestParam(value = "type", required = false) Integer type, @RequestParam("userId") Long userId) {
|
return mcsCouponService.getMyCoupon(type, userId);
|
}
|
|
/**
|
* 新增评价记录
|
* @param mcsEvaluateDTO
|
* @return
|
*/
|
@PostMapping("/evaluate/add")
|
public R addMcsEvaluate(@RequestBody McsEvaluateDTO mcsEvaluateDTO) {
|
return mcsEvaluateService.addMcsEvaluate(mcsEvaluateDTO);
|
}
|
|
/**
|
* 我的评价-参与游戏列表
|
* @param pageJoinGameListDTO
|
* @return
|
*/
|
@PostMapping("/joinGame/page")
|
public R getJoinGameList(@RequestBody PageJoinGameListDTO pageJoinGameListDTO) {
|
return mcsCouponService.getJoinGameList(pageJoinGameListDTO);
|
}
|
|
/**
|
* 戳戳卷核销
|
* @param couponId
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/coupon/verify")
|
public R verifyMcsCoupon(@RequestParam("couponId") Long couponId, @RequestParam("userId") Long userId) {
|
return mcsCouponService.verifyMcsCoupon(couponId, userId);
|
}
|
|
/**
|
* 分页查询核销记录
|
* @param pageVerifyRecordDTO
|
* @return
|
*/
|
@PostMapping("/verifyRecord/page")
|
public R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO) {
|
return mcsVerifiedRecordService.pageMcsVerifyRecord(pageVerifyRecordDTO);
|
}
|
|
/**
|
* 游戏统计
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/game/statistics")
|
public R getMcsGameStatistics(@RequestParam("userId") Long userId) {
|
return mcsCouponService.getMcsGameStatistics(userId);
|
}
|
|
/**
|
* 修改用戶信息
|
* @param putUserInfoDTO
|
* @return
|
*/
|
@PutMapping("/putUserInfo")
|
public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) {
|
return mcsMerchantService.putUserInfo(putUserInfoDTO);
|
}
|
|
/**
|
* 根据userId获取商家信息
|
* @param userId
|
* @return
|
*/
|
@GetMapping("/retrieveMcsMerchantInfoByUserId")
|
public R retrieveMcsMerchantInfoByUserId(@RequestParam("userId") Long userId) {
|
return mcsMerchantService.retrieveMcsMerchantInfoByUserId(userId);
|
}
|
|
/**
|
* 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
|
* @return
|
*/
|
@GetMapping("/offResourceForMcsMerchant")
|
public R offResourceForMcsMerchant() {
|
return mcsMerchantService.offResourceForMcsMerchant();
|
}
|
|
/**
|
* 获取产品信息详情
|
* @param productId
|
* @return
|
*/
|
@GetMapping("/product/get")
|
public R getMcsProduct(@RequestParam("productId") Long productId) {
|
return mcsProductService.getMcsProduct(productId);
|
}
|
|
/**
|
* 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
|
* @return
|
*/
|
@GetMapping("/endStatusForMcsGame")
|
public R endStatusForMcsGame() {
|
return mcsGameService.endStatusForMcsGame();
|
}
|
}
|