Skip to main content

Community API

Related to community-resource

Endpoints

# Endpoints


All community districts

獲取所有社區區域

Request

GET /web/community-resource/districts

Response (CommunityDistrictsRespDTO)

{
"success": true,
"message": "",
"data": [
{
"id": "d83d7ff6-3755-11ef-a4fb-4a12d8c2d6fd",
"name": "屯門"
},
{
"id": "d83d8384-3755-11ef-a4fb-4a12d8c2d6fd",
"name": "元朗"
}
]
}

All resource types

獲取所有社區資源類型

Request

GET /web/community-resource/types

Response (ResourceTypesRespDTO)

{
"success": true,
"message": "",
"data": [
{
"type": 1,
"typeDesc": "衣",
"subtypes": [
{
"subTypeId": "d842c68c-3755-11ef-a4fb-4a12d8c2d6fd",
"subTypeDesc": "服裝店"
},
{
"subTypeId": "d842c844-3755-11ef-a4fb-4a12d8c2d6fd",
"subTypeDesc": "二手衣服買賣"
}
]
},
{
"type": 2,
"typeDesc": "食",
"subtypes": [
{
"subTypeId": "d842c8a8-3755-11ef-a4fb-4a12d8c2d6fd",
"subTypeDesc": "餐廳"
},
{
"subTypeId": "d842c8c6-3755-11ef-a4fb-4a12d8c2d6fd",
"subTypeDesc": "食物援助"
},
{
"subTypeId": "d842c8e4-3755-11ef-a4fb-4a12d8c2d6fd",
"subTypeDesc": "食材購買"
}
]
}
]
}

Create community resource

創建社區資源

Request (CommunityResourceCreationReqDTO)

POST /web/community-resource
{
"name": "維多利亞港",
"phone": "89745613",
"address": "維港近海",
"fileKey": "temp/aa3a515d-bebe-4e1d-86ae-0b3deaf985d5",
"resourceId": "d842c9de-3755-11ef-a4fb-4a12d8c2d6fd",
"communityId": "d83d885c-3755-11ef-a4fb-4a12d8c2d6fd",
"introduce": "我是一隻大黃鴨"
}

Response

{
"success": true,
"message": "",
"data": null
}

Get community resource

獲取社區資源詳情

Request

GET /web/community-resource/a2a1ba80-ad23-4bf7-a15a-0ef88ffbc2e8

Response (CommunityResourceDetailRespDTO)

{
"success": true,
"message": "",
"data": {
"externalId": "CR001",
"name": "UNIQLO",
"phone": "89745612",
"address": "直行转左上二楼",
"introduce": null,
"status": 1,
"createdAt": "2024-07-01T14:26:19.753569",
"type": 1,
"subType": "服裝店",
"communityName": "TseungKwanO&SaiKung",
"communityDistrict": "將軍澳/西貢",
"pic": {
"fileKey": "mhahk/community/info/TseungKwanO&SaiKung/clothes/CR001/image/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/community/info/TseungKwanO&SaiKung/clothes/CR001/image/1"
}
}
}

Community resource page

社區資源分頁

Request (CommunityResourceFilterReqDTO)

POST /web/community-resource/page
{
"status": 1,
"communityIds": [
"d83d84b0-3755-11ef-a4fb-4a12d8c2d6fd",
"d83d885c-3755-11ef-a4fb-4a12d8c2d6fd"
],
"types": [
1,
2,
3,
4
],
"subTypeIds": [
"d842c68c-3755-11ef-a4fb-4a12d8c2d6fd",
"d842c9de-3755-11ef-a4fb-4a12d8c2d6fd"
],
"pagination": {
"page": 1,
"size": 10
},
"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": "e9cf673f-ae8f-4196-86be-9e9bdaca24d3",
"name": "維多利亞港",
"communityDistrict": "油尖旺",
"type": 4,
"subType": "消閒娛樂",
"phone": "89745613",
"status": 1,
"updatedAt": "2024-07-01T14:39:37.053369"
},
{
"id": "a2a1ba80-ad23-4bf7-a15a-0ef88ffbc2e8",
"name": "UNIQLO",
"communityDistrict": "將軍澳/西貢",
"type": 1,
"subType": "服裝店",
"phone": "89745612",
"status": 1,
"updatedAt": "2024-07-01T14:26:19.753569"
}
]
}
}

