Community API
The community API provides all the APIs related to community resource and community map.
Endpoints
# Endpoints
Get community districts
This endpoint gets all the districts with statisitcs.
Request
GET /app/community-map/districts
Response (CommunityMapDistrictDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "c5fdce33-384c-11ef-8cf0-7085c2d96f0d",
"name": "TuenMun",
"description": "屯門",
"code": 8,
"infoCount": 1,
"checkInCount": 0,
"buildingCount": 4
}
]
}
Get community map detail
This endpoint gets the detail of a community.
Request (CommunityEnum)
GET /app/community-map/{communityEnum}
Response (CommunityDetailDTO)
{
"success": true,
"message": "",
"data": [
{
"district": {
"id": "c5fdce33-384c-11ef-8cf0-7085c2d96f0d",
"name": "TuenMun",
"description": "屯門",
"code": 8,
"infoCount": 1,
"checkInCount": 0,
"buildingCount": 4
},
"photos": {
"1": {
"fileKey": "share/default/community/map/1",
"url": "https://jcci-test-media.aritaone.com/share/default/community/map/1",
"isDefault": true,
"uploadTime": "2024-07-18T07:25:23.000Z"
}
},
"wallet": {
"coin": 0,
"exp": 0,
"token": 0
}
}
]
}
Upload community photo
This endpoint uploads check-in photo.
Request (CommunityUploadMediaDTO)
POST /app/community-map/{communityEnum}/{number}
Key | Type | Value |
---|---|---|
file | file | - |
Response
{
"success": true,
"message": "",
"data": null
}
Delete community photo
This endpoint deletes check-in photo.
Request
DELETE /app/community-map/{communityEnum}/{number}
Response
{
"success": true,
"message": "",
"data": null
}
All community districts
獲取所有社區區域
Request
GET /app/community-resource/districts
Response (CommunityDistrictsRespDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "d83d7ff6-3755-11ef-a4fb-4a12d8c2d6fd",
"name": "屯門"
},
{
"id": "d83d8384-3755-11ef-a4fb-4a12d8c2d6fd",
"name": "元朗"
}
]
}
Community resource page
社區資源分頁
Request (CommunityResourcePageReqDTO)
POST /app/community-resource/page
{
"communityId": "d83d84b0-3755-11ef-a4fb-4a12d8c2d6fd",
"type": 4,
"pagination": {
"page": 1,
"size": 10,
"totalItems": 2,
"totalPages": 1
},
"sortings": [
{
"direction": "DESC",
"property": "createdAt"
}
]
}
Response (CommunityResourcePageRespDTO)
{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 2,
"totalPages": 1
},
"sortings": [
{
"direction": "DESC",
"property": "createdAt"
}
],
"items": [
{
"id": "a2a1ba80-ad23-4bf7-a15a-0ef88ffbc2e8",
"name": "素海霖影像馆",
"address": "重庆大厦5楼03单元",
"type": 4,
"subType": "健心健身"
}
]
}
}
Community Resource Detail
查看社區資源詳情信息
Request
GET /app/community-resource/{id}
Response (CommunityResourceAppDetailRespDTO)
{
"success": true,
"message": "",
"data": {
"id": "e29a02fb-174a-4373-9bc3-4426d7cd974c",
"externalId": "CR003",
"name": "素海霖影像馆",
"phone": "89723612",
"address": "重庆大厦5楼03单元",
"introduce": null,
"pic": {
"fileKey": "mhahk/community/info/KowLoonCity/act/CR003/image/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/community/info/KowLoonCity/act/CR003/image/1"
}
}
}
Resources
CommunityMapDistrictDTO
properties
id
stringThe identifier of the community.
name
stringThe short name of the community.
description
stringThe chinese name of the community.
code
The enum of the community.
infoCount
numberThe number of the information in the community.
checkInCount
numberThe number of check-in in the community.
buildingCount
numberThe number of buildings in the community.
CommunityDetailDTO
properties
district
The detail of the community along with the statistics.
photos
The check-in photos of the user.
wallet
The user's wallet.
CommunityMapMediaDTO
properties
{number}
stringThe No. of the buildings in the community.
fileKey
stringThe S3 object key.
url
stringThe url path of the file.
isDefault
booleanIf true, this file is a default photo and the user has not uploaded the photo; if false, this file is user's uploaded file.
modifiedTime
datetimeThe upload time for the photo.
UserWalletDTO
properties
coin
numberUser's coin.
exp
numberUser's experience
token
numberUser's token for checkin.
CommunityDistrictsRespDTO
properties
id
stringrequired社區資源區域ID
name
stringrequired社區資源區域名稱
CommunityResourcePageReqDTO
properties
communityId
stringrequired社區地區ID
type
int社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊 不傳-全部
CommunityResourcePageRespDTO
This class extends PaginationAndSorting
properties
id
stringrequired社區資源ID
name
stringrequired社區資源類名稱
address
stringrequired社區資源地址
type
intrequired社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊
subType
stringrequired社區資源子類型
CommunityResourceAppDetailRespDTO
properties
id
stringrequired社區資源ID
externalId
stringrequired社區資源額外ID
name
stringrequired社區資源類名稱
phone
stringrequired電話
address
stringrequired社區資源地址
introduce
stringrequired介紹
fileKey
Stringrequired圖片fileKey
url
Stringrequired圖片url
CommunityEnum
Name | Value |
---|---|
將軍澳/西貢 | 0 |
九龍城 | 1 |
觀塘 | 2 |
沙田/馬鞍山 | 3 |
大埔/北區 | 4 |
黃大仙 | 5 |
深水埗 | 6 |
東涌 | 7 |
屯門 | 8 |
天水圍 | 9 |
荃葵青 | 10 |
元朗 | 11 |
油尖旺 | 12 |