wechat-mp-autoconfigure

Custom spring boot starter for WeChat MP application Edit

License

License

Categories

Categories

Auto Application Layer Libs Code Generators config Configuration
GroupId

GroupId

com.github.hippoom
ArtifactId

ArtifactId

wechat-mp-autoconfigure
Last Version

Last Version

0.3.2
Release Date

Release Date

Type

Type

jar
Description

Description

wechat-mp-autoconfigure
Custom spring boot starter for WeChat MP application Edit
Source Code Management

Source Code Management

http://github.com/hippoom/wechat-mp-starter/tree/master/wechat-mp-autoconfigure

Download wechat-mp-autoconfigure

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.hippoom/wechat-mp-autoconfigure/ -->
<dependency>
    <groupId>com.github.hippoom</groupId>
    <artifactId>wechat-mp-autoconfigure</artifactId>
    <version>0.3.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.hippoom/wechat-mp-autoconfigure/
implementation 'com.github.hippoom:wechat-mp-autoconfigure:0.3.2'
// https://jarcasting.com/artifacts/com.github.hippoom/wechat-mp-autoconfigure/
implementation ("com.github.hippoom:wechat-mp-autoconfigure:0.3.2")
'com.github.hippoom:wechat-mp-autoconfigure:jar:0.3.2'
<dependency org="com.github.hippoom" name="wechat-mp-autoconfigure" rev="0.3.2">
  <artifact name="wechat-mp-autoconfigure" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.hippoom', module='wechat-mp-autoconfigure', version='0.3.2')
)
libraryDependencies += "com.github.hippoom" % "wechat-mp-autoconfigure" % "0.3.2"
[com.github.hippoom/wechat-mp-autoconfigure "0.3.2"]

Dependencies

compile (7)

Group / Artifact Type Version
org.springframework.boot : spring-boot-autoconfigure jar
org.springframework.boot : spring-boot-configuration-processor Optional jar
com.github.binarywang : weixin-java-mp jar 2.6.0
org.springframework : spring-web jar
org.springframework : spring-webmvc jar
org.springframework.security : spring-security-config Optional jar
org.springframework.security : spring-security-web Optional jar

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.16
javax.servlet : servlet-api jar 2.5

Project Modules

There are no modules declared in this project.

wechat-mp-starterBuild Status

Custom spring boot starter for WeChat MP application

Latest Release

0.3.1

You can download the binary from Maven Central Repository:

  • Gradle
    compile 'com.github.hippoom:wechat-mp-starter:0.3.1'
    testCompile 'com.github.hippoom:wechat-mp-starter-test:0.3.1'
  • Maven
    <dependency>
    	<groupId>com.github.hippoom</groupId>
    	<artifactId>wechat-mp-starter</artifactId>
    	<version>0.3.1</version>
    </dependency>
    <dependency>
    	<groupId>com.github.hippoom</groupId>
    	<artifactId>wechat-mp-starter-test</artifactId>
    	<version>0.3.1</version>
      	<scope>test</scope>
    </dependency>

You can find release notes here.

Why

WeChat supports users who wish to register as an official account, which enables them to push feeds to subscribers, interact with subscribers and provide them with services. There are three types of official accounts: service account, subscription account and enterprise account. Once users as individuals or organizations set up a type of account, they cannot change it to another type. By the end of 2014, the number of WeChat official accounts had reached 8 million.[27] Official accounts of organizations can apply for verified (at cost of 300 RMB), official, public accounts. Official accounts can be used as a platform for services such as hospital pre-registrations,[28] visa renewal[29] or credit card service.[30]

​ quoted from wikipedia

WeChat provides APIs and docs to help you develop official account web applications. Although the APIs is easy to integrate with, it is a good idea to leverage the battle tested libraries provided by community, weixin-java-tools, weixin4j, just to name a few. You may also want to try our starter to auto configure the components if you happen to use spring-boot.

Quick Start

@EnableWeChatMpApplication will do the tricks.

import com.github.hippoom.wechat.mp.autoconfigure.annotation.EnableWeChatMpApplication;
import me.chanjar.weixin.mp.api.WxMpUserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@EnableWeChatMpApplication
@SpringBootApplication
public class Application {
  
    @Autowired
    private WxMpService wxMpService

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

You can setup your WeChat MP appId and secret in the application{-profile}.propertiesorapplication{-profile}.yaml

wechat:
  mp:
    appId: your-app-id
    appSecret: your-app-secret

You can find detailed usage here and a demo application here.

Contributing

Any suggestion and pull request is welcome.

License

Licensed under MIT License (the "License"); You may obtain a copy of the License in the LICENSE file, or at here.

Versions

Version
0.3.2
0.3.0
0.2.1
0.1.0