Class WeixinComponentProxy

    • Field Detail

      • VERSION

        public static final String VERSION
    • Constructor Detail

      • WeixinComponentProxy

        public WeixinComponentProxy()
        微信第三方组件接口实现(使用weixin4j.properties配置的account#components账号信息, 使用FileCacheStorager文件方式缓存TOKEN)
      • WeixinComponentProxy

        public WeixinComponentProxy​(com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
        微信第三方组件接口实现(使用weixin4j.properties配置的account#components账号信息)
        Parameters:
        cacheStorager - token管理
      • WeixinComponentProxy

        public WeixinComponentProxy​(WeixinMpAccount weixinMpAccount,
                                    com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
        微信第三方组件接口实现
        Parameters:
        weixinMpAccount - 账号信息
        cacheStorager - token管理
    • Method Detail

      • getWeixinMpAccount

        public WeixinMpAccount getWeixinMpAccount()
        获取微信账号信息
        Returns:
      • component

        public ComponentApi component()
        获取组接口对象(只关注第一个组件
        Returns:
        API实例
        See Also:
        ComponentApi
      • component

        public ComponentApi component​(String componentId)
        获取套件接口对象(多个组件
        Parameters:
        componentId - 组件ID
        Returns:
        API实例
        See Also:
        ComponentApi
      • cacheComponentTicket

        public void cacheComponentTicket​(String componentId,
                                         String componentTicket)
                                  throws com.foxinmy.weixin4j.exception.WeixinException
        缓存组件ticket
        Parameters:
        componentId - 组件ID
        componentTicket - 组件ticket内容
        Throws:
        com.foxinmy.weixin4j.exception.WeixinException
      • getComponentAuthorizationURL

        public String getComponentAuthorizationURL​(String componentId)
                                            throws com.foxinmy.weixin4j.exception.WeixinException
        应用组件授权 需先缓存ticket
      • redirectUri默认填写weixin4j.properties#component.oauth.redirect.uri
      • state默认填写state
Parameters:
componentId - 组件ID
Returns:
请求授权的URL
Throws:
com.foxinmy.weixin4j.exception.WeixinException