# MessageReceiverService
> 消息对象接收者设置

---

## countAllEnabledMessageReceivers
> 计算接收者数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/MessageReceiverService/countAllEnabledMessageReceivers`
- RPC：`rpc countAllEnabledMessageReceivers (CountAllEnabledMessageReceiversRequest) returns (RPCCountResponse);`

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

```json
{
  "role": "string // 集群角色：node 或 dns",
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "serverId": "int64 // 网站ID"
}
```

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

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

**调用示例**

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

---

## deleteMessageReceiver
> 删除接收者

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/MessageReceiverService/deleteMessageReceiver`
- RPC：`rpc deleteMessageReceiver (DeleteMessageReceiverRequest) returns (RPCSuccess);`

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

```json
{
  "messageReceiverId": "int64 // 接收者ID"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllEnabledMessageReceivers
> 查找接收者

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/MessageReceiverService/findAllEnabledMessageReceivers`
- RPC：`rpc findAllEnabledMessageReceivers (FindAllEnabledMessageReceiversRequest) returns (FindAllEnabledMessageReceiversResponse);`

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

```json
{
  "role": "string // 集群角色：node 或 dns",
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "messageReceivers": "[]MessageReceiver"
}
```

**调用示例**

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

---

## findAllEnabledMessageReceiversWithMessageRecipientId
> 根据接收人查找关联的接收者

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/MessageReceiverService/findAllEnabledMessageReceiversWithMessageRecipientId`
- RPC：`rpc findAllEnabledMessageReceiversWithMessageRecipientId (FindAllEnabledMessageReceiversWithMessageRecipientIdRequest) returns (FindAllEnabledMessageReceiversWithMessageRecipientIdResponse);`

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

```json
{
  "messageRecipientId": "int64 // 关联的接收人ID"
}
```

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

```json
{
  "messageReceivers": "[]MessageReceiver"
}
```

**调用示例**

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

---

## updateMessageReceivers
> 修改接收者

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/MessageReceiverService/updateMessageReceivers`
- RPC：`rpc updateMessageReceivers (UpdateMessageReceiversRequest) returns (RPCSuccess);`

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

```json
{
  "role": "string",
  "nodeClusterId": "int64 // 集群ID",
  "nodeId": "int64 // 节点ID",
  "serverId": "int64 // 服务ID（网站ID）",
  "paramsJSON": "bytes",
  "recipientOptions": "[]RecipientOption",
  "messageRecipientId": "int64",
  "messageRecipientGroupId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---
