InviteController.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package com.sqx.modules.invite.controller;
  2. import com.sqx.common.utils.Result;
  3. import com.sqx.modules.app.entity.UserEntity;
  4. import com.sqx.modules.app.service.UserService;
  5. import com.sqx.modules.common.entity.CommonInfo;
  6. import com.sqx.modules.common.service.CommonInfoService;
  7. import com.sqx.modules.utils.SenInfoCheckUtil;
  8. import icu.xuyijie.secureapi.annotation.DecryptParam;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import lombok.extern.slf4j.Slf4j;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.GetMapping;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RequestMethod;
  16. import org.springframework.web.bind.annotation.ResponseBody;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import javax.servlet.http.HttpServletResponse;
  19. import java.util.HashMap;
  20. import java.util.Map;
  21. /**
  22. * @author fang
  23. * @date 2020/7/9
  24. */
  25. @Slf4j
  26. @RestController
  27. @Api(value = "邀请收益", tags = {"邀请收益"})
  28. @RequestMapping(value = "/invite")
  29. public class InviteController {
  30. @Autowired
  31. private UserService userService;
  32. @Autowired
  33. private CommonInfoService commonInfoService;
  34. @RequestMapping(value = "/selectInviteAndPoster", method = RequestMethod.GET)
  35. @ApiOperation("查看我的邀请码和海报二维码")
  36. @ResponseBody
  37. public Result selectInviteAndPoster(Long userId){
  38. UserEntity userEntity = userService.queryByUserId(userId);
  39. CommonInfo one = commonInfoService.findOne(19);
  40. Map<String,Object> map=new HashMap<>();
  41. map.put("url",one.getValue());
  42. map.put("user",userEntity);
  43. return Result.success().put("data",map);
  44. }
  45. @GetMapping("/mpCreateQr")
  46. @ApiOperation("小程序推广二维码")
  47. public void mpCreateQr(@DecryptParam String relation, HttpServletResponse response) {
  48. SenInfoCheckUtil.getPoster(relation,response);
  49. }
  50. @GetMapping("/shopQr")
  51. @ApiOperation("门店二维码")
  52. public void shopQr(String shopId, HttpServletResponse response) {
  53. SenInfoCheckUtil.getShopQr(shopId,response);
  54. }
  55. @GetMapping("/shopQr2")
  56. @ApiOperation("门店二维码")
  57. public void shopQr2(String shopId, HttpServletResponse response) {
  58. SenInfoCheckUtil.getShopQr2(shopId,response);
  59. }
  60. }