Git Product home page Git Product logo

weixin-java-channel-demo's Introduction

本Demo基于Spring Boot构建,实现视频号小店功能开发功能。

本项目为WxJava的Demo演示程序,更多信息请查阅:https://github.com/Wechat-Group/WxJava

Github License

模块介绍

  • normal-channel-demo: 不使用starter引入Maven开发Demo
  • open-channel-demo: 基于第三方平台授权的开发Demo (注: 官方似乎已经不支持这种授权方式了)
  • starter-channel-demo: 使用starter引入Maven开发Demo

使用步骤:

  1. 新手遇到问题,请务必先阅读【开发文档首页】的常见问题部分,可以少走很多弯路,节省不少时间。如还有其他问题请【在此提问】,谢谢配合。
  2. 修改pom.xml中的wxjava.version版本,最新版本(包括测试版)为 Maven Central
  3. 配置:重新命名模块下面的/src/main/resources/application.yml.sampleapplication.yml,并根据自己需要填写相关配置(需要注意的是:yml文件内的属性冒号后面的文字之前需要加空格,可参考已有配置,否则属性会设置不成功);
  4. 运行Java程序 XXDemoApplication
  5. 配置微信URL可以看各个模块的WechatNotifyController.java
  6. 如果使用第三方平台需要引入jackson-dataformat-xml,版本可以上个新的
      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-xml</artifactId>
        <version>2.13.0</version>
      </dependency>

引入该模块,会影响Spring MVC的默认返回。 以下是一些关于这个的一些讨论:

  1. 需要redis支持,如果想用内存,可以修改相关实现。

weixin-java-channel-demo's People

Contributors

lixize avatar

Stargazers

 avatar Vistaa Peng avatar

Watchers

 avatar  avatar

weixin-java-channel-demo's Issues

关于视频号消息ID反序列化错误的问题

消息解析后的明文如下:

{
  "ToUserName": "gh_e6996a91938e",
  "FromUserName": "oBWjL4oQlfWxDKhr2e2oFsXfKxoY",
  "CreateTime": 1686452152,
  "MsgType": "event",
  "Event": "product_order_status_update",
  "ProductOrderStatusUpdate": {
    "order_id": 3712179754175956992,
    "status": 10
  }
}

报错如下:
class java.lang.Long cannot be cast to class java.lang.String (java.lang.Long and java.lang.String are in module java.base of loader 'bootstrap')

报错的类和方法如下:
m.chanjar.weixin.channel.util.JsonUtils : decode(String, Class)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.