2021-05-27 17:08:57 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
|
|
|
|
|
import "models/model_ns_record.proto";
|
|
|
|
|
import "models/rpc_messages.proto";
|
|
|
|
|
|
|
|
|
|
// 域名记录相关服务
|
|
|
|
|
service NSRecordService {
|
|
|
|
|
// 创建记录
|
|
|
|
|
rpc createNSRecord (CreateNSRecordRequest) returns (CreateNSRecordResponse);
|
|
|
|
|
|
2022-08-06 20:29:26 +08:00
|
|
|
// 批量创建记录
|
|
|
|
|
rpc createNSRecords(CreateNSRecordsRequest) returns (CreateNSRecordsResponse);
|
|
|
|
|
|
2022-08-09 21:03:04 +08:00
|
|
|
// 为一组域名批量创建记录
|
|
|
|
|
rpc createNSRecordsWithDomainNames(CreateNSRecordsWithDomainNamesRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 批量修改一组域名的一组记录
|
|
|
|
|
rpc updateNSRecordsWithDomainNames(UpdateNSRecordsWithDomainNamesRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 批量删除一组域名的一组记录
|
|
|
|
|
rpc deleteNSRecordsWithDomainNames(DeleteNSRecordsWithDomainNamesRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 批量一组域名的一组记录启用状态
|
|
|
|
|
rpc updateNSRecordsIsOnWithDomainNames(UpdateNSRecordsIsOnWithDomainNamesRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 导入域名解析
|
|
|
|
|
rpc importNSRecords(ImportNSRecordsRequest) returns (RPCSuccess);
|
|
|
|
|
|
2021-05-27 17:08:57 +08:00
|
|
|
// 修改记录
|
|
|
|
|
rpc updateNSRecord (UpdateNSRecordRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 删除记录
|
|
|
|
|
rpc deleteNSRecord (DeleteNSRecordRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 计算记录数量
|
2022-08-06 20:29:26 +08:00
|
|
|
rpc countAllNSRecords (CountAllNSRecordsRequest) returns (RPCCountResponse);
|
2021-05-27 17:08:57 +08:00
|
|
|
|
|
|
|
|
// 读取单页记录
|
2022-08-06 20:29:26 +08:00
|
|
|
rpc listNSRecords (ListNSRecordsRequest) returns (ListNSRecordsResponse);
|
2021-05-27 17:08:57 +08:00
|
|
|
|
|
|
|
|
// 查询单个记录信息
|
2022-08-06 20:29:26 +08:00
|
|
|
rpc findNSRecord (FindNSRecordRequest) returns (FindNSRecordResponse);
|
2021-06-01 16:43:13 +08:00
|
|
|
|
|
|
|
|
// 根据版本列出一组记录
|
|
|
|
|
rpc listNSRecordsAfterVersion (ListNSRecordsAfterVersionRequest) returns (ListNSRecordsAfterVersionResponse);
|
2021-05-27 17:08:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建记录
|
|
|
|
|
message CreateNSRecordRequest {
|
|
|
|
|
int64 nsDomainId = 1;
|
|
|
|
|
string description = 2;
|
|
|
|
|
string name = 3;
|
|
|
|
|
string type = 4;
|
|
|
|
|
string value = 5;
|
|
|
|
|
int32 ttl = 6;
|
2021-08-09 13:59:55 +08:00
|
|
|
repeated int64 nsRouteIds = 7 [deprecated = true];
|
|
|
|
|
repeated string nsRouteCodes = 8; // 路线代号
|
2021-05-27 17:08:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateNSRecordResponse {
|
|
|
|
|
int64 nsRecordId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-06 20:29:26 +08:00
|
|
|
// 批量创建记录
|
|
|
|
|
message CreateNSRecordsRequest {
|
|
|
|
|
int64 nsDomainId = 1;
|
|
|
|
|
string description = 2;
|
|
|
|
|
repeated string names = 3;
|
|
|
|
|
string type = 4;
|
|
|
|
|
string value = 5;
|
|
|
|
|
int32 ttl = 6;
|
|
|
|
|
repeated string nsRouteCodes = 7; // 路线代号
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateNSRecordsResponse {
|
|
|
|
|
repeated int64 nsRecordIds = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 21:03:04 +08:00
|
|
|
// 为一组域名批量创建记录
|
|
|
|
|
message CreateNSRecordsWithDomainNamesRequest {
|
|
|
|
|
repeated string nsDomainNames = 1;
|
|
|
|
|
bytes recordsJSON = 2;
|
|
|
|
|
bool removeOld = 3;
|
|
|
|
|
bool removeAll = 4;
|
2022-08-25 11:36:45 +08:00
|
|
|
int64 userId = 5;
|
2022-08-09 21:03:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 批量修改一组域名的一组记录
|
|
|
|
|
message UpdateNSRecordsWithDomainNamesRequest {
|
|
|
|
|
repeated string nsDomainNames = 1;
|
|
|
|
|
string searchName = 2;
|
|
|
|
|
string searchValue = 3;
|
|
|
|
|
string searchType = 4;
|
|
|
|
|
repeated string searchNSRouteCodes = 5;
|
|
|
|
|
string newName = 6;
|
|
|
|
|
string newValue = 7;
|
|
|
|
|
string newType = 8;
|
|
|
|
|
repeated string newNSRouteCodes = 9;
|
2022-08-25 11:36:45 +08:00
|
|
|
int64 userId = 10;
|
2022-08-09 21:03:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 批量删除一组域名的一组记录
|
|
|
|
|
message DeleteNSRecordsWithDomainNamesRequest {
|
|
|
|
|
repeated string nsDomainNames = 1;
|
|
|
|
|
string searchName = 2;
|
|
|
|
|
string searchValue = 3;
|
|
|
|
|
string searchType = 4;
|
|
|
|
|
repeated string searchNSRouteCodes = 5;
|
2022-08-25 11:36:45 +08:00
|
|
|
int64 userId = 6;
|
2022-08-09 21:03:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 批量一组域名的一组记录启用状态
|
|
|
|
|
message UpdateNSRecordsIsOnWithDomainNamesRequest {
|
|
|
|
|
repeated string nsDomainNames = 1;
|
|
|
|
|
string searchName = 2;
|
|
|
|
|
string searchValue = 3;
|
|
|
|
|
string searchType = 4;
|
|
|
|
|
repeated string searchNSRouteCodes = 5;
|
|
|
|
|
bool isOn = 6;
|
2022-08-25 11:36:45 +08:00
|
|
|
int64 userId = 7;
|
2022-08-09 21:03:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导入域名解析
|
|
|
|
|
message ImportNSRecordsRequest {
|
|
|
|
|
repeated Record nsRecords = 1;
|
2022-08-25 11:36:45 +08:00
|
|
|
int64 userId = 2;
|
2022-08-09 21:03:04 +08:00
|
|
|
|
|
|
|
|
message Record {
|
|
|
|
|
string nsDomainName = 1;
|
|
|
|
|
string name = 2;
|
|
|
|
|
string type = 3;
|
|
|
|
|
string value = 4;
|
|
|
|
|
int32 ttl = 5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-27 17:08:57 +08:00
|
|
|
// 修改记录
|
|
|
|
|
message UpdateNSRecordRequest {
|
|
|
|
|
int64 nsRecordId = 1;
|
|
|
|
|
string description = 2;
|
|
|
|
|
string name = 3;
|
|
|
|
|
string type = 4;
|
|
|
|
|
string value = 5;
|
|
|
|
|
int32 ttl = 6;
|
2021-08-09 13:59:55 +08:00
|
|
|
repeated int64 nsRouteIds = 7 [deprecated = true];
|
2021-07-20 19:03:56 +08:00
|
|
|
bool isOn = 8;
|
2021-08-09 13:59:55 +08:00
|
|
|
repeated string nsRouteCodes = 9; // 路线代号
|
2021-05-27 17:08:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除记录
|
|
|
|
|
message DeleteNSRecordRequest {
|
|
|
|
|
int64 nsRecordId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算记录数量
|
2022-08-06 20:29:26 +08:00
|
|
|
message CountAllNSRecordsRequest {
|
2021-05-27 17:08:57 +08:00
|
|
|
int64 nsDomainId = 1;
|
|
|
|
|
string type = 2;
|
2021-08-09 13:59:55 +08:00
|
|
|
int64 nsRouteId = 3 [deprecated = true]; // 使用nsRouteCode代替
|
|
|
|
|
string nsRouteCode = 5;
|
2021-05-27 17:08:57 +08:00
|
|
|
string keyword = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 读取单页记录
|
2022-08-06 20:29:26 +08:00
|
|
|
message ListNSRecordsRequest {
|
2021-05-27 17:08:57 +08:00
|
|
|
int64 nsDomainId = 1;
|
|
|
|
|
string type = 2;
|
2021-08-09 13:59:55 +08:00
|
|
|
int64 nsRouteId = 3 [deprecated = true]; // 使用nsRouteCode代替
|
|
|
|
|
string nsRouteCode = 7;
|
2021-05-27 17:08:57 +08:00
|
|
|
string keyword = 4;
|
|
|
|
|
int64 offset = 5;
|
|
|
|
|
int64 size = 6;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-06 20:29:26 +08:00
|
|
|
message ListNSRecordsResponse {
|
2021-05-27 17:08:57 +08:00
|
|
|
repeated NSRecord nsRecords = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询单个记录信息
|
2022-08-06 20:29:26 +08:00
|
|
|
message FindNSRecordRequest {
|
2021-05-27 17:08:57 +08:00
|
|
|
int64 nsRecordId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-06 20:29:26 +08:00
|
|
|
message FindNSRecordResponse {
|
2021-05-27 17:08:57 +08:00
|
|
|
NSRecord nsRecord = 1;
|
2021-06-01 16:43:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据版本列出一组记录
|
|
|
|
|
message ListNSRecordsAfterVersionRequest {
|
|
|
|
|
int64 version = 1;
|
|
|
|
|
int64 size = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListNSRecordsAfterVersionResponse {
|
|
|
|
|
repeated NSRecord nsRecords = 1;
|
2021-05-27 17:08:57 +08:00
|
|
|
}
|