Coder Social home page Coder Social logo

wx_api's Introduction

#微信SDK

##写在之前 QQ群:451700092

####Get Start

  1. 引入包
  2. 在web.xml中加入,用来接收来自微信服务器发送过来的消息
    <filter>
        <filter-name>wxFilter</filter-name>
        <filter-class>com.piggsoft.filter.WXFilter</filter-class>
        <!--选填,如果不填,默认需要这个文件-->
        <init-param>
            <param-name>wxConfigLocations</param-name>
            <param-value>classpath:wx.customer.spring.xml</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>wxFilter</filter-name>
        <url-pattern>/xx/xx</url-pattern>
    </filter-mapping>

WXFilter是被动消息和事件的主入口,url-pattern可以任意配置,只需和公众号中的配置一致
3. classpath下加入wx.customer.properties配置


    #用户唯一凭证
    appid = 123123
    #用户唯一凭证密钥
    secret = 1231231

wx.properties 是整个SDK包的主配置文件,可以覆盖其中的任意配置(除非是你必须这样做)
4. classpath下加入wx.customer.spring.xml配置
在其中加入:

  <?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context
  		http://www.springframework.org/schema/context/spring.xsd">
  
      <bean class="com.piggsoft.listener.TextWXEventListenerTest"/>
  
  </beans>

要求该类实现 com.piggsoft.listener.WXEventListener

wx_api's People

Watchers

 avatar  avatar

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.