All Projects → sd4324530 → Fastweixin

sd4324530 / Fastweixin

Licence: apache-2.0
极其方便的实现微信公众平台服务端开发,2行代码完成服务器绑定,3行代码实现用户消息监听

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Fastweixin

Sns auth
通用第三方登录SDK,支持微信,微信扫码,QQ,微博登录,支付宝登录,Facebook,Line,Twitter,Google
Stars: ✭ 520 (-33.5%)
Mutual labels:  weixin
Pinche xcx
同城拼车微信小程序😊
Stars: ✭ 614 (-21.48%)
Mutual labels:  weixin
Iview Weapp
一套高质量的微信小程序 UI 组件库
Stars: ✭ 6,145 (+685.81%)
Mutual labels:  weixin
Zanui Weapp
本仓库已不再维护,请移步 https://github.com/youzan/vant-weapp
Stars: ✭ 540 (-30.95%)
Mutual labels:  weixin
Snake
使用Snake,Android也可以轻松实现类iOS侧滑返回效果
Stars: ✭ 605 (-22.63%)
Mutual labels:  weixin
Wechat Miniprogram Examples
WeChat mini program examples. 微信小程序示例
Stars: ✭ 634 (-18.93%)
Mutual labels:  weixin
Wux Weapp
🐶 一套组件化、可复用、易扩展的微信小程序 UI 组件库
Stars: ✭ 4,706 (+501.79%)
Mutual labels:  weixin
Juejin
💰 Unofficial JueJin wechat mini program application - 掘金非官方微信小程序
Stars: ✭ 771 (-1.41%)
Mutual labels:  weixin
Wechattweak Macos
A dynamic library tweak for WeChat macOS - 首款微信 macOS 客户端撤回拦截与多开
Stars: ✭ 6,505 (+731.84%)
Mutual labels:  weixin
Quietweather
☀️ Develop a weather wechat mini program application in two days - 两天撸一个天气应用微信小程序
Stars: ✭ 677 (-13.43%)
Mutual labels:  weixin
Echarts For Weixin
Apache ECharts (incubating) 的微信小程序版本
Stars: ✭ 5,479 (+600.64%)
Mutual labels:  weixin
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 589 (-24.68%)
Mutual labels:  weixin
Fastbootweixin
基于Spring Boot的注解驱动式公众号极速开发框架,用注解重新定义公众号开发
Stars: ✭ 640 (-18.16%)
Mutual labels:  weixin
Wecron
✔️ 微信上的定时提醒 - Cron on WeChat
Stars: ✭ 537 (-31.33%)
Mutual labels:  weixin
Weixin Shop Spring Cloud
微信商城SpringCloud版本 - 前端vue-shop
Stars: ✭ 717 (-8.31%)
Mutual labels:  weixin
Apfree wifidog
A hight performance and lightweight captive portal solution for HTTP(s)
Stars: ✭ 519 (-33.63%)
Mutual labels:  weixin
Weixin Java Pay Demo
基于Spring Boot 和 WxJava 实现的微信支付Java后端Demo
Stars: ✭ 627 (-19.82%)
Mutual labels:  weixin
Weixin Java Miniapp Demo
基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Stars: ✭ 779 (-0.38%)
Mutual labels:  weixin
Python Weixin
微信(weixin|wechat) Python SDK 支持开放平台和公众平台 支持微信小程序云开发
Stars: ✭ 746 (-4.6%)
Mutual labels:  weixin
Mochat
基于企业微信的开源应用开发框架&引擎,也是一套通用的企业私域流量管理系统!
Stars: ✭ 640 (-18.16%)
Mutual labels:  weixin

fastweixin

作者:peiyu

QQ:125331682

技术讨论QQ群:367162748

码云主页:https://gitee.com/pyinjava/fastweixin

Build Status @peiyu on weibo Maven Central Circle CI Gitter License

快速搭建微信公众平台服务器

简单封装了所有与微信服务器交互的消息:文本消息、图片消息、图文消息等等 提供了基于springmvc以及基于servlet框架的控制器,集成了微信服务器绑定、监听所有类型消息的方法 使用时继承,重写即可,十分方便 支持高级接口的API,框架中提供MenuAPI、CustomAPI、QrcodeAPI、UserAPI、MediaAPI、OauthAPI用于实现所有高级接口功能,使用极其简单

内部实现token过期自动刷新,不用再关注token细节

支持微信消息安全模式,但由于jdk的限制,导致想使用安全模式,必须修改jdk内部的jar包 官方网站下载:

