| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.weaver.loadtime.Aj; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | private WeixinProperties wxConfig; |
| | | @Autowired |
| | | private RestTemplate wxRestTemplate; |
| | | |
| | | @ApiOperation(value = "查询当前用户是否为会员 0否1是", tags = {"小程序--查询当前用户是否为会员"}) |
| | | @PostMapping(value = "/getUserInfo") |
| | | public AjaxResult<Integer> getUserInfo() { |
| | | TAppUser byId = appUserService.getById(tokenService.getLoginUserApplet().getUserId()); |
| | | if (byId.getVipEndTime() == null){ |
| | | return AjaxResult.ok(0); |
| | | }else if (byId.getVipEndTime().isAfter(LocalDateTime.now())){ |
| | | return AjaxResult.ok(1); |
| | | }else{ |
| | | return AjaxResult.ok(0); |
| | | } |
| | | } |
| | | @ApiOperation(value = "通过code获得openid, 1 --->对应的appid:wx4c405fa42539fc21 2---->对应的appid:wx02d9f6c92e6d3c86") |
| | | @GetMapping("openId-by-jscode2session/{code}") |
| | | public AjaxResult<Map<String, Object>> jscode2session(@PathVariable String code) { |