Giter Site home page Giter Site logo

go-aida's Introduction

go-aida

go-aida是wechat-go的示例项目,包含Restful API和web页面两部分,web页面可以方便终端用户扫码登录并管理自己的插件,API用来集成wechat-go并和页面交互。wechat-go未来会专注在API的稳定性/框架的易用性/通用插件这三方面,go-aida专注在机器人的个性化定制上.

获取代码并运行

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git

cd $GOPATH/src/github.com/songtianyi/
git clone https://github.com/songtianyi/go-aida

cd go-aida/restful
go get ./...
go build .
./restful

Restful API文档

domain http://your.domain:8080

/create

/create 创建一个机器人实例
HEADER
PARAMS

Request

GET /create

Response

200 OK
8c30a4e9-e949-4d10-b6d6-ef7b60e3af88

/status

/status 获取登录状态
HEADER
PARAMS
uuid 该session的uuid

Request

GET /status?uuid=8c30a4e9-e949-4d10-b6d6-ef7b60e3af88

Response

200 OK
{
	"status": "CREATED",
	"qrcode": "../public/qrcode/wd_vvLuDWQ==.jpg",
	"plugins": {
		"laosj": true,
		"gifer": false
	},
	"startTime": 1496749513,
}
status 意义
CREATED 等待用户扫码,此时已拿到二维码

/enable

/enable 开启某个插件
HEADER
PARAMS
uuid 该session的uuid
name 插件名 eg. gifer

Request

PATCH /enable?uuid=8c30a4e9-e949-4d10-b6d6-ef7b60e3af88&name=gifer

Response

200 OK

/disable

/disable 关闭某个插件
HEADER
PARAMS
uuid 该session的uuid
name 插件名 eg. gifer

Request

PATCH /disable?uuid=8c30a4e9-e949-4d10-b6d6-ef7b60e3af88&name=gifer

Response

200 OK

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.