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.*; import java.util.List; /** * @author wzy * @date 2020-12-21 **/ @Api(value = "ApiVipInfoAction", tags = "会员接口类") @RestController @RequestMapping(value = "/api/vip") public class ApiVipInfoAction { @Autowired private SysVipInfoService sysVipInfoService; @Autowired private SysVipLevelService sysVipLevelService; @ApiOperation(value = "获取会员通讯录列表", notes = "获取会员通讯录列表") @ApiResponses({ @ApiResponse(code = 200, message = "ok", response = VipInfoListVo.class) }) @PostMapping(value = "/findVipInfoList") public AjaxResult findVipInfoList(@RequestBody VipInfoListDto vipInfoListDto) { 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)); } }