# NodeLogService
> 节点日志相关服务

---

## countAllUnreadNodeLogs
> 计算未读的日志数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/countAllUnreadNodeLogs`
- RPC：`rpc countAllUnreadNodeLogs(CountAllUnreadNodeLogsRequest) returns (RPCCountResponse);`

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

```json
{}
```

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

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

**调用示例**

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

---

## countNodeLogs
> 查询日志数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/countNodeLogs`
- RPC：`rpc countNodeLogs (CountNodeLogsRequest) returns (RPCCountResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "role": "string",
  "dayFrom": "string",
  "dayTo": "string",
  "keyword": "string // 关键词",
  "level": "string",
  "serverId": "int64 // 服务ID（网站ID）",
  "originId": "int64",
  "isUnread": "bool",
  "tag": "string",
  "fixedState": "int32",
  "allServers": "bool // 是否获取所有服务相关的日志"
}
```

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

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

**调用示例**

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

---

## deleteNodeLogs
> 删除日志

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/deleteNodeLogs`
- RPC：`rpc deleteNodeLogs(DeleteNodeLogsRequest) returns (RPCSuccess);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "role": "string",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0",
  "dayFrom": "string",
  "dayTo": "string",
  "keyword": "string // 关键词",
  "level": "string",
  "serverId": "int64 // 服务ID（网站ID）",
  "fixedState": "int32",
  "allServers": "bool // 是否获取所有服务相关的日志",
  "originId": "int64",
  "isUnread": "bool",
  "tag": "string"
}
```

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

```json
{}
```

**调用示例**

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

---

## fixAllNodeLogs
> 设置所有日志为已修复

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/fixAllNodeLogs`
- RPC：`rpc fixAllNodeLogs (FixAllNodeLogsRequest) returns (RPCSuccess);`

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

```json
{}
```

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

```json
{}
```

**调用示例**

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

---

## fixNodeLogs
> 设置日志为已修复

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/fixNodeLogs`
- RPC：`rpc fixNodeLogs (FixNodeLogsRequest) returns (RPCSuccess);`

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

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

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

```json
{}
```

**调用示例**

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

---

## listNodeLogs
> 列出单页日志

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/listNodeLogs`
- RPC：`rpc listNodeLogs (ListNodeLogsRequest) returns (ListNodeLogsResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "role": "string",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0",
  "dayFrom": "string",
  "dayTo": "string",
  "keyword": "string // 关键词",
  "level": "string",
  "serverId": "int64 // 服务ID（网站ID）",
  "fixedState": "int32",
  "allServers": "bool // 是否获取所有服务相关的日志",
  "originId": "int64",
  "isUnread": "bool",
  "tag": "string"
}
```

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

```json
{
  "nodeLogs": "[]NodeLog"
}
```

**调用示例**

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

---

## updateAllNodeLogsRead
> 设置所有日志未已读

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/updateAllNodeLogsRead`
- RPC：`rpc updateAllNodeLogsRead(UpdateAllNodeLogsReadRequest) returns (RPCSuccess);`

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

```json
{}
```

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

```json
{}
```

**调用示例**

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

---

## updateNodeLogsRead
> 设置日志为已读

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeLogService/updateNodeLogsRead`
- RPC：`rpc updateNodeLogsRead(UpdateNodeLogsReadRequest) returns (RPCSuccess);`

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

```json
{
  "nodeLogIds": "[]int64",
  "nodeId": "int64 // 节点ID",
  "role": "string"
}
```

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

```json
{}
```

**调用示例**

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

---
