Coder Social home page Coder Social logo

weixin-service's Introduction

[TOC]

weixin-service

使用 springboot 打通企业微信相关接口

是系列博客 Java企业微信开发 的升级版

一、项目启动

1.获取项目源码

git clone [email protected]:shirayner/weixin-service.git

2.启动项目

进入 weixin-qy 目录,然后执行 gradlew bootRun命令,即可启动项目。

3.API列表

项目启动成功后访问如下地址,可进入 API 列表页面,如下图所示:

http://localhost:8088/weixin-qy/swagger-ui.html

1555658496599

4.测试接口

以获取accessToken接口为例

(1)点击 try it out

1555658956767

(2)输入state参数,此参数是为了区分多个企业微信应用而设置的,可在配置文件中配置:

weixin:
    qy:
       corpId: ww92f5da92bb24696e
       contactsSecret: 1m_9XP62YrXjSiYtL5Thba7DRUarqaExKfr_5eAL09w
       agent:
        - agentId: 1000002
          agentSecret: I73733veH3uCs6H_ijPvIjYD4Rese5UlbYhhQOEE1-I
          token: ray
          encodingAesKey: z2W9lyOAR1XjY8mopEmiSqib0TlBZzCFiCLp6IdS2Iv
          state: ray
        - agentId: 1000003
          agentSecret: gcGhoOnBWOsyN0mz1TrcUQmO7X71YSv4Ma_TW0F9ilM
          token: weixin
          encodingAesKey: YVbcm1g1ynErRKLeugtsr88VlK7ukpkPZHQJICz6SFQ
          state: hecGroup

如下图,若要获取企业微信应用ID为 1000002的应用的 accesstoken, 则可state 值输入 ray,然后点击excute即可请求对应接口,并获取accessToken.

1555659275366

(3)最后的接口响应结果如下:

1555659345278

附录

  1. Gradle 学习总结
  2. Java企业微信开发

weixin-service's People

Contributors

shirayner avatar

Stargazers

 avatar  avatar  avatar zzch avatar Landy.Liu avatar  avatar  avatar Stephen avatar  avatar tree avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

weixin-service's Issues

老哥您好,企业微信API接受消息配置

企业微信后台配置url保存后一直报 openapi回调地址请求不通过这个错误,我用了你的代码集成到项目中,token和EncodingAESKey都配置了并且把项目启动在公网服务器上,
问题1:我先把项目启动在服务器上,再去企业微信后台配置url,token和EncodingAESKey思路对吗?
还是应该先在企业微信上配置url,token和EncodingAESKey,在去配置代码,为啥url一直保存不了呢?
问题2:会不会是我的服务器设置防火墙,看了企业微信的api,可以取到企业微信发送的ip,这还要动态的配置在我服务器的防火墙上吗?
盼您回复,万分感谢!!!

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.