Get community resource statuses

獲取社區資源能夠改變的狀態

Request

GET /web/community-resource/status/{current-status}

Response (CommunityResourceStatusesRespDTO)

{
"success": true,
"message": "",
"data": [
{
"status": 2,
"desc": "待主任審批"
},
{
"status": 3,
"desc": "待督導審批"
}
]
}

Update community resource

更新社區資源信息

Request (CommunityResourceUpdateReqDTO)

PUT /web/community-resource
{
"id": "e9cf673f-ae8f-4196-86be-9e9bdaca24d3",
"name": "維多利亞港可愛大黃鴨",
"phone": "",
"address": "灣仔區島灣仔博覽道1號香港會議展覽中心",
"fileKey": "temp/aa3a515d-bebe-4e1d-86ae-0b3deaf985d5",
"resourceId": "d842c9de-3755-11ef-a4fb-4a12d8c2d6fd",
"communityId": "d83d885c-3755-11ef-a4fb-4a12d8c2d6fd",
"introduce": "願世界和平"
}

Response

{
"success": true,
"message": "",
"data": null
}

Delete community resource

删除社區資源詳情

Request

DELETE /web/community-resource/{id}

Response

{
"success": true,
"message": "",
"data": null
}

Update community resource status

更新社區資源審批狀態

Request (CommunityResourceUpdateStatusReqDTO)

PUT /web/community-resource/status
{
"id": "e9cf673f-ae8f-4196-86be-9e9bdaca24d3",
"status": "2",
"mark": "掂!"
}

Response

{
"success": true,
"message": "",
"data": null
}

Batch update community resource status

批量更新社區資源審批狀態

Request (CommunityResourceBatchUpdateStatusReqDTO)

PUT /web/community-resource/batch-status
{
"ids": [
"e9cf673f-ae8f-4196-86be-9e9bdaca24d3"
],
"status": "2",
"mark": "掂!"
}

Response

{
"success": true,
"message": "",
"data": null
}

Community resource status count

統計社區資源審批數

Request

GET /web/community-resource/count

Response (CommunityResourceStatusCountResp)

{
"success": true,
"message": "",
"data": [
{
"draftCount": 3,
"secondDraftCount": 0,
"thirdDraftCount": 0,
"readyCount": 0,
"publishCount": 0,
"pullCount": 1
}
]
}

Community resource log count

統計社區資源審批數

Request

GET /web/community-resource/{id}/log-count

Response (CommunityResourceLogCountResp)

{
"success": true,
"message": "",
"data": [
{
"logCount": 1
}
]
}

Community resource logs

社區資源審批紀錄分頁


本接口請求必須以“communityResourceUpdatedAt”字段進行DESC排序

Request (PaginationAndSorting)

POST /web/community-resource/{id}/logs
{
"pagination": {
"page": 1,
"size": 3,
"totalItems": 1,
"totalPages": 1
},
"sortings": [
{
"property": "createdAt",
"direction": "DESC"
}
]
}

Response (CommunityResourceLogsResp)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 27,
"totalPages": 3
},
"sortings": [
{
"direction": "DESC",
"property": "communityResourceUpdatedAt"
}
],
"items": [
{
"updatedAt": "2024-07-09T02:12:26.379381Z",
"content": "呂渚餁(主任)更改社區資源狀態為【已下架】",
"mark": "落架"
},
{
"updatedAt": "2024-07-05T16:55:20.599576Z",
"content": "呂渚餁(主任)更改社區資源狀態為【已上架】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:55:10.985792Z",
"content": "呂渚餁(主任)更改社區資源狀態為【已下架】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:54:16.872159Z",
"content": "null(支援同工)更改社區資源狀態為【已上架】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:53:55.708197Z",
"content": "史大督(督導)更改社區資源狀態為【未上架】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:53:10.727756Z",
"content": "呂渚餁(主任)更改社區資源狀態為【待督導審批】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:53:05.876590Z",
"content": "呂渚餁(主任)更改社區資源狀態為【草稿】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:52:11.444522Z",
"content": "呂渚餁(主任)更改社區資源狀態為【待主任審批】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:50:08.535855Z",
"content": "null(支援同工)更改社區資源狀態為【草稿】",
"mark": "掂!"
},
{
"updatedAt": "2024-07-05T16:35:37.093775Z",
"content": "null(支援同工)更改社區資源狀態為【待主任審批】",
"mark": "掂!"
}
]
}
}


