jyy
2021-01-26 2c25c956ee0dc781500c70c7479c36f8b58f3445
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
package com.matrix.system.app.action;
 
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.service.SysShopInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author wzy
 * @date 2020-12-30
 **/
@Api(value = "ApiShopInfoAction", tags = "店铺信息接口类")
@RestController
@RequestMapping(value = "/api/shop")
public class ApiShopInfoAction {
 
    @Autowired
    private SysShopInfoService shopInfoService;
 
    @ApiOperation(value = "获取门店列表", notes = "获取门店列表")
    @GetMapping(value = "/findAllShopList")
    public AjaxResult findAllShopList() {
        SysShopInfo shopInfo = new SysShopInfo();
        QueryUtil.setQueryLimitCom(shopInfo);
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!DataAuthUtil.hasAllShopAuth()){
            shopInfo.setId(sysUsers.getShopId());
        }
 
        return AjaxResult.buildSuccessInstance(shopInfoService.findByModel(shopInfo));
    }
}