jiangqs
2023-06-06 92da9546e1b37b06f78671b34389b1dec9dfadfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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.beans.factory.annotation.Autowired;
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 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();
    }
}