Files
pyGoEdge-UserPanel/reference/goedge 文档/IPLibraryService.md
2025-11-18 03:36:49 +08:00

136 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IPLibraryService
> IP库
---
## createIPLibrary
> 创建IP库
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/IPLibraryService/createIPLibrary`
- RPC`rpc createIPLibrary (CreateIPLibraryRequest) returns (CreateIPLibraryResponse) {
option deprecated = true;
};
// 查找最新的IP库
rpc findLatestIPLibraryWithType (FindLatestIPLibraryWithTypeRequest) returns (FindLatestIPLibraryWithTypeResponse) {
option deprecated = true;
};
// 查找单个IP库
rpc findEnabledIPLibrary (FindEnabledIPLibraryRequest) returns (FindEnabledIPLibraryResponse) {
option deprecated = true;
};
// 列出某个类型的所有IP库
rpc findAllEnabledIPLibrariesWithType (FindAllEnabledIPLibrariesWithTypeRequest) returns (FindAllEnabledIPLibrariesWithTypeResponse) {
option deprecated = true;
};
// 删除IP库
rpc deleteIPLibrary (DeleteIPLibraryRequest) returns (RPCSuccess) {
option deprecated = true;
};`
**请求对象 (`CreateIPLibraryRequest`)**
```json
{
"type": "string",
"fileId": "int64 // 文件ID"
}
```
**响应对象 (`CreateIPLibraryResponse`)**
```json
{
"ipLibraryId": "int64"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryService/createIPLibrary" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## lookupIPRegion
> 查询某个IP信息
- 角色:`admin`, `user`
- HTTP`POST https://backend.dooki.cloud/IPLibraryService/lookupIPRegion`
- RPC`rpc lookupIPRegion (LookupIPRegionRequest) returns (LookupIPRegionResponse);`
**请求对象 (`LookupIPRegionRequest`)**
```json
{
"ip": "string"
}
```
**响应对象 (`LookupIPRegionResponse`)**
```json
{
"ipRegion": "IPRegion"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryService/lookupIPRegion" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## lookupIPRegions
> 查询一组IP信息
- 角色:`admin`, `user`
- HTTP`POST https://backend.dooki.cloud/IPLibraryService/lookupIPRegions`
- RPC`rpc lookupIPRegions (LookupIPRegionsRequest) returns (LookupIPRegionsResponse);`
**请求对象 (`LookupIPRegionsRequest`)**
```json
{
"ipList": "[]string"
}
```
**响应对象 (`LookupIPRegionsResponse`)**
```json
{
"ipRegionMap": "map"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/IPLibraryService/lookupIPRegions" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---