JCE无限制权限策略文件JDK7

JCE无限制权限策略文件JDK8

下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件 如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件

详细文档(感谢luozhuang 的整理)

【fastweixin框架教程1】一分钟快速搭建微信公众平台JAVA服务器

【fastweixin框架教程2】weblogic javax.xml 解析xml问题

【fastweixin框架教程3】JAVA进行HTTPS网站访问,PKIX path building failed解决方法

【fastweixin框架教程4】AccessToken、QYAPIConfig管理

【fastweixin框架教程5】企业号成员部门管理

【fastweixin框架教程6】微信企业号给关注的用户主动发送推送消息

【fastweixin框架教程7】微信企业号自定义菜单接口开发

【fastweixin框架教程8】微信企业号临时素材管理

【fastweixin框架教程9】扩展API实例——QYOauthAPI

基于springmvc项目的集成方法

@RestController
@RequestMapping("/weixin")
public class WeixinController extends WeixinControllerSupport {
        private static final Logger log = LoggerFactory.getLogger(WeixinController.class);
        private static final String TOKEN = "myToken";
        //设置TOKEN,用于绑定微信服务器
        @Override
        protected String getToken() {
            return TOKEN;
        }
        //使用安全模式时设置:APPID
        //不再强制重写,有加密需要时自行重写该方法
        @Override
        protected String getAppId() {
            return null;
        }
        //使用安全模式时设置:密钥
        //不再强制重写,有加密需要时自行重写该方法
        @Override
        protected String getAESKey() {
            return null;
        }
        //重写父类方法,处理对应的微信消息
        @Override
        protected BaseMsg handleTextMsg(TextReqMsg msg) {
            String content = msg.getContent();
            log.debug("用户发送到服务器的内容:{}", content);
            return new TextMsg("服务器回复用户消息!");
        }
        /*1.1版本新增,重写父类方法,加入自定义微信消息处理器
         *不是必须的,上面的方法是统一处理所有的文本消息,如果业务觉复杂,上面的会显得比较乱
         *这个机制就是为了应对这种情况,每个MessageHandle就是一个业务,只处理指定的那部分消息
         */
        @Override
        protected List<MessageHandle> initMessageHandles() {
                List<MessageHandle> handles = new ArrayList<MessageHandle>();
                handles.add(new MyMessageHandle());
                return handles;
        }
        //1.1版本新增,重写父类方法,加入自定义微信事件处理器,同上
        @Override
        protected List<EventHandle> initEventHandles() {
                List<EventHandle> handles = new ArrayList<EventHandle>();
                handles.add(new MyEventHandle());
                return handles;
        }
}

基于servlet项目的集成方法

public class WeixinServlet extends WeixinServletSupport {
        @Override
        protected WeixinSupport getWeixinSupport() {
                return new MyServletWeixinSupport();
        }
}
//用户自行实现的微信消息收发处理器
public class MyServletWeixinSupport extends WeixinSupport {
    private static final Logger log = LoggerFactory.getLogger(MyServletWeixinSupport.class);
    @Override
    protected String getToken() {
        return "myToken";
    }
    @Override
    protected BaseMsg handleTextMsg(TextReqMsg msg) {
        String content = msg.getContent();
        log.debug("用户发送到服务器的内容:{}", content);
        return new TextMsg("服务器回复用户消息!");
    }
}

web.xml配置

<servlet>
    <servlet-name>weixin</servlet-name>
	<servlet-class>xxx.xxx.WeixinServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>weixin</servlet-name>
    <url-pattern>/weixin</url-pattern>
</servlet-mapping>

基于Jfinal框架项目的集成方法

public class MyJfinalController extends Controller {
    //用户自行实现的消息处理器
    private WeixinSupport support = new MyServletWeixinSupport();
    public void index() {
            HttpServletRequest request = getRequest();
            log.debug("method:{}", request.getMethod());
            //绑定微信服务器
            if ("GET".equalsIgnoreCase(request.getMethod().toUpperCase())) {
                support.bindServer(request, getResponse());
                renderNull();
            } else {
                //处理消息
                renderText(support.processRequest(request), "text/xml");
            }
        }
}

Change Log

https://github.com/sd4324530/fastweixin/wiki/Change-Log

Why Use

https://github.com/sd4324530/fastweixin/wiki/Why-use

Maven 项目引入

<dependency>
    <groupId>com.github.sd4324530</groupId>
    <artifactId>fastweixin</artifactId>
    <version>1.3.15</version>
</dependency>
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].