package com.sqx.modules.invite.controller; import com.sqx.common.utils.Result; import com.sqx.modules.app.entity.UserEntity; import com.sqx.modules.app.service.UserService; import com.sqx.modules.common.entity.CommonInfo; import com.sqx.modules.common.service.CommonInfoService; import com.sqx.modules.utils.SenInfoCheckUtil; import icu.xuyijie.secureapi.annotation.DecryptParam; import io.swagger.annotations.Api; 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.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; /** * @author fang * @date 2020/7/9 */ @Slf4j @RestController @Api(value = "邀请收益", tags = {"邀请收益"}) @RequestMapping(value = "/invite") public class InviteController { @Autowired private UserService userService; @Autowired private CommonInfoService commonInfoService; @RequestMapping(value = "/selectInviteAndPoster", method = RequestMethod.GET) @ApiOperation("查看我的邀请码和海报二维码") @ResponseBody public Result selectInviteAndPoster(Long userId){ UserEntity userEntity = userService.queryByUserId(userId); CommonInfo one = commonInfoService.findOne(19); Map map=new HashMap<>(); map.put("url",one.getValue()); map.put("user",userEntity); return Result.success().put("data",map); } @GetMapping("/mpCreateQr") @ApiOperation("小程序推广二维码") public void mpCreateQr(@DecryptParam String relation, HttpServletResponse response) { SenInfoCheckUtil.getPoster(relation,response); } @GetMapping("/shopQr") @ApiOperation("门店二维码") public void shopQr(String shopId, HttpServletResponse response) { SenInfoCheckUtil.getShopQr(shopId,response); } @GetMapping("/shopQr2") @ApiOperation("门店二维码") public void shopQr2(String shopId, HttpServletResponse response) { SenInfoCheckUtil.getShopQr2(shopId,response); } }