首页 > 代码库 > 与你相遇好幸运,aglio写接口文档

与你相遇好幸运,aglio写接口文档

npm install -g aglio

npm i aglio-theme-minimal

 

aglio --theme-full-width -t minimal -i ./src/index.md -o index.html

 

FORMAT: 1A
HOST: http://123.56.205.244:8602/event/

# Common Demo Interface Plan
后端 `Demo` 通用接口计划

# Group Event Manage
农事管理

## Event [/event]
有关农事の增删改查


### Create [POST /{fields,from,time,type,system,details}]
农事的增加接口

+ Parameters

    + fields: `111` (string) - 地块的ID
    + from: `admin` (number) - 农事记录增加者
    + time: `2016-11-11T15:45:01.000Z` (string) - 农事的时间
    + type: `bbb` (number) - 农事的类型
    + system: `shuye` (number) - Deom系统
    + details: `{"amount:1"}` (number) - 农事具体信息

+ Response 200 (application/json)

    + Body
    
            {
                    "status": 1,
                    "message": "creeate",
                    "result": {
                        "fields": "111",
                        "from": "admin",
                        "time": "2016-11-11T15:45:01.000Z",
                        "type": "bbb",
                        "system": "shuye",
                        "details": {
                            "amount": 1
                        },
                        "create": "2016-11-14T02:38:14.528Z",
                        "id": "58292396f4a4802026629e40"
                    }
                }





### Desoroy [DELETE /{id}]
农事的删除接口

+ Parameters

    + id: `58292396f4a4802026629e40` (number)

+ Response 200 (application/json)

    + Body
    
            {
                            "status": 1,
                            "message": "ok",
                            "result": {
                                "fields": "111",
                                "from": "admin",
                                "time": "2016-11-11T15:45:01.000Z",
                                "type": "bbb",
                                "system": "shuye",
                                "details": {
                                    "amount": 1
                                },
                                "create": "2016-11-14T02:38:14.528Z",
                                "id": "58292396f4a4802026629e40"
                            }
                        }



### Update [PUT /{id}/{?fields,?from,?time,?type,?system,?details}]
农事的更新接口

+ Parameters

    + id: `582593c110e80b0435c59907` (string) - 农事的ID
    + fields: `5825936f10e80b0435c59906` (string,optional) - 地块的ID
    + from: `admin` (number,optional) - 农事记录增加者
    + time: `2016-11-11T15:45:01.000Z` (string) - 农事的时间
    + type: `bbb` (number,optional) - 农事的类型
    + system: `SYSTEM` (number,optional) - Deom系统
    + details: `{"amount":100}` (number,optional) - 农事具体信息

+ Response 200 (application/json)

    + Body
    
            {
                    "status": 1,
                    "message": "ok",
                    "result": {
                        "fields": "5825936f10e80b0435c59906",
                        "from": "admin",
                        "time": "2016-11-11T15:45:01.000Z",
                        "type": "bbb",
                        "system": "SYSTEM",
                        "details": {
                            "amount": 100
                        },
                        "create": "2016-11-11T09:47:45.468Z",
                        "id": "582593c110e80b0435c59907"
                    }
                }
    

### Find [GET /{?limit,?skip}]
农事的查找接口

+ Parameters

    + limit:  `2` (number,optional)
    + skip:  `1` (string,optional)

+ Response 200 (application/json)

    + Body
    
            {
                    "status": 1,
                    "message": "ok",
                    "result": [
                        {
                            "fields": "111",
                            "from": "admin",
                            "time": "2016-11-11T15:45:01.000Z",
                            "type": "aaa",
                            "system": "shuye",
                            "details": {
                                "amount": 66
                            },
                            "create": "2016-11-11T09:46:23.736Z",
                            "id": "5825936f10e80b0435c59906"
                        },
                        {
                            "fields": "5825936f10e80b0435c59906",
                            "from": "admin",
                            "time": "2016-11-11T15:45:01.000Z",
                            "type": "bbb",
                            "system": "SYSTEM",
                            "details": {
                                "amount": 100
                            },
                            "create": "2016-11-11T09:47:45.468Z",
                            "id": "582593c110e80b0435c59907"
                        }
                    ]
                }

### FindOne [GET /{id}/]
农事的查找接口

+ Parameters

    + id: `5825936f10e80b0435c59906` (string) - 农事的ID
    

+ Response 200 (application/json)

    + Body
    
            {
                    "status": 1,
                    "message": "ok",
                    "result": {
                        "fields": "111",
                        "from": "admin",
                        "time": "2016-11-11T15:45:01.000Z",
                        "type": "aaa",
                        "system": "shuye",
                        "details": {
                            "amount": 66
                        },
                        "create": "2016-11-11T09:46:23.736Z",
                        "id": "5825936f10e80b0435c59906"
                    }
                }

与你相遇好幸运,aglio写接口文档