Class WeChatService

java.lang.Object
cn.net.pap.example.wechat.service.WeChatService

@Service("wechat") public class WeChatService extends Object
  • Constructor Details

    • WeChatService

      public WeChatService()
  • Method Details

    • getStableAccessToken

      public Result<String> getStableAccessToken()
      获取稳定版接口调用凭据 https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/getStableAccessToken.html
      Returns:
    • cgibin_user_info

      public Result<Object> cgibin_user_info(String code)
      用户基本信息 https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId
      Returns:
    • cgibin_user_info_UnionID

      public Result<Object> cgibin_user_info_UnionID(String openid)
      https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId
      Parameters:
      openid -
      Returns:
    • sns_oauth2_access_token

      public Result<String> sns_oauth2_access_token(String code)
      https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html#3
      Parameters:
      code -
      Returns:
    • cgibin_user_info_updateremark

      public Result<String> cgibin_user_info_updateremark(String openid, String remark)
      https://developers.weixin.qq.com/doc/offiaccount/User_Management/Configuring_user_notes.html
      Parameters:
      openid -
      remark -
      Returns:
    • sleep

      public Result<String> sleep()
      Thread sleep
      Returns:
    • sendGet

      public static String sendGet(String url, String param, String contentType)
      向指定 URL 发送GET方法的请求
      Parameters:
      url - 发送请求的 URL
      param - 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
      contentType - 编码类型
      Returns:
      所代表远程资源的响应结果
    • sendPostByHttpClient

      public static String sendPostByHttpClient(String url, String param)