Giter Site home page Giter Site logo

weixin-java-cp-demo's Introduction

码云Gitee Github Build Status

本项目为weixin-java-tools的Demo演示程序,基于Spring Boot构建,实现企业微信后端开发功能。

更多信息请查阅:https://github.com/Wechat-Group/weixin-java-tools

使用步骤:

  1. 请注意,本demo为简化代码编译时加入了lombok支持,如果不了解lombok的话,请先学习下相关知识,比如可以阅读此文章
  2. 配置:复制 /src/main/resources/application.yml.template 或者修改其扩展名生成 application.yml 文件,根据自己需要填写相关配置(需要注意的是:yml文件内的属性冒号后面的文字之前需要加空格,可参考已有配置,否则属性会设置不成功);
  3. 主要配置说明如下:( 注意:如果是要配置通讯录同步的应用,agentId可以随便配置一个,保证跟下面服务器URL地址里的一致即可。)
wechat:
  cp:
    corpId: 111 (企业ID 在此页面查看:https://work.weixin.qq.com/wework_admin/frame#profile)
    appConfigs:
      - agentId: 1000001 (某一具体应用的AgentId)
        secret: 1111(该应用的Secret)
        token: 111 (应用中的“接受消息”部分的“接收消息服务器配置”里的Token值)
        aesKey: 111 (应用中的“接受消息”部分的“接收消息服务器配置”里的EncodingAESKey值)
      - agentId: 1000002 (另一个应用,以下同上)
        secret: 1111
        token: 111
        aesKey: 111
  1. 运行Java程序:WxCpDemoApplication
  2. 打开shell或cmd,进入ngrok目录,运行 ngrok -config ngrok.cfg -subdomain my-domain 8080 如果运行失败,请更换my-domain为其它字符串,直至连接成功;
  3. 配置企业微信对应应用中的“接受消息”部分的“接收消息服务器配置”URL地址:http://my-domain.tunnel.qydev.com/wx/cp/portal/xxxxx (xxxx要跟AgentId保持一致,注意my-domain要跟上面的一致,需要符合微信官方的要求);
  4. 根据自己需要修改各个handler的实现,加入自己的业务逻辑。

weixin-java-cp-demo's People

Contributors

binarywang 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.