# ACMEUserService
> ACME用户相关服务

---

## countACMEUsers
> 计算用户数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/countACMEUsers`
- RPC：`rpc countACMEUsers (CountAcmeUsersRequest) returns (RPCCountResponse);`

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

```json
{
  "adminId": "int64 // 管理员ID",
  "userId": "int64 // 用户ID",
  "acmeProviderAccountId": "int64"
}
```

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

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

**调用示例**

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

---

## createACMEUser
> 创建用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/createACMEUser`
- RPC：`rpc createACMEUser (CreateACMEUserRequest) returns (CreateACMEUserResponse);`

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

```json
{
  "userId": "int64 // 所属用户，只有管理员才有权限指定",
  "email": "string // 用户邮箱",
  "description": "string // 用户描述",
  "acmeProviderCode": "string // 服务商代号",
  "acmeProviderAccountId": "int64 // 服务商帐号"
}
```

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

```json
{
  "acmeUserId": "int64"
}
```

**调用示例**

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

---

## deleteACMEUser
> 删除用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/deleteACMEUser`
- RPC：`rpc deleteACMEUser (DeleteACMEUserRequest) returns (RPCSuccess);`

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

```json
{
  "acmeUserId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllACMEUsers
> 查找所有用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/findAllACMEUsers`
- RPC：`rpc findAllACMEUsers (FindAllACMEUsersRequest) returns (FindAllACMEUsersResponse);`

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

```json
{
  "adminId": "int64 // 管理员ID",
  "userId": "int64 // 用户ID",
  "acmeProviderCode": "string"
}
```

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

```json
{
  "acmeUsers": "[]ACMEUser"
}
```

**调用示例**

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

---

## findEnabledACMEUser
> 查找单个用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/findEnabledACMEUser`
- RPC：`rpc findEnabledACMEUser (FindEnabledACMEUserRequest) returns (FindEnabledACMEUserResponse);`

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

```json
{
  "acmeUserId": "int64"
}
```

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

```json
{
  "acmeUser": "ACMEUser"
}
```

**调用示例**

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

---

## listACMEUsers
> 列出单页用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/listACMEUsers`
- RPC：`rpc listACMEUsers (ListACMEUsersRequest) returns (ListACMEUsersResponse);`

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

```json
{
  "adminId": "int64 // 管理员ID",
  "userId": "int64 // 用户ID",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0"
}
```

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

```json
{
  "acmeUsers": "[]ACMEUser"
}
```

**调用示例**

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

---

## updateACMEUser
> 修改用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ACMEUserService/updateACMEUser`
- RPC：`rpc updateACMEUser (UpdateACMEUserRequest) returns (RPCSuccess);`

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

```json
{
  "acmeUserId": "int64",
  "description": "string // 描述（备注）"
}
```

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

```json
{}
```

**调用示例**

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

---
