puzhibing
2023-10-08 22199bbdda579861736420fe26c2873ab0f5d21c
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
56
57
58
59
60
61
62
63
64
package com.sinata.rest.modular.member.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinata.rest.common.ApiUtils;
import com.sinata.rest.modular.member.controller.common.vo.MerchantVo;
import com.sinata.rest.modular.member.model.MemMerchant;
import com.sinata.rest.modular.member.service.IMemMerchantService;
import com.sinata.rest.modular.system.controller.AuthController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@Slf4j
@RestController
@RequestMapping("/memMember")
@Api(tags = "门店相关", description = "门店相关接口")
public class MemberController extends AuthController {
    @Autowired
    IMemMerchantService merchantService;
 
    @GetMapping(value = "/getMerchantList")
    @ApiOperation(value = "获取区域门店列表", notes = "获取优惠券广告列表", response = MemMerchant.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "level", value = "层级 1 省 2 市  3 区", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "cityCode", value = "所在区域", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "current", value = "页数", defaultValue = "1", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "size", value = "大小", defaultValue = "10", dataType = "Int", paramType = "query", required = true)
    })
    public Object getMerchantList(Integer level,String cityCode, Integer current, Integer size) {
        Page<MemMerchant> page = new Page<MemMerchant>(current, size);
        List<MemMerchant> couponList = merchantService.queryMerchantList(level,cityCode,page);
        return ApiUtils.returnOK(couponList);
    }
 
    @GetMapping(value = "/getMerchantCount")
    @ApiOperation(value = "获取区域门店列表", notes = "获取优惠券广告列表", response = MemMerchant.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "level", value = "层级 1 省 2 市  3 区", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "cityCode", value = "所在区域", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "current", value = "页数", defaultValue = "1", dataType = "Int", paramType = "query", required = true),
            @ApiImplicitParam(name = "size", value = "大小", defaultValue = "10", dataType = "Int", paramType = "query", required = true)
    })
    public Object getMerchantCount(Integer level,String cityCode, Integer current, Integer size) {
        Page<MemMerchant> page = new Page<MemMerchant>(current, size);
        List<MemMerchant> couponList = merchantService.getMerchantCount(level,cityCode,page);
        return ApiUtils.returnOK(couponList);
    }
 
    @GetMapping(value = "/getMerchant/{merchantId}")
    @ApiOperation(value = "获取门店详情", notes = "获取门店详情", response = MerchantVo.class)
    public Object getMerchant(@PathVariable("merchantId") Integer merchantId) {
        return ApiUtils.returnOK(merchantService.getMerchantVo(merchantId));
    }
 
}