# IPLibraryFileService
> IP库文件管理

---

## checkCitiesWithIPLibraryFileId
> 检查城市/市

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/checkCitiesWithIPLibraryFileId`
- RPC：`rpc checkCitiesWithIPLibraryFileId(CheckCitiesWithIPLibraryFileIdRequest) returns (CheckCitiesWithIPLibraryFileIdResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "missingCities": "[]MissingCity",
  "countryName": "string",
  "provinceName": "string",
  "cityName": "string",
  "similarCities": "[]RegionCity"
}
```

**调用示例**

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

---

## checkCountriesWithIPLibraryFileId
> 检查国家/地区

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/checkCountriesWithIPLibraryFileId`
- RPC：`rpc checkCountriesWithIPLibraryFileId(CheckCountriesWithIPLibraryFileIdRequest) returns (CheckCountriesWithIPLibraryFileIdResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "missingCountries": "[]MissingCountry",
  "countryName": "string",
  "similarCountries": "[]RegionCountry"
}
```

**调用示例**

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

---

## checkProvidersWithIPLibraryFileId
> 检查ISP运营商

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/checkProvidersWithIPLibraryFileId`
- RPC：`rpc checkProvidersWithIPLibraryFileId(CheckProvidersWithIPLibraryFileIdRequest) returns (CheckProvidersWithIPLibraryFileIdResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "missingProviders": "[]MissingProvider",
  "providerName": "string",
  "similarProviders": "[]RegionProvider"
}
```

**调用示例**

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

---

## checkProvincesWithIPLibraryFileId
> 检查省份/州

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/checkProvincesWithIPLibraryFileId`
- RPC：`rpc checkProvincesWithIPLibraryFileId(CheckProvincesWithIPLibraryFileIdRequest) returns (CheckProvincesWithIPLibraryFileIdResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "missingProvinces": "[]MissingProvince",
  "countryName": "string",
  "provinceName": "string",
  "similarProvinces": "[]RegionProvince"
}
```

**调用示例**

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

---

## checkTownsWithIPLibraryFileId
> 检查区县

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/checkTownsWithIPLibraryFileId`
- RPC：`rpc checkTownsWithIPLibraryFileId(CheckTownsWithIPLibraryFileIdRequest) returns (CheckTownsWithIPLibraryFileIdResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "missingTowns": "[]MissingTown",
  "countryName": "string",
  "provinceName": "string",
  "cityName": "string",
  "townName": "string",
  "similarTowns": "[]RegionTown"
}
```

**调用示例**

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

---

## createIPLibraryFile
> 创建IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/createIPLibraryFile`
- RPC：`rpc createIPLibraryFile(CreateIPLibraryFileRequest) returns (CreateIPLibraryFileResponse);`

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

```json
{
  "name": "string // 名称",
  "template": "string",
  "emptyValues": "[]string",
  "fileId": "int64 // 文件ID",
  "countriesJSON": "bytes",
  "provincesJSON": "bytes",
  "citiesJSON": "bytes",
  "townsJSON": "bytes",
  "providersJSON": "bytes",
  "password": "string // 密码"
}
```

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

```json
{
  "ipLibraryFileId": "int64"
}
```

**调用示例**

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

---

## deleteIPLibraryFile
> 删除IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/deleteIPLibraryFile`
- RPC：`rpc deleteIPLibraryFile(DeleteIPLibraryFileRequest) returns (RPCSuccess);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllFinishedIPLibraryFiles
> 查找所有已完成的IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/findAllFinishedIPLibraryFiles`
- RPC：`rpc findAllFinishedIPLibraryFiles(FindAllFinishedIPLibraryFilesRequest) returns (FindAllFinishedIPLibraryFilesResponse);`

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

```json
{}
```

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

```json
{
  "ipLibraryFiles": "[]IPLibraryFile"
}
```

**调用示例**

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

---

## findAllUnfinishedIPLibraryFiles
> 查找所有未完成的IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/findAllUnfinishedIPLibraryFiles`
- RPC：`rpc findAllUnfinishedIPLibraryFiles(FindAllUnfinishedIPLibraryFilesRequest) returns (FindAllUnfinishedIPLibraryFilesResponse);`

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

```json
{}
```

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

```json
{
  "ipLibraryFiles": "[]IPLibraryFile"
}
```

**调用示例**

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

---

## findIPLibraryFile
> 查找单个IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/findIPLibraryFile`
- RPC：`rpc findIPLibraryFile(FindIPLibraryFileRequest) returns (FindIPLibraryFileResponse);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{
  "ipLibraryFile": "IPLibraryFile"
}
```

**调用示例**

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

---

## generateIPLibraryFile
> 生成IP库文件

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/generateIPLibraryFile`
- RPC：`rpc generateIPLibraryFile(GenerateIPLibraryFileRequest) returns (RPCSuccess);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateIPLibraryFileFinished
> 设置某个IP库为已完成

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/IPLibraryFileService/updateIPLibraryFileFinished`
- RPC：`rpc updateIPLibraryFileFinished(UpdateIPLibraryFileFinishedRequest) returns (RPCSuccess);`

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

```json
{
  "ipLibraryFileId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---
