Helius
2020-12-22 66a014290fe3f7540ea460467c80bceea03c12a4
zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
@@ -1,18 +1,23 @@
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.app.dto.VipInfoListDto;
import com.matrix.system.app.vo.VipInfoListVo;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.SysVipLevel;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.hive.service.SysVipLevelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @author wzy
@@ -26,6 +31,9 @@
    @Autowired
    private SysVipInfoService sysVipInfoService;
    @Autowired
    private SysVipLevelService sysVipLevelService;
    @ApiOperation(value = "获取会员通讯录列表", notes = "获取会员通讯录列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = VipInfoListVo.class)
@@ -35,4 +43,24 @@
        return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipAddressBook(vipInfoListDto));
    }
    @ApiOperation(value = "根据手机号查询用户信息", notes = "根据手机号查询用户信息")
    @GetMapping(value = "/findVipInfoByPhone/{phone}")
    public AjaxResult findVipInfoByPhone(@PathVariable("phone") String phone) {
        return null;
    }
    @ApiOperation(value = "查询会员类型", notes = "查询会员类型")
    @ApiResponses(
            @ApiResponse(code = 200, message = "ok", response = SysVipLevel.class)
    )
    @GetMapping(value = "/findVipType")
    public AjaxResult findVipType() {
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysVipLevel sysVipLevel = new SysVipLevel();
        if(!DataAuthUtil.hasAllShopAuth()) {
            sysVipLevel.setShopId(sysUsers.getShopId());
        }
        return AjaxResult.buildSuccessInstance(sysVipLevelService.findByModel(sysVipLevel));
    }
}