|
|
@ -2,16 +2,21 @@ package com.ccsens.ptos_tall.api; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ccsens.cloudutil.annotation.MustLogin; |
|
|
|
import com.ccsens.ptos_tall.bean.dto.UserDto; |
|
|
|
import com.ccsens.ptos_tall.bean.vo.UserVo; |
|
|
|
import com.ccsens.ptos_tall.service.IWxUserService; |
|
|
|
import com.ccsens.util.JacksonUtil; |
|
|
|
import com.ccsens.util.JsonResponse; |
|
|
|
import com.ccsens.util.bean.dto.QueryDto; |
|
|
|
import com.ccsens.wechatutil.bean.dto.wxmini.NoticeDto; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
@ -21,6 +26,7 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.IOException; |
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author 逗 |
|
|
@ -88,4 +94,13 @@ public class WxUserController { |
|
|
|
return JsonResponse.newInstance().ok(tokenBean,tokenBean.getToken(),tokenBean.getRefreshToken()); |
|
|
|
} |
|
|
|
|
|
|
|
@MustLogin |
|
|
|
@ApiOperation(value = "根据公众号id判断用户是否关注该公众号", notes = "") |
|
|
|
@RequestMapping(value = "/officialId", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<UserVo.UserOfficial> getByOfficialId(@ApiParam @Validated @RequestBody QueryDto<UserDto.Official> params) { |
|
|
|
log.info("根据公众号id判断用户是否关注该公众号:{}",params); |
|
|
|
UserVo.UserOfficial userOfficial = wxUserService.getByOfficialId(params.getUserId(),params.getParam()); |
|
|
|
|
|
|
|
return JsonResponse.newInstance().ok(userOfficial); |
|
|
|
} |
|
|
|
} |
|
|
|