Code Monkey home page Code Monkey logo

rambutan's Introduction

WxJava mp + spring security 的spring boot starter

Maven Central Codacy Badge Build Status

该项目主要致力于降低微信服务号开发难度,提高服务号开发的安全性,在spring-boot-starter-web项目中,一个最简单的配置可能如下所示,即完成了公众号的服务接入。

首先,在pom文件中添加如下依赖

        <dependency>
            <groupId>xyz.seansun</groupId>
            <artifactId>rambutan-spring-boot-starter</artifactId>
            <version>1.0.3</version>
        </dependency>

然后,在application.yml中增加如下配置,即完成了一个最基础的公众号服务接入配置

wechat:
  mp:
    app-id: app-id #对应微信公众号 id
    secret: app-secret #微信公众号 secret

如果配置成功,则可以成功注入WxMpService bean。 WxMpService及相关API的使用请参见WxJava项目Wiki

@SpringBootApplication
public class PegasusApplication {

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

    
    @Autowired
    private WxMpService wxMpService;
}

因为WxJava项目已经增加了相应的starter模块,故声明一下,本项目与WxJava提供的starter相比主要提供了一些安全方面的配置,以及更多的简化配置。

目前本项目已完成的简化配置如下:

1.本地memory和Redis服务的切换,主要区别在于AccessToken的存储位置一个在本地,一个在redis. 2.参数配置即可接入微信服务号消息,即使用2-3个参数配置,即可完成微信服务号的消息接入功能 3.基于spring security和微信oauth2.0的用户认证及鉴权机制

本项目的详细使用说明请参见wiki

rambutan's People

Contributors

lyfuci avatar

Stargazers

Lic avatar

Watchers

James Cloos avatar

rambutan's Issues

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.