All Projects → JohnNiang → wechat-starter-boot-spring

JohnNiang / wechat-starter-boot-spring

Licence: GPL-3.0 license
简化微信对接流程,避免重复性工作和填坑

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to wechat-starter-boot-spring

wechat-sdk
微信登录支付sdk,支持小程序,APP登录,正在重构。QQ群:879729420
Stars: ✭ 73 (+231.82%)
Mutual labels:  wechat-sdk, wechat-pay
Gochat
🔥 微信 Go SDK 🚀🚀🚀
Stars: ✭ 141 (+540.91%)
Mutual labels:  wechat-sdk, wechat-pay
Wechat Php Sdk
PHP微信SDK(微信平台 + 微信支付)
Stars: ✭ 637 (+2795.45%)
Mutual labels:  wechat-sdk, wechat-pay
Yii2 Wx
这可能是yii2中最好用的微信SDK🔥🔥🔥
Stars: ✭ 148 (+572.73%)
Mutual labels:  wechat-sdk, wechat-pay
Payment Spring Boot
微信支付V3,微信优惠券,代金券、公众号支付、微信小程序支付
Stars: ✭ 131 (+495.45%)
Mutual labels:  wechat-sdk, wechat-pay
Abp.wechat
Abp 微信 SDK 模块,包含对微信小程序、公众号、企业微信、开放平台、第三方平台等相关接口封装。
Stars: ✭ 168 (+663.64%)
Mutual labels:  wechat-sdk, wechat-pay
laravel-payment
Omnipay ServiceProvider for Laravel.
Stars: ✭ 89 (+304.55%)
Mutual labels:  wechat-pay
angular-library-starter
🎩 A Minimalist Starter for Angular (v2+) libraries (w/ AOT support)
Stars: ✭ 71 (+222.73%)
Mutual labels:  starter
vital
Starter template for Vite with React (TypeScript). Supports Tailwind with CSS-Modules. Jest and @react/testing-library configured and ready to go. Also ESLint, Prettier, Husky, Commit-lint and Atomic Design for components.
Stars: ✭ 151 (+586.36%)
Mutual labels:  starter
go-wechat
💥weixin、wechat、微信公众平台、企业微信 golang/go sdk
Stars: ✭ 18 (-18.18%)
Mutual labels:  wechat-sdk
next-saas-starter
⚡️ Free Next.js responsive landing page template for SaaS products made using JAMStack architecture.
Stars: ✭ 497 (+2159.09%)
Mutual labels:  starter
angular5-starter
⭐ An Angular5 Starter Kit :: Router, HttpClient, Forms, Services, Dev/Prod, HMR, Async/Lazy Routes and a very good structure for large applications by @naologic
Stars: ✭ 54 (+145.45%)
Mutual labels:  starter
Larabye
🎉 Larabye (Laravel + Rockabye) is a mini PHP starter / framework inspired from laravel features
Stars: ✭ 31 (+40.91%)
Mutual labels:  starter
create-react-app-starter
CRA + typeless starter
Stars: ✭ 21 (-4.55%)
Mutual labels:  starter
create-react-native-dapp
Your next Ethereum application starts here. ⚛️ 💪 🦄
Stars: ✭ 410 (+1763.64%)
Mutual labels:  starter
frontenso-11ty-starter
Production-ready 11ty+Gulp+Webpack Starter that features Nunjucks, SASS, TailwindCSS (with JIT complier), and ESNext.
Stars: ✭ 24 (+9.09%)
Mutual labels:  starter
node-ts-starter
Straightforward Node.js & TypeScript Starter
Stars: ✭ 52 (+136.36%)
Mutual labels:  starter
browser-extension
Browser Extension Template with ESbuild builds, support for React, Preact, Typescript, Tailwind, Manifest V3/V2 support and multi browser build including Chrome, Firefox, Safari, Edge, Brave.
Stars: ✭ 535 (+2331.82%)
Mutual labels:  starter
sass-starter-pack
Sass starter files using Gulp v4.0.0 🔥
Stars: ✭ 34 (+54.55%)
Mutual labels:  starter
Ignite
A comprehensive Flask boilerplate to build SaaS applications that includes Stripe billing, emails, login, and OAuth.
Stars: ✭ 102 (+363.64%)
Mutual labels:  starter

Spring Boot Starter for Wechat

Build Status

JDK version

当前项目处于开发期,感兴趣的朋友可以先关注一下!

目的

