---
# System prepended metadata

title: User API List

---

# User API List

0. **常數定義**
    - [租戶類別](#租戶類別)

1. **取得個人資訊及權限**

    - [GET /{contextPath}/user/profile](#1-取得個人資訊及權限)

2. **驗證密碼**

    - [POST /{contextPath}/checkpassword](#2-驗證密碼)

3. **根據疾病類型取得醫師名單**

    - [GET /{contextPath}/user/getDoctorsByDiseaseType](#3-根據疾病類型取得醫師名單)

4. **使用者變更密碼**

    - [POST /{contextPath}/user/changePassword](#4-使用者變更密碼)

5. **使用者功能選單**

    - [GET /{contextPath}/user/menu](#5-使用者功能選單)

6. **透過googleGeoApi解析地址**
    - [GET /{contextPath}/householdMember/address/parse](#6-透過googleGeoApi解析地址)

7. **透過疾病/區域取得個案數量**
    - [POST /{contextPath}/caseGis/getGisInfos](#7-透過疾病/區域取得個案數量)

8. **修改個人資訊及權限**
    - [POST /{contextPath}/user/profile/update](#8-修改個人資訊及權限)

9. **取得服務設定列表**
   - [GET /{contextPath}/user/feature/list](#9-取得服務設定列表)

10. **啟用服務機構**
    - [POST /{contextPath}/user/serviceTenant/on](#10-啟用服務機構)

11. **停用服務機構**
    - [POST /{contextPath}/user/serviceTenant/off](#11-停用服務機構)

12. **服務項目設定機構**
    - [POST /{contextPath}/user/serviceFeature/bind](#12-服務項目設定機構)

13. **服務項目解除機構**
    - [POST /{contextPath}/user/serviceFeature/unbind](#13-服務項目解除機構)

14. **設定服務機構編號**
    - [POST /{contextPath}/user/service-tenant/set-employee-no](#14-設定服務機構編號)

---

API Require Headers:
```javascript
{
      Content-Type: 'application/json',
      Accept: 'application/json',      
      Authorization: accessToken,
}
```

---

## 常數定義

### 租戶類別
 欄位 | 型態  | 說明  
 ---|---|---
 tenantType | string | 組織機構(租戶/企業客戶)類別, DEALER: 經銷單位, HOSPITAL:醫療機構, WMT:緯創醫學, BUSINESS:企業客戶, AD:廣告商


---

## 1. 取得個人資訊及權限

```url
GET /user/profile
```

### 用於：
*  取得個人資訊
*  依照權限顯示需要的資訊
*  取得角色及權限

### Response Body:
| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| tenantType|String|參閱[租戶類別](#租戶類別)|
| functions |Array\<String>|可使用功能列表|
| roles|Array\<Object>|角色列表(角色使用者無須顯示)|
| idCardNo|String| 身分證字號 |
| divisionName|String| 科別名稱(只有角色使用者需顯示)|
| telephone|String| 電話(租戶管理員、平台館理員、企客管理員、角色使用者才有)|
| userId|String|使用者帳號|
| medicalStaffId|String| 醫護人員 Id|
| accountId|String|帳號 Id|
| isSupportedHouseholdImport|Boolean|該系統中目前是否允許家戶匯入|
| name|String|使用者姓名|
| tenantId|String| 組織機構 Id|
| tenantName|String|組織機構名稱|
| tenantRoleName|String| 租戶角色名稱 (只有角色使用者需顯示)|
| tenantRoleId|String|租戶角色 Id|
| hasMemberOnlyAds|Boolean|是否有會員專屬廣告|
| gender | int | 性別, 1:男, 2:女 |
| age | int | 年齡 |
| bodyHeight | float | 身高 |
| address | String | 地址 |
| areaLevel1 | String | 地址AreaLevel1 |
| areaLevel2 | String | 地址AreaLevel2 |
| birthDate | Date | 生日 |
| bloodType | String | 血型 |
| waist | int | 腰圍 |
| hips  | int | 臀圍 |
| hasHealthReminds|Boolean|是否有健康叮嚀|
| features | Json Array | 已啟用服務json array |
|tenantHealthPromote|json Array|企業健促列表|
| tenantInfoList | Json Array | 個案租戶json array |
| businessInfoList | Json Array | 企業租戶json array |
| suggestDietPlanPlateId | string | 目前使用的我的餐盤id |
| diaryRecordType | string | 飲食記錄方式, DIET_PLAN: 我的餐盤, FOOD_DB:食品資料庫 |
| member_card_level | string | 會員卡等級, 請參閱[會員卡類型](https://hackmd.io/kvZLCMSqSpW159tkxEVKmg?view#%E6%9C%83%E5%93%A1%E5%8D%A1%E9%A1%9E%E5%9E%8B) |
| member_card_level_seq| int | 會員卡等級序號, 請參閱[會員卡類型](https://hackmd.io/kvZLCMSqSpW159tkxEVKmg?view#%E6%9C%83%E5%93%A1%E5%8D%A1%E9%A1%9E%E5%9E%8B) |


#### Response-roles
| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| roleId     | String    |   角色編號   |
| roleNameTw | String   |  角色中文名稱   |

#### Response-features
| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| code | String | 服務項目代碼 |
| name | String | 服務項目名稱 |
| tenantId | String | 提供服務項目租戶id |
| tenantName | String | 提供服務項目租戶名稱 |

#### Response-tenantInfo
| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| featureList | json array | 功能列表, 參考[feature結構](#Response-features) |
| userFeatureList | json array | 使用者設定功能列表, 參考[feature結構](#Response-features) |
| tenantId | String | 租戶id |
| tenantName | String | 租戶名稱 |
| tenantShortName | String | 租戶暱稱 |

#### Response-tenantHealthPromoteList
| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| id | String | 企業健促設定ID |
| title | String | 企業健促設定名稱 |
| url | String | 企業設定縮圖 |
| rank | Int | 排行名次 |

- 系統管理員
  - name
  - userId
  - accountId
  - tenantName
  - roles#roleNameTw
  - features
- 平台管理員、租戶管理員、企客管理員
  - name
  - userId
  - accountId
  - tenantName
  - roles#roleNameTw
  - telephone
  - features
- 角色使用者
  - name
  - userId
  - accountId
  - idCardNo
  - tenantRoleName
  - divisionName
  - telephone
  - tenantName
  - features
- 一般民眾(App User)
  - name
  - userId
  - accountId
  - idCardNo
  - telephone
  - tenantName
  - gender
  - age
  - bodyHeight
  - address
  - areaLevel1
  - areaLevel2
  - birthDate
  - bloodType
  - waist
  - hips
  - manageableDiseases
  - hasMemberOnlyAds
  - hasHealthReminds
  - features
  - tenantHealthPromote

### Response Body Example for WEB:

以角色使用者為例：
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "tenantType": "DEALER",
            "hasMemberOnlyAds": false,
            "functions": [
                "/vpnCaseGeneral/add",
                "/sport/walk/{id}",
                "/appointment/detail",
                "/casePatient/drug/detail/update",
                ...
            ],
            "roles": [
                {
                    "roleId": "TENANT_ROLE_USER",
                    "roleNameTw": "租戶角色使用者"
                }
            ],
            "idCardNo": "D123456789",
            "divisionName": "外科",
            "telephone": "123",
            "userId": "chen@yy.pp",
            "medicalStaffId": "7a17be34-13ae-4687-b971-1e5f586c8e3a",
            "accountId": "7a17be34-13ae-4687-b971-1e5f586c8e3a",
            "isSupportedHouseholdImport": true,
            "tenantName": "緯緯醫學",
            "name": "w",
            "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
            "tenantRoleName": "腳科醫生",
            "tenantRoleId": "2ad9aaad-f651-4d8d-9309-e015c0fb24d3",
            "features": [
                {
                    "code": "SOS",
                    "name": "緊急救援"
                }
            ]
        }
    }
}
```

以一般民眾(App User)為例：
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "gender": 1,
            "hasMemberOnlyAds": false,
            "functions": [
                "/ad/info",
                "/event/list",
                "/healthEdu/info",
                "/voucher/redeem",
                "/health-remind/read-all",
                ...
            ],
            "roles": [
                {
                    "roleId": "GENERAL_PUBLIC",
                    "roleNameTw": "一般民眾"
                }
            ],
            "idCardNo": "Q101540463",
            "bodyHeight": 173,
            "areaLevel2": "Xinyi District",
            "areaLevel1": "Taipei City",
            "medicalStaffId": "6ec4bd89-633a-4f67-be6e-01172f92223e",
            "features": [
                {
                    "code": "SOS",
                    "name": "緊急救援",
                    "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
                    "tenantName": "緯緯醫學",
                    
                }
            ],
            "tenantInfoList": [
                {
                    "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
                    "tenantName": "緯緯醫學",
                    "tenantShortName": "緯醫",
                    "featureList": [
                        {
                            "code": "SOS",
                            "name": "緊急救援"
                        },
                        {
                            "code": "STEP_RANKING",
                            "name": "步數排行"
                        }
                    ],
                    "tenantHealthPromoteList": [
                        {
                            "url": "http://10.31.104.23/swift/v1/AUTH_test/kmuh/tenant_health_promote/ae0f0873-7ed2-424c-af12-06872d8b8db2.png?temp_url_sig=79f6c879613e5b62841ce46f9db888d2a9b710c5&temp_url_expires=1689064884",
                            "id": "f4e01278-9908-4a22-84e3-f040912b56bc",
                            "title": "test12",
                            "rank": 2,
                            "tenantIds": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc"
                        }
                    ]
                }
            ],
            "businessInfoList": []
            "tenantName": "緯緯醫學",
            "isDefaultPassword": false,
            "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
            "tel": "0925309365",
            "email": "",
            "manageableDiseases": [
                {
                    "diseaseId": "General",
                    "diseaseType": "General"
                },
                ...
            ],
            "address": "台北市衛生局調查研究",
            "telephone": "0925309365",
            "userId": "0925309365",
            "birthDate": "1988/05/07",
            "accountId": "6ec4bd89-633a-4f67-be6e-01172f92223e",
            "isSupportedHouseholdImport": true,
            "name": "蘇XX",
            "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
            "hasHealthReminds": true,
            "age": 33,
            "diaryRecordType": "DIET_PLAN",
            "member_card_level": "NORMAL",
            "member_card_level_seq": 1,
            "suggestDietPlanPlateId": "b2f0701d-91ef-456c-9282-2abea10a2a43",   
        }
    }
}
```

## 2. 驗證密碼

```url
POST /checkpassword
```

### 用於：
*  驗證密碼是否正確

### Request Body:

| Parameter | Required |  format  |  desc     |
| --------- | -------- | -------- |--------   |
| password  | Y        | String   | 登入密碼  |


### Request Body Example:

```javascript
{
    "password": "xxxxxxxxxx",
}
```

### Response Body:

| Parameter |  format  |  desc   | sort supported|
| --------- | -------- |--------|--------  |
| isPass     | boolean    |   密碼是否正確   | N    |

### Response Body Example:
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            isPass: true,
        }
    }
}
```

### Error Response Body:

| errorMsg |  errorMsg describe  |
| --------- | -------- |
| UNKNOWN_LOGIN_TYPE | 未知的登入類別，參考上面 [loginType](#logintype) |
| ACCOUNT_OR_PASSWORD_ERROR | 帳號或密碼錯誤 |

### Error Response Body Example:
```javascript
{
  "errorMsg": "ACCOUNT_OR_PASSWORD_ERROR",
  "httpCode": 400
}
```

```javascript
{
  "errorMsg": "UNKNOWN_LOGIN_TYPE",
  "httpCode": 400
}
```

## 3. 根據疾病類型取得醫師名單

```url
GET /user/getDoctorsByDiseaseType?diseaseType=${diseaseType}
```

### 用於：
*  VPN收案列表中的新增個案

### Request Params:

| Parameter | Required |  format  |  desc     |
| --------- | -------- | -------- |--------   |
| diseaseType  | Y        | String   | [疾病類型](https://gitlab.devpack.cc/Wei_Chang/wicc-kmuh/wikis/Type-Definition#%E7%96%BE%E7%97%85%E9%A1%9E%E5%88%A5) |

### Response Body:

| Parameter |  format  |  desc   |
| --------- | -------- |--------|
| medicalStaffId    | String    |   醫療人員Id   |
| userName    | String    |   姓名   |
| idCardNo    | String    |   身分證字號   |

### Response Body Example:
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "medicalStaffId": "fbc9d26e-4cfc-4de1-85d2-bc9d560a1289",
                "userName": "那瑪夏區衛生所醫師",
                "idCardNo": "A100766139"
            }
        ]
    }
}
```

## 4. 使用者變更密碼

```url
POST /user/changePassword
```

### 用於：
*  使用者變更密碼(系統管理員、區域管理員、一般使用者)

### Request Body:

| Parameter | Required |  format  |  desc     |
| --------- | -------- | -------- |--------   |
| oldPassword  | Y        | String   | 舊的登入密碼  |
| password  | Y        | String   | 新的登入密碼  |
| rePassword  | Y        | String   | 在輸入一次新的登入密碼(只有 Web 需要此參數)  |


### Request Body Example:
Web：
```javascript
{
	"oldPassword": "KKpu9U6txyPMnqtLHwIbEQ==",
	"password": "4mF1LP9FXFLxNWBtYakE6g==",
    "rePassword": "4mF1LP9FXFLxNWBtYakE6g=="
}
```

### Response Body:

| Parameter |  format  |  desc   | sort supported|
| --------- | -------- |--------|--------  |
| count     | Integer    |   更新數量   | N    |

### Response Body Example:
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            count: 1,
        }
    }
}
```


## 5. 使用者功能選單

```url
GET /user/menu
```

### Request:

### Response:
| 欄位 | 型態 | 說明 |
|---|---|---|
| id | string | 功能選單Id |
| name | string | 功能選單名稱 |
| i18n | string | i18n |
| menu | json array | 子功能選單json array |
| parentId | string | 父功能選單id |
| read | bool | true 表示啟用 |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "EDUCATION_MANAGEMENT": {
                "id": "EDUCATION_MANAGEMENT",
                "name": "衛教資訊管理",
                "i18n": "MENU.EDUCATION_MANAGEMENT",
                "level": 0,
                "read": false,
                "menu": [
                    {
                        "id": "EDUCATION_LIST",
                        "name": "衛教資訊列表",
                        "i18n": "MENU.EDUCATION_LIST",
                        "parentId": "EDUCATION_MANAGEMENT",
                        "level": 1
                    }
                ]
            },
            "CASE_MANAGEMENT": {
                "id": "CASE_MANAGEMENT",
                "name": "個案追蹤管理",
                "i18n": "MENU.CASE_MANAGEMENT",
                "level": 0,
                "read": false,
                "menu": [
                    {
                        "id": "CASE_CALENDAR",
                        "name": "排程行事曆",
                        "i18n": "MENU.CASE_CALENDAR",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    },
                    {
                        "id": "CASE_OVERVIEW",
                        "name": "個案總覽",
                        "i18n": "MENU.CASE_OVERVIEW",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    },
                    {
                        "id": "CASE_LIST",
                        "name": "個案名單",
                        "i18n": "MENU.CASE_LIST",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    },
                    {
                        "id": "CASE_ANNUAL_STATISTIC",
                        "name": "指標分析",
                        "i18n": "MENU.CASE_ANNUAL_STATISTIC",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    },
                    {
                        "id": "CASE_CARE",
                        "name": "個案關懷",
                        "i18n": "MENU.CASE_CARE",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    },
                    {
                        "id": "CASE_GIS",
                        "name": "個案GIS",
                        "i18n": "MENU.CASE_GIS",
                        "parentId": "CASE_MANAGEMENT",
                        "level": 1
                    }
                ]
            },
            "INTELL_DIST_SERVICE": {
                "id": "INTELL_DIST_SERVICE",
                "name": "遠距智能服務",
                "i18n": "MENU.INTELL_DIST_SERVICE",
                "level": 0,
                "read": false,
                "menu": [
                    {
                        "id": "INTELL_DIST_CONSULT",
                        "name": "諮詢服務",
                        "i18n": "MENU.INTELL_DIST_CONSULT",
                        "parentId": "INTELL_DIST_SERVICE",
                        "level": 1
                    },
                    {
                        "id": "INTELL_DIST_WOUND_PATIENT",
                        "name": "傷口照顧管理",
                        "i18n": "MENU.INTELL_DIST_WOUND_PATIENT",
                        "parentId": "INTELL_DIST_SERVICE",
                        "level": 1
                    },
                    {
                        "id": "INTELL_DIST_HEALTH",
                        "name": "個人健康管理",
                        "i18n": "MENU.INTELL_DIST_HEALTH",
                        "parentId": "INTELL_DIST_SERVICE",
                        "level": 1
                    }
                ]
            }
        }
    }
}
```

## 6. 透過googleGeoApi解析地址

```url
GET /householdMember/address/parse
```

### Request:
    
    GET /householdMember/address/parse?address=屏東縣屏東市廣東南路

### Response:
| 欄位 | 型態 | 說明 |
|---|---|---|
| address | string | 輸入的地址原文 |
| areaLevel1 | string | 第一階分區(屏東縣/台北市) |
| areaLevel2 | string | 第二階段分區(屏東市/東區) |

```javascript
// 解析失敗
{
    "httpCode": 200,
    "result": {
        "data": {}
    }
}
// 解析成功
{
    "httpCode": 200,
    "result": {
        "data": {
            "address": "屏東市台糖二街",
            "areaLevel2": "Pingtung City",
            "areaLevel1": "Pingtung County"
        }
    }
}
```

## 7. 透過疾病/區域取得個案數量

```url
POST /caseGis/getGisInfos
```

### Request Params:

| Parameter | Required |  format  |  desc     |
| --------- | -------- | -------- |--------   |
| areaLevel1  | N        | String   | 第一階區域條件, 留空代表要查所有縣市(全台灣) |
| diseaseType  | N        | String   | 疾病類型ID |
| diseaseStage  | N        | String   | 疾病階段ID |

### Response Body:

### Response:
| 欄位 | 型態 | 說明 |
|---|---|---|
| area | json array | 針對區域做個案數量統計, 第一階區域留空的話, 舊以全台縣市做統計, 第一階區域有設定的話就以該縣市下的第二階區域作統計 |
| disease | json array | 以疾病/階段作個案數量統計 |

note: area下的name固定為空值, 縣市區的名稱對應表存在前端

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "area": [
                {
                    "id": "Pingtung County",
                    "name": "",
                    "count": 1
                }
            ],
            "disease": [
                {
                    "id": "PreESRD",
                    "name": "PreESRD",
                    "count": 15
                },
                {
                    "id": "3c36bac4-869a-4a8e-a0f8-065f441284b2",
                    "name": "新疾病",
                    "count": 19
                },
                {
                    "id": "ECKD",
                    "name": "ECKD",
                    "count": 18
                },
                {
                    "id": "DM",
                    "name": "DM",
                    "count": 11
                },
                {
                    "id": "BC",
                    "name": "BC",
                    "count": 25
                },
                {
                    "id": "General",
                    "name": "General",
                    "count": 69
                }
            ]
        }
    }
}
```

## 8. 修改個人資訊及權限

```url
POST /user/profile/update
```

### Request/Response

Attribute | Type | Remark
-|-|-
idNo   | String | 身分證字號
birthDate | String | 生日(yyyy-MM-dd)
name | String | 姓名
countryCode | String | 電話國碼, e.g.台灣國碼為+886
telephone | String | 電話
bodyHeight | number | 身高
gender | int | 性別 1:男性/2:女性
address | String | 地址
bloodType | String | 血型(O/AB/A/B)
email | String | email
waist | int | 腰圍
hips  | int | 臀圍

Request: 填寫有修改的欄位即可
```javascript
{
    "bodyHeight": 175.5,
    "name": "更新個人5",
    "birthDate": "2021-02-17",
    "countryCode": "+886",
    "telephone": "09123456789",
    "email": "test@gmail.com",
    "gender": 1,
    "address": "高雄市鹽埕區大勇路98號",
    "bloodType": "O",
    "waist": 90,
    "hips": 110
}
```

Response:
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "18c45773-af33-4ae4-a129-9618703032fc",
            "account": "C188256154",
            "accountType": "APP",
            "name": "更新個人5",
            "role": "GENERAL_PUBLIC",
            "idNo": "C188256154",
            "telephone": "09123456789",
            "email": "test@gmail.com",
            "status": false,
            "isFirstLogin": true,
            "createTime": 1614230493000,
            "updateTime": 1614924104000
        }
    }
}
```

ErrorMsg:
1. 血型不相符，只可以是上述類型
```javascript
{
    "errorMsg": "API_ERROR.ARGUMENT_ERROR",
    "errorDesc": "[{\"bloodType\":\"Value is not in expected\"}]",
    "httpCode": 400
}
```

## 9. 取得服務設定列表

```url
GET /user/feature/list
```

### 用於：
*  APP: 設定-個人化設定-服務設定
*  取得使用者的服務設定列表及狀態

### Response Body:
| Parameter |  Format  |  Desc |
| --------- | -------- |--------|
| householdMemberId|String| household member id|
| businessInfoList|Json Array| 企業租戶 tenantInfo json array|
| tenantInfoList|Json Array|一般租戶 tenantInfo json array|

#### Response-tenantInfo json
| Parameter |  Format  |  Desc |
| --------- | -------- |--------|
| tenantId|String| 租戶ID|
| tenantName|String| 租戶名稱|
| tenantShortName|String| 租戶簡稱|
| jobStatus|String| 在職狀態(企客)。在職ON，離職EXIT|
| serviceStatus|boolean| 對該機構的服務設定狀態。啟用true，停用false|
| tenantType | String | 參閱[租戶類別](#租戶類別)|
| employeeNo | String | 服務機構編號(員工編號), tenantType='BUSINESS' 時或許會有此欄位|
| featureList|Json Array|服務項目 feature json array|
| userFeatureList|Json Array|使用者自訂服務項目 feature json array|
| tenantHealthPromoteList|Json Array|企業競賽設定清單 json array|

#### Response-feature json
| Parameter |  Format  |  Desc |
| --------- | -------- |--------|
| code|String|服務項目code|
| name|String|服務項目名稱|
| bind|boolean|服務項目是否設定租戶|
| isFixed|boolean|服務項目是否為固定項目|
| tenantId|String| 租戶ID|
| tenantName|String| 租戶名稱|

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
            "businessInfoList": [
                {
                    "tenantId": "5efcfd67-334e-45b3-bf49-7e52f5172891",
                    "tenantName": "企客第一家",
                    "tenantShortName": "阿氣",
                    "jobStatus":"ON",
                    "serviceStatus":true,
                    "tenantType": "BUSINESS",
                    "employeeNo": "A00001"
                }
            ],
            "tenantInfoList": [
                {
                    "tenantId": "1af0a4c2-ef73-4385-aa8e-8e7ae8afe155",
                    "tenantName": "小港醫院",
                    "serviceStatus": false,
                    "featureList": []
                },
                {
                    "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
                    "tenantName": "緯緯醫學",
                    "tenantShortName": "緯緯",
                    "serviceStatus": true,
                    "featureList": [
                        {
                            "code": "SOS",
                            "name": "緊急救援",
                            "bind": true
                        },
                        {
                            "code": "CONSULT",
                            "name": "諮詢服務",
                            "bind": false
                        }
                    ],
                    "userFeatureList": []
                }
            ]
        }
    }
}
```


## 10. 啟用服務機構

```url
POST /user/service-tenant/on
```

### 用於：
*  APP: 設定-個人化設定-服務設定
*  服務機構->啟用

### Request Body:

| Parameter | Required |  Format  |  Desc   |
| --------- | -------- | -------- |-------- |
| tenantId  |  Y  | String | 租戶Id |

```javascript
{
    "tenantId":"1af0a4c2-ef73-4385-aa8e-8e7ae8afe155"
}
```

### Response :

| Parameter |  Format  |  Desc   |
| --------- | -------- |-------- |
| isSuccess | Boolean  | 是否成功 |
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "isSuccess": true
        }
    }
}
```

## 11. 停用服務機構

```url
POST /user/service-tenant/off
```

### 用於：
*  APP: 設定-個人化設定-服務設定
*  服務機構->停用
*  停用服務機構時，若服務項目有綁定此機構，則會一併解除綁定

### Request Body:

| Parameter | Required |  Format  |  Desc   |
| --------- | -------- | -------- |-------- |
| tenantId  |  Y  | String | 租戶Id |

```javascript
{
    "tenantId":"1af0a4c2-ef73-4385-aa8e-8e7ae8afe155"
}
```

### Response:

| Parameter |  Format  |  Desc   |
| --------- | -------- |-------- |
| isSuccess | Boolean  | 是否成功 |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "isSuccess": true
        }
    }
}
```

## 12. 服務項目設定機構

```url
POST /user/service-feature/bind
```

### 用於：
*  APP: 設定-個人化設定-服務設定
*  服務項目->設定

### Request Body:

| Parameter | Required |  Format  |  Desc   |
| --------- | -------- | -------- |-------- |
| tenantId  |  Y  | String | 租戶Id |
| featureCode  |  Y  | String | 服務code |

```javascript
{
    "tenantId":"1af0a4c2-ef73-4385-aa8e-8e7ae8afe155",
    "featureCode":"SOS"
}
```

### Response:

| Parameter |  Format  |  Desc   |
| --------- | -------- |-------- |
| isSuccess | Boolean  | 是否成功 |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "isSuccess": true
        }
    }
}
```

## 13. 服務項目解除機構

```url
POST /user/service-feature/unbind
```

### 用於：
*  APP: 設定-個人化設定-服務設定
*  服務項目->設定

### Request Body:

| Parameter | Required |  Format  |  Desc   |
| --------- | -------- | -------- |-------- |
| featureCode  |  Y  | String | 服務code |

```javascript
{
    "featureCode":"CONSULT"
}
```

### Response:

| Parameter |  Format  |  Desc   |
| --------- | -------- |-------- |
| isSuccess | Boolean  | 是否成功 |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "isSuccess": true
        }
    }
}
```

## 14. 設定服務機構編號

```url
POST /user/service-tenant/set-employee-no
```

### 用於：
* APP: 設定-個人化設定-服務設定
* 服務項目->設定
* tenantType='BUSINESS' 時可以呼叫此API設定編號(員工編號)
* 該服務機構有啟用時才可以設定

### Request Body:

| Parameter | Required |  Format  |  Desc   |
| --------- | -------- | -------- |-------- |
| tenantId  |  Y  | String | 租戶id |
| employeeNo  |   | String | 編號(員工編號), 最長20字, 若未設定或空字串, 會清除已設定之編號 |

```javascript
{
    "tenantId": "5efcfd67-334e-45b3-bf49-7e52f5172891",
    "employeeNo": "A00001"
}
```

### Error:
 httpCode | 錯誤碼 | 說明
 --- | --- | ---
 400 | API_ERROR.NOT_EXIST | 無此筆資料
 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc
 422 | SERVICE_ERROR.USER_SERVICE_TENANT_NOT_ENABLED | 服務機構未啟用

### Response:

| Parameter |  Format  |  Desc   |
| --------- | -------- |-------- |
| count | int  | > 0 表示設定成功 |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 1
        }
    }
}
```
