mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-16 13:56:34 +08:00
IP库阶段性提交(未完成)
This commit is contained in:
18
pkg/rpc/protos/models/model_region_town.proto
Normal file
18
pkg/rpc/protos/models/model_region_town.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_region_city.proto";
|
||||
|
||||
message RegionTown {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
repeated string codes = 3;
|
||||
int64 regionCityId = 4;
|
||||
string customName = 5;
|
||||
repeated string customCodes = 6;
|
||||
string displayName = 7;
|
||||
|
||||
RegionCity regionCity = 30;
|
||||
}
|
||||
@@ -9,25 +9,39 @@ import "models/model_ip_library.proto";
|
||||
// IP库
|
||||
service IPLibraryService {
|
||||
// 创建IP库
|
||||
rpc createIPLibrary (CreateIPLibraryRequest) returns (CreateIPLibraryResponse);
|
||||
rpc createIPLibrary (CreateIPLibraryRequest) returns (CreateIPLibraryResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 查找最新的IP库
|
||||
rpc findLatestIPLibraryWithType (FindLatestIPLibraryWithTypeRequest) returns (FindLatestIPLibraryWithTypeResponse);
|
||||
rpc findLatestIPLibraryWithType (FindLatestIPLibraryWithTypeRequest) returns (FindLatestIPLibraryWithTypeResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 查找单个IP库
|
||||
rpc findEnabledIPLibrary (FindEnabledIPLibraryRequest) returns (FindEnabledIPLibraryResponse);
|
||||
rpc findEnabledIPLibrary (FindEnabledIPLibraryRequest) returns (FindEnabledIPLibraryResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 列出某个类型的所有IP库
|
||||
rpc findAllEnabledIPLibrariesWithType (FindAllEnabledIPLibrariesWithTypeRequest) returns (FindAllEnabledIPLibrariesWithTypeResponse);
|
||||
rpc findAllEnabledIPLibrariesWithType (FindAllEnabledIPLibrariesWithTypeRequest) returns (FindAllEnabledIPLibrariesWithTypeResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 删除IP库
|
||||
rpc deleteIPLibrary (DeleteIPLibraryRequest) returns (RPCSuccess);
|
||||
rpc deleteIPLibrary (DeleteIPLibraryRequest) returns (RPCSuccess) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 查询某个IP信息
|
||||
rpc lookupIPRegion (LookupIPRegionRequest) returns (LookupIPRegionResponse);
|
||||
rpc lookupIPRegion (LookupIPRegionRequest) returns (LookupIPRegionResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
|
||||
// 查询一组IP信息
|
||||
rpc lookupIPRegions (LookupIPRegionsRequest) returns (LookupIPRegionsResponse);
|
||||
rpc lookupIPRegions (LookupIPRegionsRequest) returns (LookupIPRegionsResponse) {
|
||||
option deprecated = true;
|
||||
};
|
||||
}
|
||||
|
||||
// 创建IP库
|
||||
|
||||
@@ -8,6 +8,7 @@ import "models/model_ip_library_file.proto";
|
||||
import "models/model_region_country.proto";
|
||||
import "models/model_region_province.proto";
|
||||
import "models/model_region_city.proto";
|
||||
import "models/model_region_town.proto";
|
||||
import "models/model_region_provider.proto";
|
||||
|
||||
|
||||
@@ -31,6 +32,9 @@ service IPLibraryFileService {
|
||||
// 检查城市/市
|
||||
rpc checkCitiesWithIPLibraryFileId(CheckCitiesWithIPLibraryFileIdRequest) returns (CheckCitiesWithIPLibraryFileIdResponse);
|
||||
|
||||
// 检查区县
|
||||
rpc checkTownsWithIPLibraryFileId(CheckTownsWithIPLibraryFileIdRequest) returns (CheckTownsWithIPLibraryFileIdResponse);
|
||||
|
||||
// 检查ISP运营商
|
||||
rpc checkProvidersWithIPLibraryFileId(CheckProvidersWithIPLibraryFileIdRequest) returns (CheckProvidersWithIPLibraryFileIdResponse);
|
||||
|
||||
@@ -101,7 +105,6 @@ message CheckProvincesWithIPLibraryFileIdResponse {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 检查城市/市
|
||||
message CheckCitiesWithIPLibraryFileIdRequest{
|
||||
int64 ipLibraryFileId = 1;
|
||||
@@ -118,6 +121,23 @@ message CheckCitiesWithIPLibraryFileIdResponse {
|
||||
}
|
||||
}
|
||||
|
||||
// 检查区县
|
||||
message CheckTownsWithIPLibraryFileIdRequest {
|
||||
int64 ipLibraryFileId = 1;
|
||||
}
|
||||
|
||||
message CheckTownsWithIPLibraryFileIdResponse {
|
||||
repeated MissingTown missingTowns = 1;
|
||||
|
||||
message MissingTown {
|
||||
string countryName = 1;
|
||||
string provinceName = 2;
|
||||
string cityName = 3;
|
||||
string townName = 4;
|
||||
repeated RegionTown similarTowns = 5;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查ISP运营商
|
||||
message CheckProvidersWithIPLibraryFileIdRequest{
|
||||
int64 ipLibraryFileId = 1;
|
||||
|
||||
56
pkg/rpc/protos/service_region_town.proto
Normal file
56
pkg/rpc/protos/service_region_town.proto
Normal file
@@ -0,0 +1,56 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_region_town.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// 区县相关服务
|
||||
service RegionTownService {
|
||||
// 查找所有区县
|
||||
rpc findAllRegionTowns (FindAllRegionTownsRequest) returns (FindAllRegionTownsResponse);
|
||||
|
||||
// 查找某个城市的所有区县
|
||||
rpc findAllRegionTownsWithRegionCityId(FindAllRegionTownsWithRegionCityIdRequest) returns (FindAllRegionTownsWithRegionCityIdResponse);
|
||||
|
||||
// 查找单个区县信息
|
||||
rpc findRegionTown (FindRegionTownRequest) returns (FindRegionTownResponse);
|
||||
|
||||
// 修改区县定制信息
|
||||
rpc updateRegionTownCustom(UpdateRegionTownCustomRequest) returns (RPCSuccess);
|
||||
}
|
||||
|
||||
// 查找所有区县
|
||||
message FindAllRegionTownsRequest {
|
||||
bool includeRegionCity = 1;
|
||||
}
|
||||
|
||||
message FindAllRegionTownsResponse {
|
||||
repeated RegionTown regionTowns = 1;
|
||||
}
|
||||
|
||||
// 查找某个城市的所有区县
|
||||
message FindAllRegionTownsWithRegionCityIdRequest {
|
||||
int64 regionCityId = 1;
|
||||
}
|
||||
|
||||
message FindAllRegionTownsWithRegionCityIdResponse {
|
||||
repeated RegionTown regionTowns = 1;
|
||||
}
|
||||
|
||||
// 查找单个区县信息
|
||||
message FindRegionTownRequest {
|
||||
int64 regionTownId = 1;
|
||||
}
|
||||
|
||||
message FindRegionTownResponse {
|
||||
RegionTown regionTown = 1;
|
||||
}
|
||||
|
||||
// 修改区县定制信息
|
||||
message UpdateRegionTownCustomRequest {
|
||||
int64 regionTownId = 1;
|
||||
string customName = 2;
|
||||
repeated string customCodes = 3;
|
||||
}
|
||||
Reference in New Issue
Block a user