# 文章 :6010
## 前台使用者
### 取得文章清單
**Api Url : `:6010/article/list`**
**Api 呼叫方式 : GET**
| Header 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Body 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Count | int | x | 每頁列表包含文章數量,預設20
| Page | int | x | 取得文章列表,預設1
**Response**
```javascript=
{
"Code": "1",
"Result": [
{
"ArticleId": 1, // 文章id
"Title": "asdfasdf", // 文章逼條
"Pic": "http://fasdf.com/asdf", // 顯示的圖片網址,可能為空字串
"Content": "asdfsdfsdfsdf..." // 內文,回傳前50個字
},
{
"ArticleId": 1,
"Title": "asdfasdf",
"Pic": "http://fasdf.com/asdf", // 顯示的圖片網址,可能為空字串
"Content": "asdfsdfsdfsdf..." // 內文,回傳前50個字
},
...
]
}
```
### 取得文章內容
**Api Url : `:6010/article/detail`**
**Api 呼叫方式 : GET**
| Header 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Body 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| ArticleId | int | V | 取得的文章標號
**Response**
> contentType包含: 1:文字 2:圖片連結 3:github的gist連結
```javascript=
{
"Code": "1",
"Result": {
"Title": "我是標題",
"Content": [
{
"ContentType": 1,
"Content": "我是文字我是文字我是文字"
},
{
"ContentType": 2,
"Content": "http://aws.s3.com/asdf/asdf"
},
{
"ContentType": 3,
"Content": "http://github.gist.link/asdfasdf"
},
...
]
}
}
```
## 編輯權限使用者
### 上傳圖片
**Api Url : `:6010/pic/upload`**
**Api 呼叫方式 : POST**
| Header 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Token | string | v |
| Body 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Pic | File | V | 上傳的圖片
**Response**
```javascript=
{
"Code": "1",
"Result": {
"PicId": 1, // 圖片id
"PicLink": "http://aws.s3.com/asdfasdf", // 圖片連結
}
}
```
### 刪除圖片
**Api Url : `:6010/pic/del`**
**Api 呼叫方式 : POST**
| Header 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| Token | string | v |
| Body 參數 | 格式 | 必填 |說明 |
| :--- |:---:| :---:| ---:|
| PicId | int | V | 刪除的圖片id
**Response**
```javascript=
{
"Code": "1",
"Result": []
}
```