# NodeRegionService
> 节点区域相关服务

---

## createNodeRegion
> 创建区域

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/createNodeRegion`
- RPC：`rpc createNodeRegion (CreateNodeRegionRequest) returns (CreateNodeRegionResponse);`

**请求对象 (`CreateNodeRegionRequest`)**

```json
{
  "name": "string // 名称",
  "description": "string // 描述（备注）"
}
```

**响应对象 (`CreateNodeRegionResponse`)**

```json
{
  "nodeRegionId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/createNodeRegion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteNodeRegion
> 删除区域

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/deleteNodeRegion`
- RPC：`rpc deleteNodeRegion (DeleteNodeRegionRequest) returns (RPCSuccess);`

**请求对象 (`DeleteNodeRegionRequest`)**

```json
{
  "nodeRegionId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/deleteNodeRegion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findAllAvailableNodeRegions
> 查找所有启用的区域

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/findAllAvailableNodeRegions`
- RPC：`rpc findAllAvailableNodeRegions (FindAllAvailableNodeRegionsRequest) returns (FindAllAvailableNodeRegionsResponse);`

**请求对象 (`FindAllAvailableNodeRegionsRequest`)**

```json
{}
```

**响应对象 (`FindAllAvailableNodeRegionsResponse`)**

```json
{
  "nodeRegions": "[]NodeRegion"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/findAllAvailableNodeRegions" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findAllEnabledNodeRegions
> 查找所有区域

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/findAllEnabledNodeRegions`
- RPC：`rpc findAllEnabledNodeRegions (FindAllEnabledNodeRegionsRequest) returns (FindAllEnabledNodeRegionsResponse);`

**请求对象 (`FindAllEnabledNodeRegionsRequest`)**

```json
{}
```

**响应对象 (`FindAllEnabledNodeRegionsResponse`)**

```json
{
  "nodeRegions": "[]NodeRegion"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/findAllEnabledNodeRegions" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findEnabledNodeRegion
> 查找单个区域信息

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/findEnabledNodeRegion`
- RPC：`rpc findEnabledNodeRegion (FindEnabledNodeRegionRequest) returns (FindEnabledNodeRegionResponse);`

**请求对象 (`FindEnabledNodeRegionRequest`)**

```json
{
  "nodeRegionId": "int64"
}
```

**响应对象 (`FindEnabledNodeRegionResponse`)**

```json
{
  "nodeRegion": "NodeRegion"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/findEnabledNodeRegion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateNodeRegion
> 修改区域

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/updateNodeRegion`
- RPC：`rpc updateNodeRegion (UpdateNodeRegionRequest) returns (RPCSuccess);`

**请求对象 (`UpdateNodeRegionRequest`)**

```json
{
  "nodeRegionId": "int64",
  "name": "string // 名称",
  "description": "string // 描述（备注）",
  "isOn": "bool // 是否启用"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/updateNodeRegion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateNodeRegionOrders
> 排序

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/updateNodeRegionOrders`
- RPC：`rpc updateNodeRegionOrders (UpdateNodeRegionOrdersRequest) returns (RPCSuccess);`

**请求对象 (`UpdateNodeRegionOrdersRequest`)**

```json
{
  "nodeRegionIds": "[]int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/updateNodeRegionOrders" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateNodeRegionPrice
> 修改价格项价格

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeRegionService/updateNodeRegionPrice`
- RPC：`rpc updateNodeRegionPrice (UpdateNodeRegionPriceRequest) returns (RPCSuccess);`

**请求对象 (`UpdateNodeRegionPriceRequest`)**

```json
{
  "nodeRegionId": "int64",
  "nodeItemId": "int64",
  "price": "float"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/NodeRegionService/updateNodeRegionPrice" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
