go aida
1.0.0
No longer updated, will be refactored and integrated into wechat-go
go-aida is a sample project of wechat-go, including Restful API and web page.
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
cd ../web
npm install
node index.js
domain http://your.domain:8080
/create | Create a robot instance |
---|---|
HEADER | |
PARAMS | |
Request
GET /create
Response
200 OK
8c30a4e9-e949-4d10-b6d6-ef7b60e3af88
/status | Get login status |
---|---|
HEADER | |
PARAMS | |
uuid | The uuid of the session |
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 | significance |
---|---|
CREATED | Wait for the user to scan the code and the QR code has been obtained. |
SERVING | Scan code to log in successfully |
/enable | Enable a plug-in |
---|---|
HEADER | |
PARAMS | |
uuid | The uuid of the session |
name | Plug-in name eg. gifer |
Request
PUT /enable?uuid=8c30a4e9-e949-4d10-b6d6-ef7b60e3af88&name=gifer
Response
200 OK
/disable | Close a plug-in |
---|---|
HEADER | |
PARAMS | |
uuid | The uuid of the session |
name | Plug-in name eg. gifer |
Request
PUT /disable?uuid=8c30a4e9-e949-4d10-b6d6-ef7b60e3af88&name=gifer
Response
200 OK