package com.ruoyi.system.controller.business;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.system.domain.dto.MerRecommendCooperationDto;
|
import com.ruoyi.system.domain.dto.MerShopRecommendPageDto;
|
import com.ruoyi.system.domain.vo.MerShopRecommendPageVo;
|
import com.ruoyi.system.service.config.RecommendCooperationService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* @author jqs34
|
* @ClassName MerConfigController
|
* @description: TODO
|
* @date 2023年05月07日
|
* @version: 1.0
|
*/
|
@Api(value = "商户配置相关接口", tags = "商户配置相关接口", description = "商户配置相关接口")
|
@RestController
|
@RequestMapping("/mer/config")
|
public class MerConfigController {
|
|
@Resource
|
private RecommendCooperationService recommendCooperationService;
|
|
@RequestMapping(value = "/pageMerShopRecommend", method = RequestMethod.POST)
|
@ApiOperation(value = "分页获取商户推荐列表")
|
public R<Page<MerShopRecommendPageVo>> pageMerShopRecommend(@RequestBody MerShopRecommendPageDto merShopRecommendPageDto) {
|
Long userId = SecurityUtils.getUserId();
|
merShopRecommendPageDto.setUserId(userId);
|
Page<MerShopRecommendPageVo> page = new Page<>();
|
page.setSize(merShopRecommendPageDto.getPageSize());
|
page.setCurrent(merShopRecommendPageDto.getPageNum());
|
List<MerShopRecommendPageVo> merShopRecommendPageVoList = recommendCooperationService.pageMerShopRecommend(page,merShopRecommendPageDto);
|
return R.ok(page.setRecords(merShopRecommendPageVoList));
|
}
|
|
@RequestMapping(value = "/recommendCooperation", method = RequestMethod.POST)
|
@ApiOperation(value = "推荐合作")
|
public R recommendCooperation(@RequestBody MerRecommendCooperationDto merRecommendCooperationDto) {
|
Long userId = SecurityUtils.getUserId();
|
merRecommendCooperationDto.setUserId(userId);
|
recommendCooperationService.recommendCooperation(merRecommendCooperationDto);
|
return R.ok();
|
}
|
}
|