App Article API
The App Article API allows App User to manage the articles in the App.
Endpoints
# Endpoints
Get article districts
This endpoint gets the districts of the articles. It is only needed for category = 1.
Request
GET /app/articles/districts
Response (ArticleDistrictDTO)
{
"success": true,
"message": "",
"data": [
[
{
"type": 3,
"desc": "葵涌安泰軒"
},
{
"type": 4,
"desc": "深水埗安泰軒"
},
{
"type": 5,
"desc": "屯門安泰軒"
},
{
"type": 6,
"desc": "天水圍安泰軒"
},
{
"type": 7,
"desc": "油尖旺安泰軒"
}
]
]
}
Get article subcategory
This endpoint gets the subcategories of the articles. It is only needed for category = 2.
Request
GET /app/articles/subcategories
Response (ArticleSubCategorySummaryDTO)
{
"success": true,
"message": "",
"data": [
{
"subcategoryId": 1,
"type": 1,
"desc": "精神分裂症",
"url": "https://jcci-test-media.aritaone.com/share/default/article/subcategory/1"
}
]
}
Filter articles
This endpoint filters out mental information.
Request (FilterArticleReqDTO)
POST /app/articles/page
{
"pagination": {
"page": 1,
"size": 10
},
"categoryId": 1,
"subcategoryId": 2,
"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",
"thumbnail": [
{
"fileKey": "temp/1234",
"url": "https://jcci-test.app-domain.com/temp/1234"
}
],
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
]
}
}
Get article
This endpoint gets an article.
Request
GET /app/articles/{article_id}
Response (ArticleDTO)
{
"success": true,
"message": "",
"data": {
"id": "52e8306d-301b-4985-b9fd-b7b3dd4c43c8",
"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": "葵涌安泰軒"
},
"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"
},
"tags": [
{
"id": "5ba69f4c-1ff8-4c8d-a2df-5abc4470c188",
"name": "test 1"
},
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
}
],
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
}
Add like
This endpoint adds like.
Request
POST /app/articles/{article_id}/like
Response
{
"success": true,
"message": "",
"data": null
}
Delete like
This endpoint deletes like.
Request
DELETE /app/articles/{article_id}/like
Response
{
"success": true,
"message": "",
"data": null
}
Add bookmark
This endpoint adds bookmark.
Request
POST /app/articles/{article_id}/bookmark
Response
{
"success": true,
"message": "",
"data": null
}
Delete bookmark
This endpoint deletes bookmark.
Request
DELETE /app/articles/{article_id}/bookmark
Response
{
"success": true,
"message": "",
"data": null
}
Add read
This endpoint adds read.
Request
POST /app/articles/{article_id}/read
Response
{
"success": true,
"message": "",
"data": null
}
Delete read
This endpoint deletes read. Please note that this function is not needed to be implemented in the App.
Request
DELETE /app/articles/{article_id}/read
Response
{
"success": true,
"message": "",
"data": null
}
Filter bookmarks
This endpoint filters out the bookmarks.
Request (FilterArticleBookmarkReqDTO)
POST /app/articles/bookmarks/page
{
"pagination": {
"page": 1,
"size": 10
}
}
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",
"thumbnail": [
{
"fileKey": "temp/1234",
"url": "https://jcci-test.app-domain.com/temp/1234"
}
],
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
]
}
}
Resources
ArticleDistrictDTO
properties
The identifier of the article district.
desc
stringThe name of the article district.
ArticleSubCategorySummaryDTO
properties
subcategoryId
numberThe identifier of the subcategory.
type
numberThe type of the subcategory.
desc
stringThe description of the subcategory.
url
stringThe url of the thumbnail.
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.
subcategoryId
The subcategory of the article.
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.
thumbnail
The article thumbnail.
district
The district of the article. Its type must be 0 when category is not 1.
type
The type of the article.
statistics
The statistical information of the article.
publishedAt
datetime上架時間
ArticleDTO
properties
id
stringThe identifier of the article.
title
stringThe title of the article.
content
stringThe content of the article.
thumbnail
The thumbnail of the article.
registrationLink
stringThe registration link of the article, if needed.
category
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.
type
The type 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.
tags
「自定义标签」
statistics
The statistical information of the article.
publishedAt
datetime上架時間
MediaDTO
properties
fileKey
stringrequiredThe S3 key for the file or folder.
url
stringThe url path of the uploaded files.
StatisticDTO
properties
likeNo
numberThe number of likes.
like
booleanIt indicates if the item is liked by the current login user.
bookmark
booleanIt indicates if the item is bookmarked by the current login user.
read
booleanIt indicates if the item is read by the current login user.
ArticleTagDTO
properties
id
stringThe id of the article tag.
name
stringThe name of the article tag.
FilterArticleBookmarkReqDTO
properties
Indicates the page information of the resource.
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 |
ActivityDistrictEnum
Name | Value |
---|---|
- | 0 |
九龍 | 1 |
新界 | 2 |
葵涌安泰軒 | 3 |
深水埗安泰軒 | 4 |
屯門安泰軒 | 5 |
天水圍安泰軒 | 6 |
油尖旺安泰軒 | 7 |
離島安泰軒 | 8 |
復元有晴天(九龍西) | 9 |
復元有晴天(新界西) | 10 |