# ADPackagePeriodService
> 高防实例有效期服务

---

## createADPackagePeriod
> 创建有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/createADPackagePeriod`
- RPC：`rpc createADPackagePeriod(CreateADPackagePeriodRequest) returns (CreateADPackagePeriodResponse);`

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

```json
{
  "count": "int32 // 数量",
  "unit": "string // month | year"
}
```

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

```json
{
  "adPackagePeriodId": "int64"
}
```

**调用示例**

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

---

## deleteADPackagePeriod
> 删除有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/deleteADPackagePeriod`
- RPC：`rpc deleteADPackagePeriod(DeleteADPackagePeriodRequest) returns (RPCSuccess);`

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

```json
{
  "adPackagePeriodId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## findADPackagePeriod
> 查找有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/findADPackagePeriod`
- RPC：`rpc findADPackagePeriod(FindADPackagePeriodRequest) returns (FindADPackagePeriodResponse);`

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

```json
{
  "adPackagePeriodId": "int64"
}
```

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

```json
{
  "adPackagePeriod": "ADPackagePeriod"
}
```

**调用示例**

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

---

## findAllADPackagePeriods
> 列出所有有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/findAllADPackagePeriods`
- RPC：`rpc findAllADPackagePeriods(FindAllADPackagePeriodsRequest) returns (FindAllADPackagePeriodsResponse);`

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

```json
{}
```

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

```json
{
  "adPackagePeriods": "[]ADPackagePeriod"
}
```

**调用示例**

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

---

## findAllAvailableADPackagePeriods
> 列出所有可用有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/findAllAvailableADPackagePeriods`
- RPC：`rpc findAllAvailableADPackagePeriods(FindAllAvailableADPackagePeriodsRequest) returns (FindAllAvailableADPackagePeriodsResponse);`

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

```json
{}
```

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

```json
{
  "adPackagePeriods": "[]ADPackagePeriod"
}
```

**调用示例**

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

---

## updateADPackagePeriod
> 修改有效期

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ADPackagePeriodService/updateADPackagePeriod`
- RPC：`rpc updateADPackagePeriod(UpdateADPackagePeriodRequest) returns (RPCSuccess);`

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

```json
{
  "adPackagePeriodId": "int64",
  "isOn": "bool // 是否启用"
}
```

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

```json
{}
```

**调用示例**

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

---
