# 年度日誌專案api
> [name=EuniQQ]
> [time=Mon, Dec 18, 2023 3:28 PM]
> [TOC]
# GET
## 日誌
### <font color="danger">【 顯示某月份月曆 】</font>
* **觸發事件1** :menu > 當月月曆<br>
* **觸發事件2** :月曆頁 > 選擇年份 / key in keyword<br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/calender` <br>
* **網址參數** :
```clike!
{
"year":2023, (選填)
"month":12, (選填)
}
```
* **回應JSON** :
```clike!
{
"year": "2024",
"yearList": [2024,2023,2022,2021,2020],
"hebrewYear": 5783,
"month": "02",
"thisMonth: 3,
"today": "16",
"userId": 1,
"income": "$5000",
"expense": "$4500",
"balance": "$500",
"style": {
"main_img": {img_path},
"header_img": {img_path},
"footer_img": {img_path},
"footer_color": "#7d9aa6",
"bg_color" : "#ebf7f9",
"id": 1,
}
"calender":[
{
"id": "",
"date": "",
"fullDate": "",
"week": "",
"isHoliday": "",
"mc": "",
},
{
"id": 1,
"date": "01",
"fullDate": "20240201"
"week": "四",
"isHoliday": false,
"description": "",
"birthday_person":"周欣欣",
"mc":0, (1=mc_start,2=mc_end)
"tag_title":"Karen家慶生",
"tag_color":"C2E2DE",
"tag_to":"2024-02-02",
"sticker":{path},
"photos_link":{url},
"plan":"公寓咖啡",
"plan_time":"12:00",
},
],
"weatherDes" : [
0:{
"elementValue" :[{value: "多雲。降雨機率 20%。溫度攝氏18至21度。稍有寒意至舒適。
偏西風 風速<= 1級(每秒1公尺)。相對濕度96%。", measures: "NA"}],
"startTime" : "2024-03-16 18:00:00",
"endTime":"2024-03-17 06:00:00",
},
1:{
"elementValue" :[{value: "多雲短暫雨。降雨機率 30%。溫度攝氏18至27度。
稍有寒意至舒適。東南風 風速2級(每秒2公尺)。
相對濕度79%。", measures: "NA"}],
"startTime" : "2024-03-17 06:00:00",
"endTime":"2024-03-17 18:00:00",
},
],
"weatherType" : [
0:{
"elementValue":[{value: "多雲", measures: "自定義 Wx 文字"},
{value: "04", measures: "自定義 Wx 單位"}],
}
]
}
```
* 日曆部分接【中華民國政府行政機關辦公日曆表】[TaiwanCalendar](https://github.com/ruyut/TaiwanCalendar) API,回覆json範例如下:
https://cdn.jsdelivr.net/gh/ruyut/TaiwanCalendar/data/2024.json
* 氣象預報接【氣象局】臺灣各鄉鎮市區預報資料-臺灣各鄉鎮市區未來2天(逐3小時)及未來1週天氣預報API:https://opendata.cwa.gov.tw/dist/opendata-swagger.html
* **天氣敘述**(Des)設定locationName:泰山區、elementName:WeatherDescription
* **天氣型態**(Type)設定locationName:泰山區、elementName:Wx
<br>
### <font color="danger">【 顯示編輯單日行程 】</font>
* **觸發事件**:menu > 當月月曆 > click單格日期<br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/daylySchedule/{id}` <br>
* **網址參數** : id = calender id (必填)
* **回應JSON** :
```clike!
{
"id": 36,
"date": "20240209",
"birthday_person": "周欣欣" / null,
"mc": 0=null / 1=start / 2=end
"plan":"早午餐" / null,
"plan_time":"12:00" / null,
"tag_color":"C2E2DE" / null,
"tag_title":"Karen姊家慶生" / null,
"tag_to":"2023-02-10" / null,
"sticker":"https://hackmd.io/sde1h1o0mMg"/null,
"photos_link":"https://hackmd.io/sde1h1o0SomnmuJgWiPmMg"/null,
"user_id":1
}
```
<br>
### <font color="danger">【 顯示每日記事頁 】</font>
* **觸發事件1**:menu > 每日記事 (顯示當月)<br>
* **觸發事件2**:每日記事頁 > 右上角選取日期<br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/journal/{year}/{month}` <br>
* **網址參數** :
| 參數 | 說明 | 範例 | 必要性 |
| ----- | ----------- | ---- | ------ |
| year | 當前西元年(int) | "2023" | 必填 |
| month | 當前月份(int) | "02" | 必填 |
* **回應JSON** :
```clike!
{
"year": "2024",
"hebrewYear": "5783",
"month": "03",
"data": [
0:{
"id": 47,
"date": "03/21",
"title": "臉圓圓交換禮物",
"content": "今天臉圓圓在三重 老串角居酒屋...",
"photos": [
{
"photo_id": 3,
"name": "photo1",
"url": {path},
"description": "很好吃的炒飯,我吃了三碗"
},
{
"photo_id": 4,
"name": "photo2",
"url": "/storage/journal/xxxx.png",
"description": ""
},
],
"photosLink": "https://photos_link.com",
}
],
"yearList": {
0: "2024",
1: "2023",
2: "2022",
3: "2021"
},
}
```
#### 主文區HTML結構:
```clike!
<div id="main" class="main col col-lg-6 col-md-6 col-sm-12">
<div class="dailySet">
<div class="dailyCon">
<p class="date">2/15</p>
<div class="dailyText">
<p class="topic">臉圓圓交換禮物</p>
<p class="text">今天臉圓圓在三重 老串角居酒屋...</p>
</div>
<p class="editBtn">EDIT</p>
</div>
<div class="photos d-flex">
<img class="photo" src="/storage/img/journals/01.jpeg" alt="">
<div class="photo"></div>
<div class="photo"></div>
<div class="photo"></div>
<div class="more">more</div>
</div>
</div>
</div>
```
<br>
### <font color="danger">【 搜尋每日記事 】</font>
* **觸發事件**:每日記事頁key in關鍵字 > click **ENTER**<br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/journal/search` <br>
* **傳入參數** :
| 參數 | 說明 | 範例 | 必要性 |
| ----- | ----------- | ---- | ------ |
| keyword | 關鍵字(str) | "臉圓圓" | 必填 |
* **回應JSON** :
```clike!
{
"data":[
{
"id": 36,
"date": "2022-02-23",
"title": "臉圓圓交換禮物",
"content": "今天臉圓圓在三重 老串角居酒屋...",
"photos" : [
{
"id": 12,
"url": "storage/",
"description": "很好吃的炒飯,我吃了三碗"
},
{
"id": 15,
"url": "https://news.google.com",
"description": ""
},
],
"photos_link":"https://photos_link.com",
}
]
}
```
<br>
### <font color="danger">【 取得單張照片資訊 】</font>
* **觸發事件**:每日記事頁 > click 任一照片縮圖 > 彈出modal顯示照片<br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/journal/photoModal/{id}` <br>
* **網址參數** :
| 參數 | 說明 | 範例 | 必要性 |
| ----- | ----------- | ---- | ------ |
| id | journal id | 20 | 必填 |
* **回應JSON** :
```clike!
{
"description": "今日最美" / null,
"src": "/storage/img/journal/xxx.jpeg"
}
```
<br>
### <font color="danger">【 搜尋每日記事 】</font>
* **觸發事件**:每日記事頁 > turn on Edit Mode > click btn **EDIT** <br>
* **HTTP method** : GET <br>
* **請求網址** : `/api/journal/{id}` <br>
* **網址參數** :
| 參數 | 說明 | 範例 | 必要性 |
| ----- | ----------- | ---- | ------ |
| id | journal id | 36 | 必填 |
* **回應JSON** :
```clike!
{
"id": 36,
"date": "2024-02-23",
"title": "臉圓圓交換禮物",
"content": "今天臉圓圓在三重 老串角居酒屋...",
"photos" : [
{
"photo_id": 12,
"name": "photo1",
"url": "/storage/img/journal/xxx.jpeg",
"description": "很好吃的炒飯,我吃了三碗"
},
],
"photos_link":"https://photos_link.com" / null,
}
]
}
```
<br>
### <font color="danger">【 顯示年度每月事紀 】</font>
* **觸發事件1**:menu > click 【**每月事紀**】<br>
* **觸發事件2**:每月事紀頁 > 右上角下拉式選單選取年份 > click **search icon**<br>
* **說明** : 每月事紀內容將集結月曆中所有tag的title,無法手動增修,上限6筆
* **HTTP method** : GET <br>
* **請求網址** : `/api/event/{year}` <br>
* **網址參數** :
| 參數 | 說明 | 範例 | 必要性 |
| ----- | ----------- | ---- | ------ |
| year | 當年度年份 | 2024 | 必填 |
* **回應JSON** :
```clike!
{
"data": [
{
["抽中電視","新北耶誕城","燙髮","台東2日遊","總統大選","密室逃脫"],
["小偉回台灣","第一次逛饒河夜市","開始支持愛加倍"],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
},
"year": "2024",
"yearList": ["2024","2023","2022","2021","2020"]
}
```
主文區HTML結構參考:

<br>
### <font color="danger">【 搜尋年分&顯示年度每月事紀 】</font>
* 觸發事件:右上選擇年分 > click **【search icon】**<br>
* HTTP method : GET <br>
* 請求網址 : `/api/fun/monthlyEvent/{year}` <br>
* 回應JSON :同上
## 記帳
### <font color="danger">【 顯示全年收入列表 】</font>
* 觸發事件:menu -> click 【收入】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/income/{year}`
* 回應JSON :
```clike!
{
"year":2023,
"data":[
{
"id":"105",
"date":"2023-12-07",
"content":"薪資",
"payer":"三立",
"amount":2000,
"bank":"富邦",
"tithe":200,
"tithe_date":"2023-12-08",
"tithe_obj":"愛加倍",
"note":"轉帳",
},
{
"id":"106",
"date":"2023-12-15",
"content":"接案",
"payer":"xx協會",
"amount":5090,
"bank":"富邦",
"tithe":510,
"tithe_date":"2023-12-18",
"tithe_obj":"愛加倍",
"note":"刷玉山",
},
],
"total_income":7090,
"total_tithe":710,
}
```
### <font color="danger">【 顯示編輯單筆收入資料 】</font>
* 觸發事件:income頁 -> click 【icon edit】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/income/{id}`
* 回應JSON :
```clike!
{
"date":"2023-12-07",
"content":"薪資",
"payer":"三立",
"amount":2000,
"bank":"富邦",
"tithe":200,
"tithe_date":"2023-12-08",
"tithe_obj":"愛加倍",
"note":"轉帳",
},
```
### <font color="danger">【 顯示奉獻機構資訊 】</font>
* 觸發事件:income頁 -> click btn【NPO資訊】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/income/NPO`
* 回應JSON :
```clike!
{
"data":[
{
"method":"匯款",
"name":"社團法人...",
"account":"0061541-0184795",
"payOnLine":"https://dfdf.com.tw",
"bank":"竹東二重埔郵局700",
"form_link":"https://grgr.com.tw",
"tel":"03-5826151",
},
{
"method":"線上刷卡",
"name":"社團法人...",
"account":"https://grgr.com.tw",
"pay_on_line":"https://dfdf.com.tw",
"bank":"N/A",
"form_link":"N/A",
"tel":"03-5826151",
},
]
}
```
### <font color="danger">【 顯示支出頁 】</font>
* 觸發事件:目錄 -> click【支出】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/expenditure`
* 回應JSON :
```clike!
{
"year":2023,
"month":12,
"cash":[
{
"date":"2023-12-07",
"week":"四",
"item":"iphone15訂金",
"sum":1000,
},
{
"date":"2023-12-10",
"week":"日",
"item":"聚餐",
"sum":200,
}
],
"credit":[
{
"date":"2023-12-07",
"week":"四",
"merchant":"蝦皮"
"item":"手機殼",
"sum":119,
"actual_pay": 119,
"card":"玉山",
"note":""
},
],
"cash_total":1200,
"cc_total":119, (cc=credit card)
"cc_actual":119,
}
```
### <font color="danger">【 顯示特定日期支出頁 】</font>
* 觸發事件 : 支出頁 -> click btn【查看其他日期】->pop-up選擇年月份視窗 -> click btn【送出】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/expenditure`
* 傳入參數範例 :
```clike!
{
"year":2019,
"month":10
}
```
* 回應JSON :同【顯示支出頁】
### <font color="danger">【 顯示年度帳務結餘頁 】</font>
* 觸發事件 : 目錄 -> click【年度帳務結餘】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/overview`
* 回應JSON :
```clike!
{
"year":2023,
"data":[
{
"month":"January",
"income":5000,
"donate":1500,
"cash":200,
"card":300,
"family":1000,
"investment":2000,
"surplus":1000
},
{
"month":"Fabuary",
"income":5000,
"donate":2500,
"cash":2000,
"card":3000,
"family":1000,
"investment":0,
"surplus":-3500
},
// 略
],
"balance":3900,
"year_list":[2022,2023,2024]
}
```
### <font color="danger">【 查詢某年度帳務結餘頁 】</font>
* 觸發事件 : 年度帳務結餘頁 -> 右上角選擇查詢年度 -> click icon【search】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/overview/{year}`
* 回應JSON :同【 顯示年度帳務結餘頁 】
### <font color="danger">【 顯示投資頁 】</font>
* 觸發事件 : 目錄 -> click 【投資】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/investment`
* 回應JSON :
```clike!
{
"data":[
{
"date":"2024-01-01",
"type":"黃金",
"item":"黃金存摺",
"platform":"富邦",
"event":"買進",
"amount":5000,
"note":"",
},
{
"date":"2023-12-20",
"type":"外匯",
"item":"美金",
"platform":"富邦",
"event":"賣出",
"amount":4000,
"note":"",
}
],
"balance":1000,
"goldPrice":"https://ebank.taipeifubon.com.tw/B2C/cfhqu/cfhqu002/CFHQU002_Home.faces"
}
```
### <font color="danger">【 查詢特定日期/關鍵字投資記錄 】</font>
* 觸發事件 : 投資頁 -> key in keyword/select year ->click item【search】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/accounting/investment`
* 傳入參數範例 :
```clike!
{
"year":2022,
"keyword":""
}
```
* 回應JSON :同【 顯示投資頁 】
<br><br>
# POST 新增 / PATCH 修改 / DELETE 刪除
## 會員
### <font color="danger">【 註冊帳號 】</font>
* 觸發事件: 登入頁-> click btn【註冊】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/register`
* 傳入參數範例:
```clike!
{
"acc":"Email",
"pw":"123456A", (含7位英文數字)
"name":"userName",
}
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
```CLIKE!
{
"status_code" : 422,
"errors" : {
"name" : "The name field is required."
}
},
```
```CLIKE!
{
"status_code" : 403 ,
"message" : "帳號已被註冊"
}
```
### <font color="danger">【 登入 】</font>
* 觸發事件: 登入頁-> click btn【登入】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/login`
* 傳入參數範例:
```clike!
{
"email":"Email",
"password":"123456A",
}
```
* 回應JSON :同【註冊帳號】
### <font color="danger">【 登出 】</font>
* 觸發事件: 目錄-> click【登出】
* HTTP method : GET <br>
* 請求網址 : `/api/fun/logout`
* 回應JSON :同【註冊帳號】
```clike!
{
"status_code":200,
"message":"success",
}
```
```CLIKE!
{
"status_code" : 500 ,
"message" : "something is wrong,please try again leter"
}
```
<br>
## 月曆
### <font color="danger">【 新增行程 】</font>
* 觸發事件: 月曆頁->click任一日期欄位->pop-up 新增視窗modal->click **【送出】**
* HTTP method : POST <br>
* 請求網址 : `/api/calender`
* 傳入參數範例:
```clike!
{
"date":20230308,
"birthday_person":"李多多",
"mc":1,
"plan_time":"20:00",
"plan":"高中同學聚餐",
"tag_color":"C2E2DE",
"tag_title":"Karen姊家",
"tag_to":"2023-12-18",
"sticker":"https://hackmd.io/sde1h1o0mMg",
"photos_link":"https://hackmd.io/sde1h1o0SomnmuJgWiPmMg",
}
```
<br>
### <font color="danger">【 修改行程 】</font>
* 觸發事件: 月曆頁->click任一已編輯的日期欄位->pop-up 修改視窗modal->click **【送出】**
* HTTP method : POST <br>
* 請求網址 : `/api/calender/{id}`
* 請求參數:參考新增
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
```CLIKE!
{
"status_code" : 422,
"errors" : {
"name" : "The name field is required."
}
},
```
```CLIKE!
{
"status_code" : 503 ,
"message" : "fb_url儲存失敗"
}
```
<br>
### <font color="danger">【 刪除行程 】</font>
* 觸發事件: 月曆頁->click任一已編輯日期欄位->pop-up modal->click **【刪除】**
* HTTP method : DELETE <br>
* 請求網址 : `/api/daylySchedule/{id}`
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
<br>
### <font color="danger">【 新增月曆主視覺 】</font>
* 觸發事件:click右上角edit icon->pop-up修改側欄->click **【送出】** <br>
* HTTP method : POST(新增) <br>
* 請求網址:`/api/calender/style/{year}/{month}`
* 請求參數:
```clike!
{
"main_img":[file],
"header_img":[file],
"footer_img":[file],
"footer_color":"BE3D3D",
"bg_color":"F9F9F9"
}
```
* 回應JSON:
```clike!
{
"status_code":200,
"message":"success",
}
```
<br>
### <font color="danger">【 修改月曆主視覺 】</font>
* 觸發事件:click右上角edit icon->pop-up修改側欄->click **【送出】** <br>
* HTTP method : POST(修改) <br>
* 請求網址:`/api/calender/style/{id}`
* 請求參數:
```clike!
{
"main_img":[file], (非必填)
"header_img":[file], (非必填)
"footer_img":[file], (非必填)
"footer_color":"BE3D3D", (非必填)
"bg_color":"F9F9F9", (非必填)
}
```
* 回應JSON:
```clike!
{
"status_code":200,
"message":"success",
}
```
<br>
### <font color="danger">【 刪除月曆主視覺 】</font>
* 觸發事件:click右上角edit icon->pop-up修改側欄->click **【重置】** <br>
* HTTP method : DELETE <br>
* 請求網址:`/api/calender/style/{id}`
* 回應JSON:
```clike!
{
"status_code":200,
"message":"success",
}
```
<br>
## 日記
### <font color="danger">【 新增單日記事 】</font>
* 觸發事件:切換Edit Mode -> click icon【+】-> 跳出POPUP -> click【送出】<br>
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/schedual`
* 請求參數:
```clike!
{
"date":"20231220",
"title":"歲末臉圓圓交換禮物",
"content":"今天臉圓圓在三重 老串角居酒屋...",
"photos":[
{
"url":"https://news.google.com/home",
"description":"很好吃的炒飯,我吃了三碗"
},
{
"url":"https://news.google.com",
"description":""
},
],
"photos_link":"https://hackmd.io/sde1h1o0SomnmuJgWiPmMg?both"
}
```
* 回應JSON:
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 修改單日記事 】</font>
* 觸發事件:切換Edit Mode->click【edit】-> 跳出修改POPUP-> click【送出】<br>
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/schedual/{id}`
* 請求參數:同新增
* 回應JSON:同新增
### <font color="danger">【 刪除單日記事 】</font>
* 觸發事件:切換Edit Mode->click【edit】->跳出修改POPUP->click【刪除】<br>
* HTTP method : DELETE <br>
* 請求網址:`/api/fun/schedual/{id}`
* 回應JSON:
```clike!
{
"status_code":200,
"message":"success",
}
```
<!-- ## 記帳-收入
### <font color="danger">【 新增/修改單筆收入 】</font>
* 觸發事件:popup 新增收入/編輯收入 -> click 【送出】
* HTTP method : PUT <br>
* 請求網址(新增) : `/api/fun/accounting/income`
* 請求網址(修改) : `/api/fun/accounting/income/{id}`
* 請求參數(新增) :
```clike!
{
"date":"2023-12-07",
"content":"薪資",
"payer":"三立",
"amount":2000,
"bank":"富邦",
"tithe":200,
"tithe_date":"2023-12-08",
"tithe_obj":"愛加倍",
"note":"轉帳",
},
```
* 請求參數(修改):參考新增,僅傳入有修改的欄位
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
```clike!
{
"status_code" : 422,
"errors" : {
"data" : "The payer field is required."
}
},
```
### <font color="danger">【 刪除單筆收入 】</font>
* 觸發事件:【收入】頁 -> click 【cion trash】
* HTTP method : DELETE <br>
* 請求網址: `/api/fun/accounting/income/{id}`
* 回應JSON :
```clike!
{
"year":2023,
"data":[
{
"id":"105",
"date":"2023-12-07",
"content":"薪資",
"payer":"三立",
"amount":2000,
"bank":"富邦",
"tithe":200,
"tithe_date":"2023-12-08",
"tithe_obj":"愛加倍",
"note":"轉帳",
},
{
"id":"107",
"date":"2023-12-15",
"content":"接案",
"payer":"XX協會",
"amount":5090,
"bank":"富邦",
"tithe":510,
"tithe_date":"2023-12-18",
"tithe_obj":"愛加倍",
"note":"刷玉山",
},
],
"total_income":7090
}
```
### <font color="danger">【 新增奉獻機構資訊 】</font>
* 觸發事件:income頁 -> click btn【NPO資訊】->popup【奉獻資訊】-> click icon【送出】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/accounting/income/NPO` ,
* 請求參數 :
```clike!
{
"method":"轉帳/劃撥/刷卡/現金", (必填,下拉式選單),
"name":"社團法人...", (必填)
"account":"0061541-0184795", (選填)
"pay_on_line":"https://dfdf.com.tw", (選填)
"bank":"竹東二重埔郵局700", (選填)
"form_link":"https://grgr.com.tw", (選填)
"tel":"03-5826151", (選填)
},
*若選擇方法為【匯款/劃撥】,account為必填;若方法為【線上刷卡】,則link為必填
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 修改奉獻機構資訊 】</font>
* 觸發事件:income頁 -> click btn【NPO資訊】->popup【奉獻資訊】-> click icon【送出】
* HTTP method : PATCH <br>
* 請求網址 : `/api/fun/accounting/income/NPO/{id}` ,
* 請求參數 : 參考新增,僅傳入有修改的欄位
* 回應JSON :同上
### <font color="danger">【 刪除奉獻機構資訊 】</font>
* 觸發事件:income頁 -> click btn【奉獻資訊】->popup【奉獻資訊】-> click icon【trash】
* HTTP method : DELETE <br>
* 請求網址 : `/api/fun/accounting/income/NPO/{id}`
* 回應JSON :
```clike!
{
"data":[
{
"method":"匯款",
"name":"社團法人...",
"account":"0061541-0184795",
"payOnLine":"https://dfdf.com.tw",
"bank":"竹東二重埔郵局700",
"form_link":"https://grgr.com.tw",
"tel":"03-5826151",
},
]
}
```
## 記帳-支出
### <font color="danger">【 新增現金支出 】</font>
* 觸發事件:支出頁 -> click btn【+】-> popup【新增現金支出】-> click【送出】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/accounting/cash`
* 請求參數 :
```clike!
{
"date":"2023-12-29",
"item":"晚餐",
"amount":90,
"type":1
}
# type下拉試選單:1=個人、2=家庭、3=奉獻、4=學習
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 新增刷卡支出 】</font>
* 觸發事件:支出頁 -> click btn【+】-> popup【新增刷卡支出】-> click【送出】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/accounting/creditCard`
* 請求參數 :
```clike!
{
"date":"2023-12-07",
"shop":"蝦皮"
"item":"手機殼",
"amount":119,
"type":1,
"actual_pay":119,
"card":"玉山",
"note":"", (選填)
# type下拉試選單:1=個人、2=家庭、3=奉獻、4=學習
}
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 修改現金支出 】</font>
* 觸發事件:支出頁 -> click btn【edit pen】-> popup【修改現金支出】-> click【送出】
* HTTP method : PATCH <br>
* 請求網址 : `/api/fun/accounting/cash/{id}`
* 請求參數:參考新增,僅傳入有修改的欄位
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 修改刷卡支出 】</font>
* 觸發事件:支出頁 -> click btn【+】-> popup【新增現金支出】-> click【送出】
* HTTP method : PATCH <br>
* 請求網址 : `/api/fun/accounting/creditCard/{id}`
* 請求參數:參考新增,僅傳入有修改的欄位
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 刪除現金/刷卡支出 】</font>
* 觸發事件:支出頁 -> click btn【編輯】-> 勾選欲刪除的選項 -> click btn【刪除】
* HTTP method : DELETE <br>
* 請求網址(現金) : `/api/fun/accounting/cash`
* 請求網址(刷卡) : `/api/fun/accounting/creditCard`
* 請求參數 :
```clike!
{
"id":[
{id},{id}
];
}
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
## 記帳-投資
### <font color="danger">【 修改單筆投資 】</font>
* 觸發事件:投資頁 -> click btn【新增】-> popup 新增視窗 -> click【送出】
* HTTP method : PUT <br>
* 請求網址 : `/api/fun/accounting/overview`
* 請求參數 :
```clike!
{
"date":"2024-01-01",
"type":"黃金",
"item":"黃金存摺",
"platform":"富邦",
"event":"買進",
"amount":5000,
"note":"",
},
```
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
### <font color="danger">【 修改單筆投資 】</font>
* 觸發事件:投資頁 -> click btn【新增】-> popup 新增視窗 -> click【送出】
* HTTP method : PATCH <br>
* 請求網址 : `/api/fun/accounting/overview/{id}`
* 請求參數:參考新增,僅傳入有修改的欄位
* 回應JSON :
```clike!
{
"status_code":200,
"message":"success",
}
```
-->