Skip to main content

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
    string
    The identifier of the community.
  • name
    string
    The short name of the community.
  • description
    string
    The chinese name of the community.
  • code
    CommunityEnum
    The enum of the community.
  • infoCount
    number
    The number of the information in the community.
  • checkInCount
    number
    The number of check-in in the community.
  • buildingCount
    number
    The number of buildings in the community.

CommunityDetailDTO

properties
  • district
    CommunityMapDistrictDTO
    The detail of the community along with the statistics.
  • The check-in photos of the user.
  • The user's wallet.

CommunityMapMediaDTO

properties
  • {number}
    string
    The No. of the buildings in the community.
  • fileKey
    string
    The S3 object key.
  • url
    string
    The url path of the file.
  • isDefault
    boolean
    If 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
    datetime
    The upload time for the photo.

UserWalletDTO

properties
  • coin
    number
    User's coin.
  • exp
    number
    User's experience
  • token
    number
    User's token for checkin.

CommunityDistrictsRespDTO

properties
  • id
    string
    required
    社區資源區域ID
  • name
    string
    required
    社區資源區域名稱

CommunityResourcePageReqDTO

properties
  • communityId
    string
    required
    社區地區ID
  • type
    int
    社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊 不傳-全部

CommunityResourcePageRespDTO

This class extends PaginationAndSorting

properties
  • id
    string
    required
    社區資源ID
  • name
    string
    required
    社區資源類名稱
  • address
    string
    required
    社區資源地址
  • type
    int
    required
    社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊
  • subType
    string
    required
    社區資源子類型

CommunityResourceAppDetailRespDTO

properties
  • id
    string
    required
    社區資源ID
  • externalId
    string
    required
    社區資源額外ID
  • name
    string
    required
    社區資源類名稱
  • phone
    string
    required
    電話
  • address
    string
    required
    社區資源地址
  • introduce
    string
    required
    介紹
  • fileKey
    String
    required
    圖片fileKey
  • url
    String
    required
    圖片url


CommunityEnum

NameValue
將軍澳/西貢0
九龍城1
觀塘2
沙田/馬鞍山3
大埔/北區4
黃大仙5
深水埗6
東涌7
屯門8
天水圍9
荃葵青10
元朗11
油尖旺12