# LoginTicketService
> 登录票据相关服务

---

## createLoginTicket
> 创建票据

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/LoginTicketService/createLoginTicket`
- RPC：`rpc createLoginTicket(CreateLoginTicketRequest) returns (CreateLoginTicketResponse);`

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

```json
{
  "adminId": "int64 // 管理员ID，和用户ID二选一",
  "userId": "int64 // 用户ID",
  "ip": "string // 可选参数，用户客户端IP"
}
```

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

```json
{
  "value": "string // 票据值"
}
```

**调用示例**

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

---

## findLoginTicketWithValue
> 查找票据
查找成功后，会自动删除票据信息，所以票据信息只能查询一次

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/LoginTicketService/findLoginTicketWithValue`
- RPC：`rpc findLoginTicketWithValue(FindLoginTicketWithValueRequest) returns (FindLoginTicketWithValueResponse);`

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

```json
{
  "value": "string // 票据值"
}
```

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

```json
{
  "loginTicket": "LoginTicket // 票据信息"
}
```

**调用示例**

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

---
