# 車友地圖 - API串接 ### base URL https://www.motofunshop.nuxmax.com/cloud_car_cool_app ## 會員登入 #### [POST] `/api/Auth/loginAuth` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | UID | string | Y | 第三方登入回應的UID | | providerID | string | Y | eg. facebook.com, google.com... | ### Request 範例 ```json { "UID":"52IGmbXMuDQpLJBFAAEf9lhYaaD3", "providerID":"Facebook.com" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | data | string | 成功:token 失敗:null| | message | string | 回應訊息 | | code | int | HTTP Status code | ### Response 範例 成功 :::success 登入 ```json { "data":"Kw6ajHNWQ3rnM3u1Z0BL", "message":"success", "code":200 } ``` 已登入 ```json { "data":null, "message":"connected", "code":200 } ``` ::: 失敗 :::danger ```json { "data":null, "message":"error login", "code":400 } ``` ::: ## 會員登出 #### [POST] `/api/Auth/logout` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | UID | string | Y | 第三方登入回應的UID | ### Request 範例 ```json { "UID":"52IGmbXMuDQpLJBFAAEf9lhYaaD3" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | data | string | null| | message | string | 回應訊息 | | code | int | HTTP Status code | ### Response 範例 成功 :::success 登出 ```json { "data":null, "message":"success", "code":200 } ``` ::: 失敗 :::danger ```json { "data":null, "message":"error logout", "code":400 } ``` ::: ## 會員註冊(手機) ## 個人資訊 ### 取得個人資訊 #### [GET] `/api/Users/info` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者Id | ### Request 範例 ```json { "user_id": "4" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | user_id | | profile_photo | string | 頭貼 | | nick_name | string | 暱稱 | | gender | string | 0:女性 1:男性 | | bio | string | 自介 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "4", "profile_photo": null, "nick_name": "test4", "gender": null, "bio": null } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 沒有資料 ```json { "data":null, "message":"failed get info", "code":400 } ``` 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 儲存編輯個人資訊 #### [POST] `/api/Users/saveEdit` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | multipart/form-data | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | 使用者Id | | file | binary | 頭貼 | | nick_name | string | 暱稱 | | gender | string | 0:女性 1:男性 | | bio | string | 自介 | ### Request 範例 ```json { "user_id": "4", "profile_photo": "ooooxxxx.jpg", "nick_name": "test4更新", "gender": "1", "bio": "自我介紹自我介紹自我介紹" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 更新失敗 ```json { "data":null, "message":"failed updating", "code":400 } ``` 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 取得個人資訊 #### [GET] `/api/Users/getAllPostAndActivity` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者Id | ### Request 範例 ```json= { "user_id": "4" } ``` ### Response 範例 成功 :::success ```json { "posts": [ { "id": "1", "pic_id": "1", "file_path": "uploads/", "file_name": "messageImage_1621075270692.jpg", "user_id": "6" }, { "id": "1", "pic_id": "2", "file_path": "uploads/", "file_name": "messageImage_1621075211939.jpg", "user_id": "6" } ], "activities": [ { "id": "1", "pic_id": "1", "file_path": "uploads/activity", "file_name": "1620785939421.jpg", "user_id": "6" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 沒有資料 ```json { "data":null, "message":"failed get info", "code":400 } ``` 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ## 粉絲 ### 粉絲列表 #### [GET] `/api/Followers/list` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者user_id | ### Request 範例 ```json { "user_id":"1" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 序號 | | UID | string | 第三方登入回應的UID | | providerID | string | eg. facebook.com, google.com… | | token | string | token | | nick_name | string | 暱稱 | | gender | string | 性別 | | created_at | string | 新增日期 | | cellphone | string | 手機門號 | | place_of_residence | string | 居住地 | | bio | string | 自介 | | profile_photo | string | 個人頭像 | | isExpired | string | 是否重新登入 | | user_id | string | 使用者user_id | | fid | string | 粉絲user_id | | status | string | 追蹤狀態 0:未追蹤 1:已追蹤 | ### Response 範例 成功 :::success 無粉絲 ```json {"data":[],"message":"success","code":200} ``` 有粉絲 ```json { "data": [ { "id": "1", "UID": "22IGmbXMuRQpLJBFAAEf9lhGaaD3", "providerID": "facebook.com", "token": "KT6ajHNRQ3rnM3u1Z0BL", "nick_name": "test2", "gender": null, "created_at": "2021-05-20 01:35:39", "cellphone": null, "place_of_residence": null, "bio": null, "profile_photo": null, "isExpired": "0", "user_id": "1", "fid": "2", "status": null }, { "id": "2", "UID": "34IGmbXMuRQpLJBFBAEf9lhGaaD3", "providerID": "facebook.com", "token": "KN6ajJIRQ3rnM3u1Z0BL", "nick_name": "test3", "gender": null, "created_at": "2021-05-20 02:15:41", "cellphone": null, "place_of_residence": null, "bio": null, "profile_photo": null, "isExpired": "0", "user_id": "1", "fid": "3", "status": null } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 取得單一粉絲 #### [GET] `/api/Followers/getFollower` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | user_id | string | 使用者Id | | fid | string | 粉絲Id | ### Request 範例 ```json { "user_id":"2", "fid":"6" } ``` ### Response 範例 成功 :::success 有資料 ```json { "data": [ { "id": "3", "fid": "6", "nick_name": "test5更新", "bio": "自我介紹自我介紹自我介紹", "profile_photo": "messageImage_1621075270692.jpg" } ], "message": "success", "code": 200 } ``` 無資料 ```json { "data":[], "message":"success", "code":200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 取得粉絲失敗 ```json { "data":null, "message":"failed get follower", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 追蹤 #### [POST] `/api/Followers/follow` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | token | token | ### Request 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | user_id | string | 使用者Id | | fid | string | 粉絲Id | ### Request 範例 ```json { "user_id":"2", "fid":"6" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 移除粉絲 #### [POST] `/api/Followers/remove` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | token | token | ### Request 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | user_id | string | 使用者Id | | fid | string | 粉絲Id | ### Request 範例 ```json { "user_id":"2", "fid":"6" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ## 追蹤中 ### 追蹤中列表 #### [GET] `/api/Following/list` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者user_id | ### Request 範例 ```json { "user_id":"2" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 序號 | | UID | string | 第三方登入回應的UID | | providerID | string | eg. facebook.com, google.com… | | token | string | token | | nick_name | string | 暱稱 | | gender | string | 性別 | | created_at | string | 新增日期 | | cellphone | string | 手機門號 | | place_of_residence | string | 居住地 | | bio | string | 自介 | | profile_photo | string | 個人頭像 | | isExpired | string | 是否重新登入 | | user_id | string | 使用者user_id | | fid | string | 追蹤人user_id | | status | string | 追蹤狀態 0:未追蹤 1:已追蹤 | ### Response 範例 成功 :::success 無追蹤 ```json { "data":[], "message":"success", "code":200 } ``` 有追蹤 ```json { "data": [ { "id": "7", "UID": "52IGmbXMuDQpLJBFAAEf9lhYaaD3", "providerID": "facebook.com", "token": "KWWurUiNLm5wCiqnFkKd", "nick_name": "test5更新", "gender": "1", "created_at": "2021-06-10 14:48:37", "login_at": "2021-06-08 12:12:48", "cellphone": null, "place_of_residence": null, "bio": "自我介紹自我介紹自我介紹", "file_path": "uploads/users/", "profile_photo": "messageImage_1621075270692.jpg", "isExpired": "0", "user_id": "2", "fid": "6", "status": "1" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 取得單一追蹤中 #### [GET] `/api/Following/getFollowing` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | user_id | string | 使用者Id | | fid | string | 追蹤中Id | ### Request 範例 ```json { "user_id":"2", "fid":"6" } ``` ### Response 範例 成功 :::success 無追蹤 ```json { "data":[], "message":"success", "code":200 } ``` 有追蹤 ```json { "data": [ { "id": "3", "fid": "6", "nick_name": "test5更新", "bio": "自我介紹自我介紹自我介紹", "profile_photo": "messageImage_1621075270692.jpg" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 退追蹤 #### [POST] `/api/Following/unfollow` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | token | token | ### Request 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | user_id | string | 使用者Id | | fid | string | 追蹤中Id | ### Request 範例 ```json { "user_id":"2", "fid":"6" } ``` ### Response 範例 成功 :::success ```json { "data":null, "message":"success", "code":200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ## 車庫 ### 取得品牌 #### [GET] `/api/garage/brands` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 品牌Id | | name | string | 品牌名稱 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "name": "Alfa Romeo" }, { "id": "2", "name": "Aston Martin" }, { "id": "3", "name": "Audi" }, { "id": "4", "name": "Bentley" }, { "id": "5", "name": "BMW" }, { "id": "6", "name": "Chevrolet" }, { "id": "7", "name": "Ferrari" }, { "id": "8", "name": "Ford" }, { "id": "9", "name": "Honda" }, { "id": "10", "name": "Hummer" }, { "id": "11", "name": "Hyundai" }, { "id": "12", "name": "Infiniti" }, { "id": "13", "name": "Isuzu" }, { "id": "14", "name": "Jaguar" }, { "id": "15", "name": "Jeep" }, { "id": "16", "name": "Kia" }, { "id": "17", "name": "Lamborghini" }, { "id": "18", "name": "Land Rover" }, { "id": "19", "name": "Lexus" }, { "id": "20", "name": "Lotus" }, { "id": "21", "name": "Luxgen" }, { "id": "22", "name": "Maserati" }, { "id": "23", "name": "Mazda" }, { "id": "24", "name": "M-BENZ" }, { "id": "25", "name": "McLaren" }, { "id": "26", "name": "Mini" }, { "id": "27", "name": "Mitsubishi" }, { "id": "28", "name": "Nissan" }, { "id": "29", "name": "Peugeot" }, { "id": "30", "name": "Porsche" }, { "id": "31", "name": "Rolls-Royce" }, { "id": "32", "name": "Skoda" }, { "id": "33", "name": "Smart" }, { "id": "34", "name": "Subaru" }, { "id": "35", "name": "Suzuki" }, { "id": "36", "name": "Tesla" }, { "id": "37", "name": "Toyota" }, { "id": "38", "name": "Volkswagen" }, { "id": "39", "name": "Volvo" }, { "id": "40", "name": "其他" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 無資料 ```json { "data":null, "message":"failed get brands", "code":400 } ``` ::: ### 新增車輛 #### [POST] `/api/Garage/add` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | multipart/form-data | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | int | Y | 使用者id | | brand_id | int | Y | 品牌id | | series | string | Y | 車系 | | factory | string | Y | 出廠年分 | ### Request 範例 ```json { "user_id": 6, "brand_id": 7, "series": "458", "factory": "2010" } ``` ### Response 範例 成功 :::success ```json { "data": null "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 取得單一車輛 #### [GET] `/api/Garage/car` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | int | Y | 使用者id | | garage_id | int | Y | 品牌id | ### Request 範例 ```json { "user_id": 6, "garage_id": 1 } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 車輛Id | | created_at | string | 新增日期 | | user_id | string | 使用者Id | | status | string | | | brand_id | string | 品牌Id | | series | string | 車系 | | factory | string | 出廠日期 | | garage_file_path | string | 車輛圖片檔案路徑 | | garage_photo | string | 車輛圖片檔名 | | license_file_path | string | 行照圖片檔案路徑 | | license_photo | string | 行照圖片檔名 | | token | string | 車輛連結參數 | | name | string | 品牌名稱 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "created_at": "2021-06-08 14:38:03", "user_id": "6", "status": "1", "brand_id": "7", "series": "458", "factory": "2010", "garage_file_path": "uploads/garage/", "garage_photo": "messageImage_1621075211939.jpg", "license_file_path": "uploads/license/", "license_photo": "1620785895334.jpg", "token": "1J3fdkqOnUpSDIsK4G63", "name": "Ferrari" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 取得失敗 ```json { "data":null, "message":"failed get car", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 儲存編輯車輛 #### [POST] `/api/Garage/saveEdit` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | garage_id | string | Y | 車庫id | | brand_id | string | Y | 品牌id | | series | string | Y | 車系 | | factory | string | Y | 出廠年分 | ### Request 範例 ```json { "user_id": 6, "garage_id": "1", "brand_id": 1, "series": "SF90", "factory": "2012" } ``` ### Responce 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 更新失敗 ```json { "data":null, "message":"failed updating", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 取得單一車輛 #### [GET] `/api/Garage/car` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | int | Y | 使用者id | ### Request 範例 ```json { "user_id": 6 } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 車輛Id | | created_at | string | 新增日期 | | user_id | string | 使用者Id | | status | string | | | brand_id | string | 品牌Id | | series | string | 車系 | | factory | string | 出廠日期 | | garage_file_path | string | 車輛圖片檔案路徑 | | garage_photo | string | 車輛圖片檔名 | | license_file_path | string | 行照圖片檔案路徑 | | license_photo | string | 行照圖片檔名 | | token | string | 車輛連結參數 | | name | string | 品牌名稱 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "created_at": "2021-06-08 14:38:03", "user_id": "6", "status": "1", "brand_id": "7", "series": "458", "factory": "2010", "garage_file_path": "uploads/garage/", "garage_photo": "messageImage_1621075211939.jpg", "license_file_path": "uploads/license/", "license_photo": "1620785895334.jpg", "token": "1J3fdkqOnUpSDIsK4G63", "name": "Ferrari" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 取得失敗 ```json { "data":null, "message":"failed get list", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"bad request", "code":400 } ``` ::: ### 移除單一車輛 #### [POST] `/api/Garage/remove` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | garage_id | string | Y | 車庫id | ### Request 範例 ```json { "user_id": 6, "garage_id": 1, } ``` ### Responce 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 更新失敗 ```json { "data":null, "message":"failed removing", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 是否有新增車輛 ## 貼文 ### 取得單一貼文 #### [GET] `/api/Post/get` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | ### Request 範例 ```json { "user_id":"6", "post_id":"1" } ``` ### Response 欄位 info | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | post id | | user_id | string | 使用者id | | sort | string | 排序 | | content | string | 貼文內容 | | position | string | 經緯度座標 | | place | string | 地點地址 | | authority | string | 貼文權限 | | is_comment | string | 留言功能 0:否 1:是 | | created_at | string | po文時間 | | seen | string | 觀看次數 | | likes | string | 按讚次數 | | hashtag | string | 貼文標籤 | | status | string | 狀態 | | token | string | 貼文token | | is_report | string | 檢舉 0:否 1:是 | pic | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | pic id | | file_path | string | 檔案路徑 | | file_name | string | 圖片檔名 | comment | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | comment id | | post_id | string | 貼文id | | user_id | string | 使用者id | | comment | string | 留言內容 | | created_at | string | 留言時間 | | profile_photo | string | 留言人頭貼 | | nick_name | string | 留言人暱稱 | comment -> reply | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | reply id | | post_id | string | 貼文id | | user_id | string | 使用者id | | profile_photo | string | 回覆人頭貼 | | nick_name | string | 留言人暱稱 | | reply | string | 回覆內容 | | created_at | string | 回覆時間 | | cid | string | comment id | | rid | string | reply id | ### Response 範例 成功 :::success ```json { "data": { "info": [ { "id": "1", "user_id": "6", "sort": "0", "content": "貼文一", "position": "53.299671, -6.267786", "place": "地點地址", "authority": "0", "is_comment": "1", "created_at": "2021-05-27 14:49:01", "seen": "6", "likes": "0", "hashtag": "", "status": "1", "token": "DJVz1TLbTcqtF7Spu58L", "is_report": "0" } ], "pic": [ { "id": "1", "file_path": "uploads/", "file_name": "messageImage_1621075270692.jpg" }, { "id": "2", "file_path": "uploads/", "file_name": "messageImage_1621075211939.jpg" } ], "comment": [ { "id": "7", "post_id": "1", "user_id": "6", "comment": "add another comment", "created_at": "2021-05-28 12:20:14", "profile_photo": null, "nick_name": "test5", "reply": [ { "id": "5", "post_id": "1", "user_id": "6", "profile_photo": null, "nick_name": "test5", "reply": "comment 7's reply", "created_at": "2021-05-28 17:34:00", "cid": "7", "rid": "5" }, { "id": "1", "post_id": "1", "user_id": "6", "profile_photo": null, "nick_name": "test5", "reply": "comment 7's reply", "created_at": "2021-05-28 17:08:30", "cid": "7", "rid": "1" } ] }, { "id": "6", "post_id": "1", "user_id": "6", "comment": "add another comment", "created_at": "2021-05-28 12:19:58", "profile_photo": null, "nick_name": "test5", "reply": [ { "id": "4", "post_id": "1", "user_id": "6", "profile_photo": null, "nick_name": "test5", "reply": "comment 6's reply", "created_at": "2021-05-28 17:31:56", "cid": "6", "rid": "4" }, { "id": "3", "post_id": "1", "user_id": "6", "profile_photo": null, "nick_name": "test5", "reply": "comment 6's reply", "created_at": "2021-05-28 17:13:49", "cid": "6", "rid": "3" } ] }, { "id": "4", "post_id": "1", "user_id": "6", "comment": "add third comment", "created_at": "2021-05-28 12:19:03", "profile_photo": null, "nick_name": "test5" }, { "id": "3", "post_id": "1", "user_id": "6", "comment": "add second comment", "created_at": "2021-05-28 12:15:48", "profile_photo": null, "nick_name": "test5" }, { "id": "1", "post_id": "1", "user_id": "6", "comment": "add one comment", "created_at": "2021-05-28 12:08:38", "profile_photo": null, "nick_name": "test5" } ] }, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 貼文不存在 ```json {"data":null,"message":"this post not exist","code":400} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 新增貼文 #### [POST] `/api/Post/add` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | multipart/form-data | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | content | string | Y | 內文 | | position | string | Y | 地點座標 | | place | string | Y | 地點 | | authority | string | Y | 貼文權限 | ### Request 範例 ```json { "user_id":"6", "content":"貼文一", "position":"53.299671, -6.267786", "place":"地點地址", "authority":"0" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增貼文失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 移除單一貼文 #### [POST] `/api/Post/remove` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | ### Request 範例 ```json { "user_id":"6", "post_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 貼文不存在 ```json { "data":null, "message":"this post not exist", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 隱藏單一貼文 #### [POST] `/api/Post/hide` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | ### Request 範例 ```json { "user_id":"6", "post_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 貼文不存在 ```json { "data":null, "message":"this post not exist", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 取消隱藏單一貼文 #### [POST] `/api/Post/show` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | ### Request 範例 ```json { "user_id":"6", "post_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 貼文不存在 ```json { "data":null, "message":"this post not exist", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 儲存編輯單一貼文 #### [POST] `/api/Post/saveEdit` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | | content | string | Y | 內文 | | position | string | Y | 地點座標 | | place | string | Y | 地點 | | authority | string | Y | 貼文權限 | ### Request 範例 ```json { "user_id":"6", "post_id":"1", "content":"貼文一更新", "position":"53.299773, -8.267746", "place":"地點地址更新", "authority":"0", } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 更新貼文失敗 ```json { "data":null, "message":"failed updating", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 貼文按讚 #### [POST] `/api/Post/like` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 動態貼文id | ### Request 範例 ```json { "user_id":"4", "post_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 無法按讚 ```json { "data":null, "message":"failed like", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 新增留言 #### [POST] `/api/Post/addComment` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 貼文id | | comment | string | Y | 留言 | ### Request 範例 ```json { "user_id":"6", "post_id":"1" "comment":"留言內容" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:------ | | id | string | 留言id | | user_id | string | 使用者id | | post_id | string | 貼文id | | comment | string | 留言 | | created_at | string | 留言時間 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "post_id": "1", "user_id": "6", "comment": "add one comment", "created_at": "2021-05-28 12:08:38" }, { "id": "3", "post_id": "1", "user_id": "6", "comment": "add second comment", "created_at": "2021-05-28 12:15:48" }, { "id": "4", "post_id": "1", "user_id": "6", "comment": "add third comment", "created_at": "2021-05-28 12:19:03" }, { "id": "6", "post_id": "1", "user_id": "6", "comment": "add another comment", "created_at": "2021-05-28 12:19:58" }, { "id": "7", "post_id": "1", "user_id": "6", "comment": "add another comment", "created_at": "2021-05-28 12:20:14" }, { "id": "8", "post_id": "1", "user_id": "6", "comment": "新增留言", "created_at": "2021-06-10 21:54:47" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增留言失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 刪除留言 #### [POST] `/api/Post/removeComment` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | post_id | string | Y | 貼文id | ### Request 範例 ```json { "user_id":"6", "comment_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 刪除留言失敗 ```json { "data":null, "message":"failed deleting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 新增留言回覆 #### [POST] `/api/Post/addReply` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | comment_id | string | Y | 留言id | | reply | string | Y | 新增回覆 | ### Request 範例 ```json { "user_id":"6", "comment_id":"8", "reply":"新增回覆" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:------ | | id | string | 留言id | | user_id | string | 使用者id | | post_id | string | 貼文id | | comment | string | 留言 | | created_at | string | 留言時間 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "6", "user_id": "6", "reply": "新增回覆", "created_at": "2021-06-10 22:54:02", "comment_id": "8" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增回覆失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 刪除留言回覆 #### [POST] `/api/Post/removeReply` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | reply_id | string | Y | 回覆id | ### Request 範例 ```json { "user_id":"6", "reply_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 刪除回覆失敗 ```json { "data":null, "message":"failed deleting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ## 活動 ### 新增活動 #### [POST] `/api/Activity/add` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | name | string | Y | 活動名稱 | | position | string | Y | 座標 | | start_at | string | Y | 活動日期 | | routes_description | string | Y | 路線說明 | | description | string | Y | 活動說明 | | participant_type | string | Y | 接受報名身分(1:認證車主 2:一般車主 3:攝影追焦 4:熱情副駕)| ### Request 範例 ```json { "user_id":"6", "name":"活動名稱", "position":"53.299671, -6.267786", "place":"活動地點地址", "start_at":"2021-06-01", "routes_description":"路線說明", "description":"活動說明", "participant_type":"1,2,3", } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增活動失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 新增留言 #### [POST] `/api/Activity/addComment` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | | comment | string | Y | 留言 | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" "comment":"留言內容" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:------ | | id | string | 留言id | | user_id | string | 使用者id | | activity_id | string | 活動id | | comment | string | 留言 | | created_at | string | 留言時間 | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "activity_id": "1", "user_id": "6", "comment": "活動留言一", "created_at": "2021-06-03 15:39:41" }, { "id": "2", "activity_id": "1", "user_id": "6", "comment": "活動留言二", "created_at": "2021-06-03 15:42:01" }, { "id": "3", "activity_id": "1", "user_id": "4", "comment": "活動留言三(user test4)", "created_at": "2021-06-03 15:47:13" }, { "id": "4", "activity_id": "1", "user_id": "6", "comment": "新增留言", "created_at": "2021-06-11 10:52:37" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增留言失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 刪除留言 #### [POST] `/api/Activity/removeComment` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | comment_id | string | Y | 回覆id | ### Request 範例 ```json { "user_id":"6", "comment_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 刪除留言失敗 ```json { "data":null, "message":"failed deleting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 新增留言回覆 #### [POST] `/api/Activity/addReply` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | comment_id | string | Y | 留言id | | reply | string | Y | 新增回覆 | ### Request 範例 ```json { "user_id":"6", "comment_id":"3", "reply":"新增回覆" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:------ | | id | string | 留言id | | user_id | string | 使用者id | | reply | string | 回覆 | | created_at | string | 留言時間 | | comment_id | string | 留言id | ### Response 範例 成功 :::success ```json { "data": [ { "id": "1", "user_id": "6", "reply": "回覆活動留言三(user test4)", "created_at": "2021-06-03 15:51:54", "comment_id": "3" }, { "id": "2", "user_id": "6", "reply": "第二個回覆活動留言三(user test4)", "created_at": "2021-06-03 16:53:02", "comment_id": "3" }, { "id": "4", "user_id": "6", "reply": "新增回覆", "created_at": "2021-06-11 11:20:15", "comment_id": "3" } ], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 新增回覆失敗 ```json { "data":null, "message":"failed posting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 刪除留言回覆 #### [POST] `/api/Activity/deleteReply` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | reply_id | string | Y | 回覆id | ### Request 範例 ```json { "user_id":"6", "reply_id":"4" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 刪除回覆失敗 ```json { "data":null, "message":"failed deleting", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 點擊單一活動 #### [POST] `/api/Activity/get` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 欄位 info | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | post id | | user_id | string | 使用者id | | sort | string | 排序 | | name | string | 活動名稱 | | position | string | 經緯度座標 | | place | string | 地點地址 | | start_at | string | 活動日期 | | is_comment | string | 留言功能 0:否 1:是 | | created_at | string | 發布活動時間 | | participant_type | string | 接受報名身分(1:認證車主 2:一般車主 3:攝影追焦 4:熱情副駕) | | status | string | 狀態 | | token | string | 貼文token | | is_report | string | 檢舉 0:否 1:是 | pic | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | pic id | | file_path | string | 檔案路徑 | | file_name | string | 圖片檔名 | comment | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | comment id | | activity_id | string | 活動id | | user_id | string | 使用者id | | comment | string | 留言內容 | | created_at | string | 留言時間 | | profile_photo | string | 留言人頭貼 | | nick_name | string | 留言人暱稱 | comment -> reply | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | reply id | | activity_id | string | 活動id | | user_id | string | 使用者id | | profile_photo | string | 回覆人頭貼 | | nick_name | string | 留言人暱稱 | | reply | string | 回覆內容 | | created_at | string | 回覆時間 | | cid | string | comment id | | rid | string | reply id | ### Response 範例 成功 :::success ```json { "data": { "info": [ { "id": "1", "user_id": "6", "sort": "0", "name": "活動名稱", "place": "活動地點地址", "position": "53.299671, -6.267786", "start_at": "2021-06-01", "routes_description": "路線說明", "description": "活動說明", "is_comment": "1", "created_at": "2021-06-03 14:42:47", "participant_type": "1,2,3", "status": "1", "is_report": "0", "token": "XigTFH69s6V2Rt5qr1rL" } ], "pic": [ { "id": "1", "file_path": "uploads/activity", "file_name": "1620785939421.jpg", "activity_id": "1", "pic_id": "1" } ], "comment": [ { "id": "3", "activity_id": "1", "user_id": "4", "comment": "活動留言三(user test4)", "created_at": "2021-06-03 15:47:13", "profile_photo": null, "nick_name": "test4", "reply": [ { "id": "2", "activity_id": "1", "user_id": "4", "profile_photo": null, "nick_name": "test5", "reply": "第二個回覆活動留言三(user test4)", "created_at": "2021-06-03 16:53:02", "cid": "3", "rid": "2" }, { "id": "1", "activity_id": "1", "user_id": "4", "profile_photo": null, "nick_name": "test5", "reply": "回覆活動留言三(user test4)", "created_at": "2021-06-03 15:51:54", "cid": "3", "rid": "1" } ] }, { "id": "2", "activity_id": "1", "user_id": "6", "comment": "活動留言二", "created_at": "2021-06-03 15:42:01", "profile_photo": null, "nick_name": "test5", "reply": [ { "id": "3", "activity_id": "1", "user_id": "6", "profile_photo": null, "nick_name": "test4", "reply": "回覆活動留言二(user test5)", "created_at": "2021-06-03 17:04:11", "cid": "2", "rid": "3" } ] }, { "id": "1", "activity_id": "1", "user_id": "6", "comment": "活動留言一", "created_at": "2021-06-03 15:39:41", "profile_photo": null, "nick_name": "test5" } ] }, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 活動不存在 ```json {"data":null,"message":"this post not exist","code":400} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 移除單一活動 #### [POST] `/api/Activity/remove` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 活動不存在 ```json { "data":null, "message":"this post not exist", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 隱藏單一活動 #### [POST] `/api/Activity/hide` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 活動不存在 ```json { "data":null, "message":"this post not exist", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 儲存編輯單一活動 #### [POST] `/api/Activity/saveEdit` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | | name | string | Y | 活動名稱 | | position | string | Y | 地點座標 | | place | string | Y | 地點 | | start_at | string | Y | 活動日期 | | routes_description | string | Y | 路線說明 | | description | string | Y | 活動說明更新 | | participant_type | string | Y | 接受報名身分(1:認證車主 2:一般車主 3:攝影追焦 4:熱情副駕) | ### Request 範例 ```json { "user_id":"6", "activity_id":"1", "name":"活動名稱", "position":"53.299671, -6.267786", "place":"活動地點地址", "start_at":"2021-06-01", "routes_description":"路線說明", "description":"活動說明", "participant_type":"1,2,3", } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 更新活動失敗 ```json { "data":null, "message":"failed updating", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 報名活動 #### [POST] `/api/Activity/apply` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | | participant_type | string | Y | 接受報名身分(1:認證車主 2:一般車主 3:攝影追焦 4:熱情副駕) | | contact_info | string | Y | 聯絡資訊 | | remark | string | N | 其他問題及備註 | ### Request 範例 ```json { "user_id":"6", "activity_id":"1", "participant_type":"1,2,3", "contact_info":"可以加我的LINE  Vivian768 或我的手機 0972938873", "remark":"其他問題與備註" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json { "data":null, "message":"Invalid credentials", "code":401 } ``` 報名活動失敗 ```json { "data":null, "message":"failed applying", "code":400 } ``` 請求錯誤 ```json { "data":null, "message":"Bad Request", "code":400 } ``` ::: ### 是否報名活動 #### [GET] `/api/Activity/isApplied` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 範例 成功 :::success 是 ```json { "data": true, "message": "success", "code": 200 } ``` 否 ```json { "data": false, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 報名者列表 #### [GET] `/api/Activity/getApplicants` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | isApplied | boolean | true:已報名 false:未報名 | ### Response 範例 成功 :::success 有報名者 ```json { "data": [ { "id": "1", "user_id": "4", "participant_type": "1", "created_at": "2021-06-04 18:32:29", "activity_id": "1", "contact_info": "可以加我的LINE Vivian768 或我的手機 0972938873\n", "remark": "其他問題與備註", "status": "0", "nick_name": "test4", "profile_photo": null, "type_name": "認證車主" } ], "message": "success", "code": 200 } ``` 無報名者 ```json { "data": [], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 參加者列表 #### [GET] `/api/Activity/getParticipants` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | GET | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "activity_id":"1" } ``` ### Response 欄位 | 欄位 | 資料型別 | 說明 | |:--------- |:------ |:----:|:------ | | id | string | 參加者id | | user_id | string | 使用者id | | participant_type | string | 參加者種類 | | created_at | string | 報名時間 | | activity_id | string | 活動id | | contact_info | string | 聯絡資訊 | | remark | string | 其他問題或備註 | | status | string | 1:參加者 | | nick_name | string | 暱稱 | | profile_photo | string | 頭貼 | | type_name | string | 報名身分 | ### Response 範例 成功 :::success 有參加者 ```json { "data": [ { "id": "1", "user_id": "4", "participant_type": "1", "created_at": "2021-06-04 18:32:29", "activity_id": "1", "contact_info": "可以加我的LINE Vivian768 或我的手機 0972938873\n", "remark": "其他問題與備註", "status": "1", "nick_name": "test4", "profile_photo": null, "type_name": "認證車主" } ], "message": "success", "code": 200 } ``` 無參加者 ```json { "data": [], "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 成為參加者(審核) #### [POST] `/api/Activity/addInApplicant` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | applicant_id | string | Y | 報名者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "applicant_id":"4" "activity_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 審核失敗 ```json {"data":null,"message":"failed add in","code":400} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ### 移除報名者(審核) #### [POST] `/api/Activity/removeParticipant` ### 規格 | 項目 | 說明 | |:--------------- | --------------------------------------------- | | Method | POST | | Content-Type | application/x-www-form-urlencoded | | token | token | ### Request 欄位 | 參數名稱 | 資料型別 | 必填 | 說明 | |:-------- | -------- |:----:| --------------------------- | | user_id | string | Y | 使用者id | | participant_id | string | Y | 報名者id | | activity_id | string | Y | 活動id | ### Request 範例 ```json { "user_id":"6", "participant_id":"4" "activity_id":"1" } ``` ### Response 範例 成功 :::success ```json { "data": null, "message": "success", "code": 200 } ``` ::: 失敗 :::danger 身分驗證錯誤 ```json {"data":null,"message":"Invalid credentials","code":401} ``` 移除失敗 ```json {"data":null,"message":"failed remove","code":400} ``` 請求錯誤 ```json {"data":null,"message":"Bad Request","code":400} ``` ::: ## 好友 ### 好友列表 ### 取得單一好友 ### 新增好友 ### 移除好友