You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
// DistrictInfo 地址单体结构
message DistrictInfo {
int64 ID = 1;
string created_at = 2;
string updated_at = 3;
string name = 4;
string short_name = 5;
string code = 6;
string province = 7;
string city = 8;
string area = 9;
string street = 10;
uint32 level = 11;
double latitude = 12;
double longitude = 13;
repeated DistrictInfo children = 20;
}
message DistrictTree {
repeated DistrictInfo tree = 1;
}
enum DistrictQueryType {
Normal = 0; // 正常
Children = 1; // 子节点
ChildrenByLevel = 2; // 子节点level表示查询级数 1=子节点1级=Children 2=子节点2级包括1级
Parents = 3; // 所有父节点
}
message DistrictReq {
string code = 1;
string province = 2;
string city = 3;
string area = 4;
string street = 5;
uint32 level = 6;
string name = 7;
string parent_code = 8;
optional Pagination page = 10;
DistrictQueryType query_type = 11;
}
message DistrictCodeReq {
string code = 1;
}
message DistrictListResp {
optional Pagination page = 1;
repeated DistrictInfo data = 2;
}
message GetDistrictNameReq {
string code = 1;
string separator = 2;
}
message GetDistrictNameResp {
string code = 1;
string name = 2;
repeated string name_list = 3;
}
service Core {
// District management
// group: district
rpc getDistrict(DistrictCodeReq) returns (DistrictInfo);
// group: district
rpc getDistrictList(DistrictReq) returns (DistrictListResp);
// group: district
rpc getDistrictTree(DistrictCodeReq) returns (DistrictTree);
// group: district
rpc getDistrictName(GetDistrictNameReq) returns (GetDistrictNameResp);
}