wechat-mp-starter-demo

Custom spring boot starter for WeChat MP application Edit

License

License

GroupId

GroupId

com.github.hippoom
ArtifactId

ArtifactId

wechat-mp-starter-demo
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

wechat-mp-starter-demo
Custom spring boot starter for WeChat MP application Edit

Download wechat-mp-starter-demo

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar
org.springframework.boot : spring-boot-starter-hateoas jar
com.github.hippoom : wechat-mp-starter jar 0.1.0

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.16
com.google.code.findbugs : annotations jar 3.0.1

test (4)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
org.springframework.security : spring-security-test jar 4.2.2.RELEASE
org.spockframework : spock-core jar 1.1-groovy-2.4
org.codehaus.groovy : groovy-all jar 2.4.9

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.1.0