[TOC]
# API 文檔
## 1. 取得課程分類類型
### 端點(Endpoint)
```
GET /api/app/getCRClassType
```
### 描述
此API用於獲取課程分類類型列表。
### 請求標頭
| 標頭名稱 | 必填 | 描述 |
|----------|------|------|
| Authorization | 是 | Bearer token |
### 請求參數
無
### 回應
#### 回應格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| code | Integer | 狀態碼 |
| uuid | Integer | 唯一識別碼 |
| error | String | 錯誤訊息,若無錯誤則為null |
| data | Array | 課程分類類型資料陣列 |
#### data 陣列中的物件格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| CRClassTypeID | Integer | 課程分類類型ID |
| CRClassType | String | 課程分類類型名稱 |
#### 範例回應
```json
{
"code": 200,
"uuid": 1727930573,
"error": null,
"data": [
{
"CRClassTypeID": 2,
"CRClassType": "國文2"
},
{
"CRClassTypeID": 3,
"CRClassType": "國文3"
}
]
}
```
## 2. 取得學生資料
### 端點(Endpoint)
```
GET /api/app/getStudent
```
### 描述
此API用於根據課程分類類型ID獲取學生資料。
### 請求標頭
| 標頭名稱 | 必填 | 描述 |
|----------|------|------|
| Authorization | 是 | Bearer token |
### 請求參數
| 參數名稱 | 類型 | 必填 | 描述 |
|----------|------|------|------|
| CRClassTypeID | String | 是 | 課程分類類型ID |
### 回應
#### 回應格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| code | Integer | 狀態碼 |
| uuid | Integer | 唯一識別碼 |
| error | String | 錯誤訊息,若無錯誤則為null |
| data | Array | 學生資料陣列 |
#### data 陣列中的物件格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| StudentID | String | 學生ID |
| StudentName | String | 學生姓名 |
| StudentGender | String | 學生性別 |
| StudentSchool | String | 學生學校 |
| StudentGrade | String | 學生年級 |
| StudentClass | String | 學生班級 |
| Parents | Array | 家長資料陣列 |
#### Parents 陣列中的物件格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| ParentName | String | 家長姓名 |
| ParentID | Integer | 家長ID |
| Relation | String | 與學生的關係 |
#### 範例回應
```json
{
"code": 200,
"uuid": 1727930701,
"error": null,
"data": [
{
"StudentID": "1",
"StudentName": "jimmy",
"StudentGender": "male",
"StudentSchool": "板橋國中",
"StudentGrade": "國中一年級",
"StudentClass": "五班",
"Parents": [
{
"ParentName": "mother",
"MemberID": 2,
"Relation": "母親"
},
{
"ParentName": "father",
"MemberID": 1,
"Relation": "父親"
}
]
}
]
}
```
## 3. 取得家長資料
### 端點(Endpoint)
```
GET /api/app/getParent
```
### 描述
此API用於根據家長ID獲取學生資料。
### 請求標頭
| 標頭名稱 | 必填 | 描述 |
|----------|------|------|
| Authorization | 是 | Bearer token |
### 請求參數
| 參數名稱 | 類型 | 必填 | 描述 |
|----------|------|------|------|
| MemberID | String | 是 | 家長ID |
### 回應
#### 回應格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| code | Integer | 狀態碼 |
| uuid | Integer | 唯一識別碼 |
| error | String | 錯誤訊息,若無錯誤則為null |
| data | Array | 家長資料陣列 |
#### data 陣列中的物件格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| MemberID | String | 家長ID |
| ParentName | String | 家長性名 |
| Children | Array | 小孩資料陣列 |
#### Children 陣列中的物件格式
| 欄位 | 類型 | 描述 |
|------|------|------|
| StudentName | String | 學生姓名 |
| StudentID | Integer | 學生ID |
| StudentGender | String | 學生性別 |
| StudentSchool | String | 學生學校 |
| StudentGrades | String | 學生年級 |
| StudentClass | String | 學生班級 |
#### 範例回應
```json
{
"code": 200,
"uuid": 1728925539,
"error": null,
"data": [
{
"MemberID": 1,
"ParentName": "father",
"Children": [
{
"StudentID": "1",
"StudentName": "jimmy",
"StudentGender": "MALE",
"StudentSchool": "板橋國小",
"StudentGrades": "國小一年級",
"StudentClass": "一班"
},
{
"StudentID": "2",
"StudentName": "judy",
"StudentGender": "female",
"StudentSchool": "板橋國小",
"StudentGrades": "國小一年級",
"StudentClass": "一班"
}
]
}
]
}
```