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);
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|