# HTTPPageService
> 自定义页面服务

---

## createHTTPPage
> 创建Page

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/HTTPPageService/createHTTPPage`
- RPC：`rpc createHTTPPage (CreateHTTPPageRequest) returns (CreateHTTPPageResponse);`

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

```json
{
  "statusList": "[]string // 状态码列表",
  "bodyType": "string // 页面类型：html|url|redirectURL",
  "url": "string // 读取或者跳转的URL",
  "body": "string // HTML内容",
  "newStatus": "int32 // 新的状态码",
  "exceptURLPatternsJSON": "bytes // 例外URL列表",
  "onlyURLPatternsJSON": "bytes // 限制URL列表"
}
```

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

```json
{
  "httpPageId": "int64"
}
```

**调用示例**

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

---

## findEnabledHTTPPageConfig
> 查找单个Page配置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/HTTPPageService/findEnabledHTTPPageConfig`
- RPC：`rpc findEnabledHTTPPageConfig (FindEnabledHTTPPageConfigRequest) returns (FindEnabledHTTPPageConfigResponse);`

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

```json
{
  "httpPageId": "int64"
}
```

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

```json
{
  "pageJSON": "bytes"
}
```

**调用示例**

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

---

## updateHTTPPage
> 修改Page

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

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

```json
{
  "httpPageId": "int64",
  "statusList": "[]string",
  "bodyType": "string // 页面类型：html|url|redirectURL",
  "url": "string",
  "body": "string",
  "newStatus": "int32",
  "exceptURLPatternsJSON": "bytes // 例外URL列表",
  "onlyURLPatternsJSON": "bytes // 限制URL列表"
}
```

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

```json
{}
```

**调用示例**

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

---
