Giter VIP home page Giter VIP logo

wepush's Introduction

wepush

利用企业微信应用消息向微信发送通知,server酱的golang版本实现。(server酱每次有5条消息的限制)

  • 不需要企业微信,微信即可接收到消息
  • 一键部署,方便简单

1. 部署

部署之前需要先创建企业微信和企业微信应用详细过程可以参考server酱教程

git clone https://github.com/saucer-man/wepush
cd wepush
vim wepush.env  # 填写企业微信应用信息
docker-compose build && docker-compose up -d

其中主要需要填写的有:

  • AuthToken 此api接口的认证token
  • CorpSecret 企业应用secret
  • CorpId 企业ID
  • AgentId 企业应用ID
  • LogLevel 日志详细级别(可以选debug/info/warn)

默认端口为8001,日志目录为./log,可以从docker-compose.yml中修改

2. 使用

部署完毕后,直接请求接口即可发送消息。

curl http://localhost:8001/wepush -H "Content-Type:application/json" -H "token:123" -X POST -d '{"type": "text","touser": "@all","msg": "hello\nworld"}'

其中参数:

  • token:此api接口认证token,可以放在header中,也可以放在url的query中
  • type:发送的消息类型,支持text和markdown(不填的话默认为markdown)
  • touser:成员ID列表,即消息接收者,多个接收者用‘|’分隔,最多支持1000个。(不填的话默认为@all)
  • msg:需要发送的消息内容

效果:

wepush's People

Contributors

saucer-man 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.