Resources

CommunityResourceCreationReqDTO

properties
  • name
    string
    required
    [1 ... 50]
    名稱
  • phone
    string
    [0 ... 20]
    聯繫電話
  • address
    string
    required
    [1 ... 255]
    具體地址
  • fileKey
    string
    required
    上傳圖片後的fileKey
  • resourceId
    string
    required
    子分類ID
  • communityId
    string
    required
    社區區域ID
  • introduce
    string
    [0 ... 100]
    介紹

CommunityResourceDetailRespDTO

properties
  • externalId
    string
    required
    外部ID
  • name
    string
    required
    名稱
  • phone
    string
    聯繫電話
  • address
    string
    required
    具體地址
  • introduce
    string
    介紹
  • status
    int
    required
    社區資源狀態: 1-草稿 2-待主任審批 3-待督導審批 4-未上架 5-已上架 6-已下架
  • createdAt
    datetime
    required
    創建時間
  • type
    int
    required
    社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊
  • sub_type
    String
    required
    子類型
  • communityDistrict
    String
    required
    介紹
  • fileKey
    string
    required
    上傳圖片的fileKey
  • url
    string
    required
    圖片URL

CommunityDistrictsRespDTO

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

ResourceTypesRespDTO

properties
  • type
    int
    required
    社區資源類型
  • typeDesc
    string
    required
    社區資源類型說明
  • subTypeId
    String
    required
    社區資源子類型ID
  • subTypeDesc
    string
    required
    社區資源子類型說明

CommunityResourceFilterReqDTO

properties
  • status
    int
    required
    社區資源狀態: 1-草稿 2-待主任審批 3-待督導審批 4-未上架 5-已上架 6-已下架
  • communityIds
    array[string]
    社區區域ID
  • types
    array[int]
    社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊
  • subTypeIds
    array[string]
    社區資源子類型ID

CommunityResourcePageRespDTO

This class extends PaginationAndSorting

properties
  • id
    string
    required
    社區資源ID
  • name
    string
    required
    社區資源類名稱
  • communityDistrict
    string
    required
    社區區域
  • type
    int
    required
    社區資源類型: 1-衣 2-食 3-住 4-行 5-社福資訊
  • subType
    string
    required
    社區資源子類型
  • phone
    string
    聯繫電話
  • status
    int
    required
    狀態
  • updatedAt
    datetime
    required
    最後修改時間

CommunityResourceUpdateReqDTO

properties
  • id
    string
    required
    社區資源ID
  • name
    string
    [0 ... 50]
    名稱
  • phone
    string
    [0 ... 20]
    聯繫電話
  • address
    string
    [0 ... 255]
    具體地址
  • fileKey
    string
    上傳圖片後的fileKey
  • resourceId
    string
    子分類ID
  • communityId
    string
    社區區域ID
  • introduce
    string
    [0 ... 100]
    介紹

CommunityResourceStatusesRespDTO

properties
  • status
    int
    required
    社區資源類審批狀態
  • desc
    string
    required
    社區資源審批狀態說明

CommunityResourceUpdateStatusReqDTO

properties
  • id
    string
    required
    社區資源ID
  • status
    int
    required
    社區資源審批狀態
  • mark
    string
    備註

CommunityResourceBatchUpdateStatusReqDTO

properties
  • ids
    array[string]
    required
    社區資源IDS
  • status
    int
    required
    社區資源審批狀態
  • mark
    string
    備註

CommunityResourceStatusCountResp

properties
  • draftCount
    int
    required
    草稿數
  • secondDraftCount
    int
    required
    待主任審批數
  • thirdDraftCount
    int
    required
    待督導審批數
  • readyCount
    int
    required
    待上架數
  • publishCount
    int
    required
    已上架數
  • pullCount
    int
    required
    下架數

CommunityResourceLogCountResp

properties
  • logCount
    int
    required
    紀錄數

CommunityResourceLogsResp

This class extends PaginationAndSorting

properties
  • updatedAt
    datetime
    required
    更新時間
  • content
    string
    required
    更新內容
  • mark
    string
    備註