Spring Wechat
Referencing wechat official document, supplying wechat server client APIs, integrating with spring.
Usage
Add Dependency
Gradle
:
implementation("com.glancebar.wechat:spring-boot-wechat-starter:0.0.2")
Maven
:
<dependency>
<groupId>com.glancebar.wechat</groupId>
<artifactId>spring-boot-wechat-starter</artifactId>
<version>0.0.2</version>
</dependency>
Define Configuation
# resources/application.yml
wechat:
mini-program:
app-id: your-app-id
app-secret: your-app-secret
MiniProgram Login Example
@Autowired
lateinit var wechatMiniProgramApi: WechatMiniProgramApi
val code2SessionResult = wechatMiniProgramApi.code2Session("031AXC0w3XU3LV2rqy0w3icRl42AXC0C")
Modules
wechat-library
Define basic request response object, encapsulate basic params and authentication related works.
spring-boot-wechat-autoconfigure
Define beans with condition(if not exists, then auto inject configuration).
spring-boot-wechat-starter
Integrating upwards two library, enabling directly usage in spring boot project.