# UserOrderService
> 用户订单相关服务

---

## cancelUserOrder
> 取消订单

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

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

```json
{
  "code": "string"
}
```

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

```json
{}
```

**调用示例**

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

---

## countEnabledUserOrders
> 计算订单数量

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

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

```json
{
  "userId": "int64 // 用户ID",
  "keyword": "string // 关键词",
  "status": "string"
}
```

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

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

**调用示例**

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

---

## findEnabledUserOrder
> 查看订单

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/UserOrderService/findEnabledUserOrder`
- RPC：`rpc findEnabledUserOrder(FindEnabledUserOrderRequest) returns (FindEnabledUserOrderResponse);`

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

```json
{
  "code": "string"
}
```

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

```json
{
  "userOrder": "UserOrder"
}
```

**调用示例**

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

---

## finishUserOrder
> 完成订单

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/UserOrderService/finishUserOrder`
- RPC：`rpc finishUserOrder(FinishUserOrderRequest) returns (RPCSuccess);`

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

```json
{
  "code": "string"
}
```

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

```json
{}
```

**调用示例**

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

---

## listEnabledUserOrders
> 列出单页订单

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/UserOrderService/listEnabledUserOrders`
- RPC：`rpc listEnabledUserOrders(ListEnabledUserOrdersRequest) returns (ListEnabledUserOrdersResponse);`

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

```json
{
  "userId": "int64 // 用户ID",
  "keyword": "string // 关键词",
  "status": "string",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0"
}
```

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

```json
{
  "userOrders": "[]UserOrder"
}
```

**调用示例**

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

---
