1 Star 0 Fork 109

bluepeople1 / spring-boot-starter-weixin

forked from 如梦技术 / mica-weixin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

说明

jfinal weixin 的 spring boot starter,这个starter是为了方便boot用户使用。

具体demo请查看:spring-boot-weixin-demoJFinal-weixin文档

开源推荐

Jar包依赖(最新)

<dependency>
    <groupId>net.dreamlu</groupId>
    <artifactId>spring-boot-starter-weixin</artifactId>
    <version>1.3.4</version>
</dependency>

使用

消息

公众号

  1. 继承DreamMsgControllerAdapter,实现需要重写的消息。

  2. 类添加注解@WxMsgController,注解value为你的消息地址,使用/weixin/wx,已经组合[@RequestMapping和@Controller]

小程序

  1. 继承DreamWxaMsgController,实现需要重写的消息。

  2. 添加注解@WxMsgController,注解value为你的消息地址,使用/weixin/wxa,已经组合[@RequestMapping和@Controller]

Api

  • 类添加@WxApi,注解value为你的消息地址,使用/weixin/api,已经组合[@RequestMapping和@Controller]

配置

配置项 默认值 说明
dream.weixin.access-token-cache dreamWeixinCache 缓存名,需要开启spring cache
dream.weixin.app-id-key appId 多公众号参数名,如:/weixin/wx?appId=xxx
dream.weixin.dev-mode false 开发模式
dream.weixin.url-patterns /weixin/* weixin 消息处理spring拦截器url前缀
dream.weixin.wx-configs 公众号的配置 多公众号配置
dream.weixin.wxa-config 小程序配置 小程序配置

注意

  • demo中的application.yml
dream:
  weixin:
    dev-mode: true
    wx-configs:
      - appId: wx9803d1188fa5fbda
        appSecret: db859c968763c582794e7c3d003c3d87
      - appId: wxc03edcd008ad1e70
        appSecret: 11ed9e2b8e3e3c131e7be320a42b2b5a
        token: 123456
    wxa-config:
      app-id: wx4f53594f9a6b3dcb
      app-secret: eec6482ba3804df05bd10895bace0579
  • cache使用spring的cache,需要@EnableCaching开启。
  • access-token-cache建议配置有效时间7100秒。

更新说明

2019-03-17 v1.3.4

解决小程序,启用并设置消息推送配置校验不通过的问题。

2019-03-07 v1.3.3

升级到 gradle 5.2.1

升级 JFinal3.6

升级 JFinal Weixin2.3

使用 mica-auto 生成 spring.factoriesdevtools 配置。

InMsg 消息对象采用 request 存储,去掉 @WxMsgController 中的 Scope 配置,将消息控制器还原为单例。

2018-12-23 v1.3.2

修复 SpringAccessTokenCache 没有配置的问题,感谢 qq:A梦的小C 反馈。

2018-12-23 v1.3.1

WeixinAppConfig 改为实现 SmartInitializingSingleton

2018-05-03 v1.3.0

弃用@EnableDreamWeixin,导入jar包即可享用。 将消息路由改为spring接管。

微信公众号

如梦技术

精彩内容每日推荐!

The MIT License (MIT) Copyright (c) 2018 如梦技术 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

jfinal weixin 的 spring boot starter,这个starter是为了方便boot用户使用。QQ交流群:479710041 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/ws1983/spring-boot-starter-weixin.git
git@gitee.com:ws1983/spring-boot-starter-weixin.git
ws1983
spring-boot-starter-weixin
spring-boot-starter-weixin
master

搜索帮助

14c37bed 8189591 565d56ea 8189591