类 WechatProgramUtil

java.lang.Object
org.anyline.wechat.util.WechatUtil
org.anyline.wechat.program.WechatProgramUtil

public class WechatProgramUtil extends WechatUtil
  • 构造器详细资料

    • WechatProgramUtil

      public WechatProgramUtil(WechatProgramConfig config)
    • WechatProgramUtil

      public WechatProgramUtil(String key, org.anyline.entity.DataRow config)
  • 方法详细资料

    • getInstance

      public static WechatProgramUtil getInstance()
    • reg

      public static WechatProgramUtil reg(String key, org.anyline.entity.DataRow config)
    • getInstance

      public static WechatProgramUtil getInstance(String key)
    • getConfig

      public WechatProgramConfig getConfig()
    • sessionKey

      public String sessionKey(String code)
    • openid

      public String openid(String code)
    • unionid

      public String unionid(String code)
    • jscode2session

      public org.anyline.entity.DataRow jscode2session(String code)
    • getAccessToken

      public String getAccessToken()
    • createQRCode

      public InputStream createQRCode(String path, int width) throws Exception
      生成二维码
      参数:
      path - path
      width - width
      返回:
      InputStream
      抛出:
      Exception - 异常 Exception
    • createQRCode

      public boolean createQRCode(String path, int width, File file)
    • createQRCode

      public boolean createQRCode(String path, int width, OutputStream os)
    • createQRCode

      public boolean createQRCode(String path, File file)
    • createQRCode

      public boolean createQRCode(String path, OutputStream os)
    • createQRCode

      public InputStream createQRCode(String path) throws Exception
      抛出:
      Exception
    • createWXCode

      public InputStream createWXCode(String path, int width, boolean autoColor, String color, boolean hyaline)
      创建二维码
      参数:
      path - path
      width - 宽度自动写0
      autoColor - 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
      color - auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
      hyaline - 是否需要透明底色,为 true 时,生成透明底色的小程序
      返回:
      InputStream
    • createWXCode

      public boolean createWXCode(String path, int width, boolean autoColor, String color, boolean hyaline, File file)
      创建二维码
      参数:
      path - path
      width - 宽度自动写0
      autoColor - 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
      color - auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
      hyaline - 是否需要透明底色,为 true 时,生成透明底色的小程序
      file - 写入文件
      返回:
      boolean
    • createWXCode

      public boolean createWXCode(String path, int width, boolean autoColor, String color, boolean hyaline, OutputStream os)
    • createWXCode

      public boolean createWXCode(String path, File file)
    • createWXCode

      public boolean createWXCode(String path, OutputStream os)
    • createWXCodeUnlimit

      public InputStream createWXCodeUnlimit(String path, String scene, int width, boolean autoColor, String color, boolean hyaline)
      创建二维码
      参数:
      path - path
      scene - scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
      width - 宽度自动写0
      autoColor - 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
      color - auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
      hyaline - 是否需要透明底色,为 true 时,生成透明底色的小程序
      返回:
      InputStream
    • createWXCodeUnlimit

      public boolean createWXCodeUnlimit(String path, String scene, int width, boolean autoColor, String color, boolean hyaline, File file)
      创建二维码
      参数:
      path - path
      scene - scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
      width - 宽度自动写0
      autoColor - 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
      color - auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
      hyaline - 是否需要透明底色,为 true 时,生成透明底色的小程序
      file - 写入文件
      返回:
      boolean
    • createWXCodeUnlimit

      public boolean createWXCodeUnlimit(String path, String scene, int width, boolean autoColor, String color, boolean hyaline, OutputStream os)
    • createWXCodeUnlimit

      public boolean createWXCodeUnlimit(String path, String scene, File file)
    • createWXCodeUnlimit

      public boolean createWXCodeUnlimit(String path, String scene, OutputStream os)
    • decrypt

      public static String decrypt(String session, String vector, String data)
      解密数据
      参数:
      session - 会话key
      vector - 加密初始向理
      data - 加密数据
      返回:
      String