Web Article API
The Web Article API allows Web User to manage the articles in the Web Portal.
Endpoints
# Endpoints
Get article districts
This endpoint gets the subcategories of the articles. The subcategory is only needed for category with dist = 1.
Request
GET /web/articles/districts
Response (ArticleDistrictDTO)
{
"success": true,
"message": "",
"data": [
[
{
"type": 3,
"desc": "葵涌安泰軒"
},
{
"type": 4,
"desc": "深水埗安泰軒"
},
{
"type": 5,
"desc": "屯門安泰軒"
},
{
"type": 6,
"desc": "天水圍安泰軒"
},
{
"type": 7,
"desc": "油尖旺安泰軒"
}
]
]
}
Add article tag
This endpoint adds an article tag.
Request (AddArticleTagReqDTO)
{
"name": "tag 1"
}
Response
{
"success": true,
"message": "",
"data": null
}
Get article tags
This endpoint adds an article tag.
Request
GET /web/articles/tags
Response (GetArticleTagResDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "60a8fbe7-1059-45ea-9c65-e57c3430803b",
"name": "tag 1"
}
]
}
Delete article tag
This endpoint deletes an article tag.
Request (DeleteArticleTagReqDTO)
{
"id": "60a8fbe7-1059-45ea-9c65-e57c3430803b",
"name": "tag 1"
}
Response
{
"success": true,
"message": "",
"data": null
}
Add article
This endpoint adds an article.
Request (AddArticleReqDTO)
新增「最新消息」;「純文字」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"registrationLink": "https://www.google.com",
"category": 1,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0
}
新增「認識精神健康」;「純文字」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 2,
"subcategory": 1,
"type": 0
}
新增「生命故事分享」;「純文字」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 3,
"type": 0
}
新增「專欄分享」;「純文字」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 0
}
新增「專欄分享」;「多圖片」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 1,
"images": [
{
"fileKey": "temp/5e243d9f-797a-4536-afd0-25669aeb4ca5"
},
{
"fileKey": "temp/0b2455ef-25dc-48eb-920f-a93e94399959"
}
]
}
新增「專欄分享」;「PDF文件」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 2,
"pdf": {
"fileKey": "temp/5e243d9f-797a-4536-afd0-25669aeb4ca5"
}
}
新增「專欄分享」;「影片」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 3,
"videoLink": "https://www.youtube.com/live/FkfEMReEl5g?si=a9Z8z3vGI6773wdB"
}
新增「專欄分享」;「音頻」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 4,
"audio": {
"fileKey": "temp/5e243d9f-797a-4536-afd0-25669aeb4ca5"
}
}
新增「專欄分享」;「自定义标签」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 0,
"tags": [
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
},
{
"id": "e7269538-be93-4258-b7c6-dd5c9f980665",
"name": "test3"
}
]
}
新增「專欄分享」;「上架日期」和「下架日期」
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"category": 4,
"type": 0,
"pushTime": "2024-09-21T00:00:00Z",
"pullTime": "2024-10-23T00:00:00Z"
}
Response (ArticleDTO)
{
"success": true,
"message": "",
"data": {
"id": "52e8306d-301b-4985-b9fd-b7b3dd4c43c8",
"canEdit": true,
"canDelete": true,
"title": "Article 2",
"content": "Content 2",
"thumbnail": {
"fileKey": "nlpra/article/activity/A001/thumbnail/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/thumbnail/1"
},
"registrationLink": "https://www.google.com",
"type": 1,
"category": 1,
"subcategory": 0,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"status": {
"type": 1,
"desc": "草稿"
},
"images": [
{
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
{
"fileKey": "nlpra/article/activity/A001/image/2",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/2"
}
],
"pdf": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"videoLink": "https://www.youtube.com",
"audio": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"tags": [
{
"id": "5ba69f4c-1ff8-4c8d-a2df-5abc4470c188",
"name": "test 1"
},
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
}
],
"createAt": "2024-06-24T10:31:49.617768"
}
}
Update article
This endpoint updates an article.
Request (AddArticleReqDTO)
The request body is the same as the request body of the Add Article. The below is an example.
{
"title": "Title",
"content": "Content",
"thumbnail": {
"fileKey": "temp/c5220f9a-8af2-4a75-a092-219768cc4448"
},
"registrationLink": "https://www.google.com",
"category": 1,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0
}
Response (ArticleDTO)
{
"success": true,
"message": "",
"data": {
"id": "52e8306d-301b-4985-b9fd-b7b3dd4c43c8",
"canEdit": true,
"canDelete": true,
"title": "Article 2",
"content": "Content 2",
"thumbnail": {
"fileKey": "nlpra/article/activity/A001/thumbnail/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/thumbnail/1"
},
"registrationLink": "https://www.google.com",
"type": 1,
"category": 1,
"subcategory": 0,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"status": {
"type": 1,
"desc": "草稿"
},
"images": [
{
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
{
"fileKey": "nlpra/article/activity/A001/image/2",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/2"
}
],
"pdf": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"videoLink": "https://www.youtube.com",
"audio": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"tags": [
{
"id": "5ba69f4c-1ff8-4c8d-a2df-5abc4470c188",
"name": "test 1"
},
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
}
],
"createAt": "2024-06-24T10:31:49.617768"
}
}
Get article
This endpoint gets an article.
Request
GET /web/articles/{article_id}
Response (ArticleDTO)
{
"success": true,
"message": "",
"data": {
"id": "52e8306d-301b-4985-b9fd-b7b3dd4c43c8",
"canEdit": true,
"canDelete": true,
"title": "Article 2",
"content": "Content 2",
"thumbnail": {
"fileKey": "nlpra/article/activity/A001/thumbnail/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/thumbnail/1"
},
"registrationLink": "https://www.google.com",
"type": 1,
"category": 1,
"subcategory": 0,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"status": {
"type": 1,
"desc": "草稿"
},
"images": [
{
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
{
"fileKey": "nlpra/article/activity/A001/image/2",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/2"
}
],
"pdf": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"videoLink": "https://www.youtube.com",
"audio": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"tags": [
{
"id": "5ba69f4c-1ff8-4c8d-a2df-5abc4470c188",
"name": "test 1"
},
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
}
],
"createAt": "2024-06-24T10:31:49.617768"
}
}
Filter articles
This endpoint filters out mental information.
Request (FilterArticleReqDTO)
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": "",
"categoryId": 1,
"types": [
1,
2,
3
],
"statusType": 1,
"statuses": [
{
"type": 1,
"desc": "草稿"
}
],
"districts": [
{
"type": 3,
"desc": "葵涌安泰軒"
}
]
}
Response (ArticleSummaryDTO)
{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"category": 2,
"subcategory": 2,
"status": {
"type": 1,
"desc": "草稿"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"createdAt": "2024-06-25T14:30:04.46335"
}
]
}
}
List article statuses
This endpoint lists all availabile article statuses.
Request (ArticleStatusDTO)
{
"type": 1,
"desc": "草稿"
}
Response (ArticleStatusSummaryDTO)
{
"success": true,
"message": "",
"data": [
{
"type": 1,
"desc": "草稿"
},
{
"type": 2,
"desc": "待主任審批"
},
{
"type": 3,
"desc": "待督導審批"
},
{
"type": 4,
"desc": "未上架"
},
{
"type": 5,
"desc": "已上架"
},
{
"type": 6,
"desc": "已下架"
}
]
}
Update article status
This endpoint updates article status.
Request (UpdateArticleStatusDTO)
{
"articleIds": "e0419110-e40c-405b-908a-c757bc5b97e1",
"status": {
"type": 1,
"desc": "草稿"
},
"mark": "remark"
}
Response
{
"success": true,
"message": "",
"data": null
}
Batch update article status
This endpoint updates articles' statuses. It is totaly fine to use this API to update one article's status.
Request (BatchUpdateArticleStatusDTO)
{
"articleIds": [
"e0419110-e40c-405b-908a-c757bc5b97e1",
"0e9279c4-8ad0-47a2-9b3e-a80cf50b73e7"
],
"status": {
"type": 1,
"desc": "草稿"
},
"mark": "remark"
}
Response
{
"success": true,
"message": "",
"data": null
}
Get article logs
This endpoint gets an article's logs.
Request (FilterArticleLogReqDTO)
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": []
}
Response (ArticleLogsResDTO)
{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 27,
"totalPages": 3
},
"sortings": [],
"items": [
{
"updatedAt": "2024-07-09T02:12:26.379381Z",
"content": "呂渚餁(主任)更改社區資源狀態為【已下架】",
"mark": "落架"
},
{
"updatedAt": "2024-07-05T16:55:20.599576Z",
"content": "呂渚餁(主任)更改社區資源狀態為【已上架】",
"mark": "掂!"
}
]
}
}
Delete article
This endpoint deletes an article.
Request
DELETE /web/articles/{article_id}
Response
{
"success": true,
"message": "",
"data": null
}
Get article order
This endpoint gets article order. The returned list is a sorted list.
Request (GetArticleOrderDTO)
{
"categoryId": 1,
"subcategoryId": 0
}
Response (ArticleOrderSummaryItemDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"centre": "香港心理衞生會",
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"status": {
"type": 1,
"desc": "草稿"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"createdAt": "2024-06-25T14:30:04.46335",
"ordering": 1
}
]
}
Update article order
This endpoint updates article order.
Request (UpdateArticleOrderDTO)
{
"categoryId": 1,
"subcategoryId": 0,
"aritcles": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"centre": "香港心理衞生會",
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"status": {
"type": 1,
"desc": "草稿"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"createdAt": "2024-06-25T14:30:04.46335",
"ordering": 1
}
]
}
Response (ArticleOrderSummaryItemDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"centre": "香港心理衞生會",
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"status": {
"type": 1,
"desc": "草稿"
},
"pushTime": "2024-09-21T00:00:00",
"pullTime": "2024-10-23T00:00:00",
"createdAt": "2024-06-25T14:30:04.46335",
"ordering": 1
}
]
}
Get article status count
This endpoint gets article status count.
Request (ArticleStatusCountReqDTO)
{
"categoryId": 1
}
Response (ArticleStatusCountResDTO)
{
"success": true,
"message": "",
"data": [
{
"draftCount": 3,
"secondDraftCount": 0,
"thirdDraftCount": 0,
"readyCount": 0,
"publishCount": 0,
"pullCount": 1
}
]
}
Get article log count
This endpoint gets article log count.
Request
GET /web/articles/{article_id}/log-count
Response (ArticleLogCountResDTO)
{
"success": true,
"message": "",
"data": [
{
"logCount": 1
}
]
}
Resources
ArticleDistrictDTO
properties
type
stringThe identifier of the article district.
desc
stringThe name of the article district.
AddArticleTagReqDTO
properties
name
stringThe name of the article tag.
GetArticleTagResDTO
properties
id
stringThe id of the article tag.
name
stringThe name of the article tag.
DeleteArticleTagReqDTO
properties
id
stringThe id of the article tag.
name
stringThe name of the article tag.
AddArticleReqDTO
properties
title
stringThe title of the article.
content
stringThe content of the article.
The thumbnail of the article.
registrationLink
stringThe registration link of the article. It is needed only if category = 1.
The article category.
district
The district of the article. It is only needed when category is 1. It must be provided when category is 1.
The article subcategory. It is only needed when category is 2. It must be privided when category is 2.
The type of the article.
images
A list of images. It is only needed when type = 1.
pdf
The pdf of the article. It is only needed when type = 2.
videoLink
stringThe video link of the article. It is only needed when type = 3.
audio
The audio of the article. It is only needed when type = 4.
pushTime
Datetime「上架日期」. It has to be in the format YYYY-MM-DDT00:00:00Z. If it is null, the article's push time will be removed.
pullTime
Datetime「下架日期」. It has to be in the format YYYY-MM-DDT00:00:00Z. If it is null, the article's pull time will be removed.
tags
「自定义标签」. If it is empty or null, all existing article's tags will be removed.
ArticleDTO
properties
id
stringThe identifier of the article.
canEdit
boolIt indicates if the article can be edited.
canDelete
boolIt indicates if the article can be deleted.
title
stringThe title of the article.
content
stringThe content of the article.
The thumbnail of the article.
registrationLink
stringThe registration link of the article, This is only needed when category = 1
The article category.
district
The district of the article. Its type must be 0 when category is not 1.
The article subcategory. It must be 0 when category is not 2.
The type of the article.
status
The status of the article.
images
A list of images. It must be an empty array when type is not 1.
pdf
The pdf of the article. It must be null when type is not 2.
videoLink
stringThe video link of the article. It must be null when type is not 3.
audio
The audio of the article. It must be null when type is not 4
pushTime
Datetime「上架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's push time will be removed.
pullTime
Datetime「下架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's pull time will be removed.
tags
「自定义标签」. If it is empty or null, all existing article's tags will be removed.
createAt
DatetimeThe created time.
FilterArticleReqDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
searchKey
stringThe search key should be about title.
categoryId
The category of the article.
types
The type of the article.
statusType
The search key should be about title.
statuses
A list of article statuses. This is reserved for more advanced use. Frontend may ignore this field.
districts
A list of article districts. It is only needed for 「最新消息」
ArticleSummaryDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
A list of filtered elements.
ArticleSummaryItemDTO
properties
id
stringThe identifier of the article.
title
stringThe title of the article.
district
The district of the article. Its type must be 0 when category is not 1.
type
The type of the article.
The article category.
The article subcategory. It must be 0 when category is not 2.
status
The status of the article.
pushTime
Datetime「上架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's push time will be removed.
pullTime
Datetime「下架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's pull time will be removed.
createdAt
datetime創建時間
ArticleStatusSummaryDTO
properties
type
stringThe identifier of the article status.
desc
stringThe name of the article status.
FilterArticleLogReqDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
ArticleLogsResDTO
properties
updatedAt
datetimerequired更新時間
content
stringrequired更新內容
mark
string備註
MediaDTO
properties
fileKey
stringrequiredThe S3 key for the file or folder.
url
stringThe url path of the uploaded files.
ArticleStatusDTO
properties
type
stringThe identifier of the article status.
desc
stringThe name of the article status.
UpdateArticleStatusDTO
properties
articleId
stringThe identifier of the article.
status
The article status.
mark
string備註
BatchUpdateArticleStatusDTO
properties
articleIds
arrayA list of article id.
status
The article status.
mark
string備註
GetArticleOrderDTO
properties
The article category.
The article subcategory. It must be 0 when category is not 2.
ArticleOrderSummaryItemDTO
properties
id
stringThe identifier of the article.
title
stringThe title of the article.
centre
string中心
district
The district of the article. Its type must be 0 when category is not 1.
The type of the article.
status
The status of the article.
pushTime
Datetime「上架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's push time will be removed.
pullTime
Datetime「下架日期」. It has to be in the format YYYY-MM-DDT00:00:00. If it is null, the article's pull time will be removed.
createdAt
datetimerequired創建時間
ordering
intrequiredThe order position of the articles in the APP.
ArticleStatusCountResDTO
properties
draftCount
intrequired草稿數
secondDraftCount
intrequired待主任審批數
thirdDraftCount
intrequired待督導審批數
readyCount
intrequired待上架數
publishCount
intrequired已上架數
pullCount
intrequired下架數
ArticleStatusCountReqDTO
properties
categoryId
The category of the article.
ArticleLogCountResDTO
properties
logCount
intrequired紀錄數
ArticleCategoryEnum
Name | Value |
---|---|
活動推廣 | 1 |
認識精神健康 | 2 |
生命故事分享 | 3 |
專欄分享 | 4 |
ArticleSubCategoryEnum
Name | Value |
---|---|
精神分裂症 | 1 |
思覺失調 | 2 |
抑鬱症 | 3 |
焦慮症 | 4 |
躁狂抑鬱症 | 5 |
妄想症 | 6 |
強迫症 | 7 |
人格障礙 | 8 |
其他 | 9 |
ArticleType
Name | Value |
---|---|
純文字 | 0 |
多圖片 | 1 |
PDF文件 | 2 |
影片 | 3 |
音頻 | 4 |
StatusType
Name | Value |
---|---|
草稿 | 1 |
待主任審批 | 2 |
待督導審批 | 3 |
待上架 | 4 |
已上架 | 5 |
已下架 | 6 |