主要为了简化微信对接流程,避免重复性工作和填坑。

非常希望感兴趣的朋友们能够参与进来,完善 Wechat Starter

引入指南

Gradle

Snapshot

repositories {
    ...
    maven {
        url 'https://oss.sonatype.org/content/groups/public/'
    }
}

implementation 'me.johnniang.wechat:wechat-starter-boot-spring:0.0.7-SNAPSHOT'

Release

implementation 'me.johnniang.wechat:wechat-starter-boot-spring:0.0.4'

Maven

Snapshot

<repositories>
    <repository>
        <id>nexus_repo</id>
        <name>Nexus oss repo</name>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
</repositories>

<dependency>
    <groupId>me.johnniang.wechat</groupId>
    <artifactId>wechat-starter-boot-spring</artifactId>
    <version>0.0.7-SNAPSHOT</version>
</dependency>

Release

<dependency>
    <groupId>me.johnniang.wechat</groupId>
    <artifactId>wechat-starter-boot-spring</artifactId>
    <version>0.0.4</version>
</dependency>

功能

  • 完成 Wechat Token 的获取(需要完善缓存)
  • 完成 Wechat OAuth Token 的获取
  • 完成 签名验证 功能
  • 完成 发送客服消息 功能
  • 完成 静默获取微信用户基本信息 功能
  • 完成 通过 sns 方式获取用户基本信息 功能
  • 完成 创建微信二维码 功能
  • 完成 上传媒体文件 功能
  • 完成 Ticket 的获取
  • 完成 构建 JSSDK Config 功能
  • 完成 微信支付 功能
  • 完成 微信消息的接收 功能

开发文档

配置微信相关参数

johnniang:
  wechat:
    # 基础配置信息
    appId: your_app_id
    appSecret: your_app_secret
    validationToken: custom_validation_token for wechat validation

    # 支付相关信息
    key: your_payment_key
    mchId: your_mch_id
    paymentNotificationUrl: payment_notification_url
    unifiedOrderUrl: https://api.mch.weixin.qq.com/pay/unifiedorder # Default is sandbox url

WechatService

已经预置 WechatService,开发者可通过以下方式调用:

@Autowired
private WechatService wecahtService;
 /**
* Gets wechat token.
*
* @return wechat token
*/
@NonNull
WechatToken getWechatToken();

/**
* Gets wechat token string.
*
* @return wechat token string
*/
@NonNull
String getWechatTokenString();

/**
* Checks signature.
*
* @param signature signature must not be blank
* @param timestamp timestamp must not be blank
* @param nonce     nonce must not be blank
* @return true if the signature is correct, false otherwise
*/
boolean checkSignature(@NonNull String signature, @NonNull String timestamp, @NonNull String nonce);

/**
* Gets wechat user info.
*
* @param openid wechat openid must not be blank
* @return actual wechat user info
*/
@NonNull
WechatUser getWechatUser(@NonNull String openid);

/**
* Gets wechat user info via sns.
*
* @param openid            wechat openid must not be blank
* @param oAuth2AccessToken oauth2 access token
* @return actual wechat user info
*/
@NonNull
WechatUser getWechatUserViaSns(@NonNull String openid, @NonNull String oAuth2AccessToken);

/**
* Sends kf message to wechat user.
*
* @param message kf message content must not be null
*/
void sendKfMessage(@NonNull KfMessage message);gou

DefaultWechatController

预置了 DefaultWechatController,开发这可通过一下方式使用(当然不是必须的):

@Controller
@RequestMapping("/api/wechat")
public class WechatController extends DefaultWechatController {

    // 用户可以根据自己的需求进行重构,或者增添相应的方法。

}

DefaultWechatController 默认的行为有:

/**
* Validate signature from wechat.
*
* @param signature signature from wechat
* @param timestamp timestamp from wechat
* @param nonce     nonce from wechat
* @param echoStr   echoStr from wechat
* @return echoStr from wechat
*/
@GetMapping
public String validate(@RequestParam("signature") String signature,
                    @RequestParam("timestamp") String timestamp,
                    @RequestParam("nonce") String nonce,
                    @RequestParam("echostr") String echoStr)
/**
* Handle wechat message.
*
* @param request http servlet request (Auto inject)
* @return passive wechat message
* @throws IOException throws when HttpServletRequest#getInputStream() invokes error
*/
@PostMapping(produces = MediaType.APPLICATION_XML_VALUE)
public WechatMessage handleWechatMessage(HttpServletRequest request)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].