---
# System prepended metadata

title: 訓練項目管理

---

# 訓練項目管理

[[Schema] 訓練項目（CourseTraining）](Untitled%207/Schema%20CourseTraining.csv)

Example:

```json=
    {
        "id": 1,
        "name": "抓背",
        "description": "左右手分別向上舉並往後伸展，維持20秒後互換。",
        "endType": "衰弱症",
        "endStatus": "第一期",
        "type": "復能",
        "duration": 40,
        "intensityType": 2,
        "intensityStandard": 7,
        "intensityUnit": 30,
        "intensityUnitType": "秒",
        "intensityMen": [
            IntensityItem,
            ...
        ],
        "intensityWomen": [
            IntensityItem,
            ...
        ],
        "updatedAt": 1578240000000
    }
```

### [Schema] 訓練強度項目（IntensityItem）

[訓練項目等級](Untitled%207/Untitled.csv)

Example:

```json=
    {
        "specified": [
            {
                "comparator": "<=",
                "value": 30
            },
            {
                "comparator": ">=",
                "value": 18
            }
        ],
        "level": [
            {
                "target": 13,
                "actual": 3,
                "rank": 1
            },
            {
                "target": 16,
                "actual": 3,
                "rank": 2
            },
            ...
        ]
    }
```

### (OK)[管理] 查看訓練項目列表

Request:

    GET /course/training?$queryParams

Query Params:

[Untitled](Untitled%207/Untitled%20Database.csv)

Response (成功):

```json=
    {
      "success": true,
      "total": "總數量 <number>",
      "data": [
        {
    			...TrainingItem,
    			"courseUnit": [
    				{
    					"unitId": "courseUnit 編號",
    					"unitName": "courseUnit 名稱"
    				}
    			]
    		},
        TrainingItem,
        ...
      ]
    }
```

### (OK)查看訓練項目

Request:

    GET /course/training/$id

Response (成功):

```json=
    {
      "success": true,
      "data": {
          TrainingItem
      } 
    }
```

### (OK)[管理] 新增訓練項目

Request:

    POST /course/training

Payload:

```json=
    {
      TrainingItem
    }
```

Response (成功):

```json=
    {
      "success": true,
      "data": {
          TrainingItem
      }
    }
```

### (OK)[管理] 編輯訓練項目

Request:

    PUT /course/training/$id

Payload:

```json=
    {
      TrainingItem
    }
```

Response (成功):

```json=
    {
      "success": true,
      "data": {
          TrainingItem
      }
    }
```

### (OK)[管理] 移除訓練項目

Request:

    DEL /course/training/$id

Response (成功):

```json=
    {
      "success": true,
      "data": {}
    }
```