---
# System prepended metadata

title: Untitled

---

---

## 查詢參數頁面 API

### 前言
* 六頁的api都會相同 所以FuncCode不用帶 Controller 會自己判斷是哪一個FuncCode


### 1 新增 
* URL: `Directory/Create`
* Method: `POST`

**範例 URL**


**Request** :

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Pid | int | Yes | 所屬上層id |
| Name | String(20) | Yes | 選單名稱 |

**Response**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Result | bool | Yes | 新增是否成功 |
| Message | String | No | 錯誤訊息 |
| Data | Array | No | 回傳資料:物件Model | 
```javascript
{
 "Result": true,
 "Message": "Success",
 "Data":{
     Code: 1011,
     Id: 184,
     Pid: 183, 
     RefID: 0,
     Name: "新單位",
     Ind: 0,
     IsAdd: false,
     IsDrop: false,
     IsModify: true,
     IsOrder: false,
     IsQuery: false,
     IsRemove: true
     }
}

{
 "Result": false,
 "Message": "資料庫異常"
}
```

### 2 修改
* 取得遊戲登入連結
* URL: `Directory/Edit`
* Method: `POST`

**範例 URL**

**Request**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Id | int | Yes | 預修改的項目Id |
| Pid | int | Yes | 所屬上層id |我ㄉ
| Name | String(20) | Yes | 預修改的選單名稱 |


**Response**


| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Result | bool | Yes | 修改是否成功 |
| Message | String | No | 錯誤訊息 |

```javascript
{
 "Result": true,
 "Message": "Success"
}

{
 "Result": false,
 "Message": "資料庫異常"
}
```


### 3 刪除
* URL: `Directory/Delete`
* Method: `POST`

**範例 URL**

**Request**:

| Parameter | Type | Require | Description|
| --- | --- | --- | --- |
| Id | int | Yes | 預刪除的項目Id |

**Response Data**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Result | bool | Yes | 刪除是否成功 |
| Message | String | No | 錯誤訊息 |

```javascript
{
 "Result": true,
 "Message": "Success"
}

{
 "Result": false,
 "Message": "資料庫異常"
}
```

### 4 列表
* URL: `Directory/Query`
* Method: `POST`

**範例 URL**

**Request**:

| Parameter | Type | Require | Description|
| --- | --- | --- | --- |
| 無 |  |  |  |

**Response Data**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| FuncCode | int | Yes | 功能代號 |
| Items | Array | Yes | 列表 |

**Response Items**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Id | int | Yes | Id |
| Name | String(50) | Yes | 選單名稱 |
| Pid | int | Yes | 上層id |
| IsModify | bool | Yes | 是否可修改刪除 |

```javascript
{
	"funcCode": 1,
	"items": [{
			"id": 1,
			"name": "北區分行",
			"pid": 0,
			"isModify": false,
			"items": [{
				"id": 23,
				"name": "中山分行",
				"pid": 1,
				"isModify": true
			}, {
				"id": 45,
				"name": "松山分行",
				"pid": 1,
				"isModify": true
			}]
		}, {
			"id": 2,
			"name": "中區分行",
			"pid": 0,
			"isModify": false,
			"items": [{
				"id": 15,
				"name": "漢口分行",
				"pid": 2,
				"isModify": true
			}, {
				"id": 46,
				"name": "南屯分行",
				"pid": 2,
				"isModify": true
			}]
		}


	]
}

```

### 5 排序
* URL: `Directory/Order`
* Method: `POST`
* 重點: Request會傳陣列過來

**範例 URL**

**Request**:

* 陣列

| Parameter | Type | Require | Description|
| --- | --- | --- | --- |
| Id | int | Yes | 預修改的項目Id |
| Ind | int | Yes | 修改的Ind |

**Response Data**

| Parameter | Type | Require | Description |
| --- | --- | --- | --- |
| Result | bool | Yes | 刪除是否成功 |
| Message | String | No | 錯誤訊息 |

```javascript
{
 "Result": true,
 "Message": "Success"
}

{
 "Result": false,
 "Message": "資料庫異常"
}
```