Skip to content

Commit

Permalink
user dash 示例代码替换
Browse files Browse the repository at this point in the history
  • Loading branch information
arcturus011 committed Mar 9, 2018
1 parent 38dd7c1 commit b83584b
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 302 deletions.
72 changes: 41 additions & 31 deletions user-dash/content/content-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/category/1/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/1/category/1/').then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -72,11 +75,15 @@ https://cloud.minapp.com/userve/v1/content/1/category/1/

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/category/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/1/category/').then(res => {
console.log(res.data)
})

```

**返回示例**
Expand Down Expand Up @@ -146,14 +153,14 @@ Content-Type: `application/json`
**代码示例**

```
curl -X POST \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{
"name": "分类1",
}' \
https://cloud.minapp.com/userve/v1/content/1/category/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.post('https://cloud.minapp.com/userve/v1/content/1/category/', {"name": "分类1",}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -185,14 +192,14 @@ https://cloud.minapp.com/userve/v1/content/1/category/

**代码示例**

```
curl -X PUT \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{
"name": "Test Category"
}' \
https://cloud.minapp.com/userve/v1/content/1/category/3/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.put('https://cloud.minapp.com/userve/v1/content/1/category/3/', {"name": "分类1",}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -223,11 +230,14 @@ https://cloud.minapp.com/userve/v1/content/1/category/3/

**代码示例**

```
curl -X DELETE \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/category/1/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.delete('https://cloud.minapp.com/userve/v1/content/1/category/1/').then(res => {
console.log(res.data)
})
```

**状态码说明**
Expand Down
83 changes: 50 additions & 33 deletions user-dash/content/content-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/1/').then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -47,11 +50,18 @@ https://cloud.minapp.com/userve/v1/content/1/

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/',{
params: {
name: '内容库1'
}
}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand All @@ -68,7 +78,7 @@ https://cloud.minapp.com/userve/v1/content/
"objects": [
{
"id": 1,
"name": "内容库",
"name": "内容库1",
"acl_gids": [],
"created_at": 1489137188,
"updated_at": 1495769882
Expand All @@ -94,15 +104,17 @@ Content-Type: `application/json`

**代码示例**

```
curl -X POST \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{
"name": "Content Group",
"acl_gids": [1, 2]
}' \
https://cloud.minapp.com/userve/v1/content/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.post('https://cloud.minapp.com/userve/v1/content/', {
"name": "Content Group",
"acl_gids": [1, 2]
}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -133,14 +145,16 @@ https://cloud.minapp.com/userve/v1/content/

**代码示例**

```
curl -X PUT \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{
"name": "Test Group"
}' \
https://cloud.minapp.com/userve/v1/content/2/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.put('https://cloud.minapp.com/userve/v1/content/2/', {
"name": "Test Group"
}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -171,11 +185,14 @@ https://cloud.minapp.com/userve/v1/content/2/

**代码示例**

```
curl -X DELETE \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/2/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.delete('https://cloud.minapp.com/userve/v1/content/2/').then(res => {
console.log(res.data)
})
```

**状态码说明**
Expand Down
67 changes: 40 additions & 27 deletions user-dash/content/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/text/1/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/1/text/1/').then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -68,11 +71,14 @@ https://cloud.minapp.com/userve/v1/content/1/text/1/

**代码示例**

```
curl -X GET \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/text/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/content/1/text/').then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -141,12 +147,14 @@ Content-Type: `application/json`

**代码示例**

```
curl -X POST \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{"title": "Test Title"}' \
https://cloud.minapp.com/userve/v1/content/1/text/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.post('https://cloud.minapp.com/userve/v1/content/1/text/', {"title": "Test Title"}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -185,12 +193,14 @@ https://cloud.minapp.com/userve/v1/content/1/text/

**代码示例**

```
curl -X PUT \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
-d '{"name": "Test Category"}' \
https://cloud.minapp.com/userve/v1/content/1/text/2/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.put('https://cloud.minapp.com/userve/v1/content/1/text/2/', {"name": "Test name"}).then(res => {
console.log(res.data)
})
```

**返回示例**
Expand Down Expand Up @@ -222,11 +232,14 @@ https://cloud.minapp.com/userve/v1/content/1/text/2/

**代码示例**

```
curl -X DELETE \
-H "cookie: {{ cookie }}" \
-H "Content-Type: application/json" \
https://cloud.minapp.com/userve/v1/content/1/text/1/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.delete('https://cloud.minapp.com/userve/v1/content/1/text/1/').then(res => {
console.log(res.data)
})
```

**状态码说明**
Expand Down
15 changes: 8 additions & 7 deletions user-dash/data/record.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ Content-Type: `application/json`

执行

```
curl -X GET \
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-G \
--data-urlencode 'where={"price": {"$eq": 10}}' \
https://cloud.minapp.com/userve/v1/table/1/record/
```js
var axios = require('axios').create({
withCredentials: true
})

axios.get('https://cloud.minapp.com/userve/v1/table/1/record/', {params: {where: {"price": {"$eq": 10}}}}).then(res => {
console.log(res.data)
})
```

该接口完整支持的查询操作符如下:
Expand Down
Loading

0 comments on commit b83584b

Please sign in to comment.