# NSDomainGroupService
> 域名分组服务

---

## countAllAvailableNSDomainGroups
> 查询可用分组数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/countAllAvailableNSDomainGroups`
- RPC：`rpc countAllAvailableNSDomainGroups(CountAllAvailableNSDomainGroupsRequest) returns (RPCCountResponse);`

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

```json
{
  "userId": "int64 // 用户ID"
}
```

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

```json
{
  "count": "int64 // 数量"
}
```

**调用示例**

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

---

## createNSDomainGroup
> 创建分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/createNSDomainGroup`
- RPC：`rpc createNSDomainGroup(CreateNSDomainGroupRequest) returns (CreateNSDomainGroupResponse);`

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

```json
{
  "name": "string // 名称"
}
```

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

```json
{
  "nsDomainGroupId": "int64"
}
```

**调用示例**

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

---

## deleteNSDomainGroup
> 删除分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/deleteNSDomainGroup`
- RPC：`rpc deleteNSDomainGroup(DeleteNSDomainGroupRequest) returns (RPCSuccess);`

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

```json
{
  "nsDomainGroupId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllAvailableNSDomainGroups
> 查询所有启用分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/findAllAvailableNSDomainGroups`
- RPC：`rpc findAllAvailableNSDomainGroups(FindAllAvailableNSDomainGroupsRequest) returns (FindAllAvailableNSDomainGroupsResponse);`

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

```json
{
  "userId": "int64 // 用户ID"
}
```

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

```json
{
  "nsDomainGroups": "[]NSDomainGroup"
}
```

**调用示例**

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

---

## findAllNSDomainGroups
> 查询所有分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/findAllNSDomainGroups`
- RPC：`rpc findAllNSDomainGroups(FindAllNSDomainGroupsRequest) returns (FindAllNSDomainGroupsResponse);`

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

```json
{
  "userId": "int64 // 用户ID"
}
```

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

```json
{
  "nsDomainGroups": "[]NSDomainGroup"
}
```

**调用示例**

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

---

## findNSDomainGroup
> 查找单个分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/findNSDomainGroup`
- RPC：`rpc findNSDomainGroup(FindNSDomainGroupRequest) returns (FindNSDomainGroupResponse);`

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

```json
{
  "nsDomainGroupId": "int64"
}
```

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

```json
{
  "nsDomainGroup": "NSDomainGroup"
}
```

**调用示例**

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

---

## updateNSDomainGroup
> 修改分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/NSDomainGroupService/updateNSDomainGroup`
- RPC：`rpc updateNSDomainGroup(UpdateNSDomainGroupRequest) returns (RPCSuccess);`

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

```json
{
  "nsDomainGroupId": "int64",
  "name": "string // 名称",
  "isOn": "bool // 是否启用"
}
```

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

```json
{}
```

**调用示例**

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

---
