You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.1 KiB
90 lines
2.1 KiB
syntax = "proto3";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "gogoproto/gogo.proto";
|
|
// import "validate/validate.proto";
|
|
import "google/api/annotations.proto";
|
|
import "google/protobuf/empty.proto";
|
|
|
|
package api.v1;
|
|
|
|
option go_package = "moredoc/api/v1;v1";
|
|
option java_multiple_files = true;
|
|
option java_package = "api.v1";
|
|
|
|
// 友情链接
|
|
message Friendlink {
|
|
int32 id = 1; // 主键
|
|
string title = 2; // 标题
|
|
string link = 3; // 链接
|
|
string description = 4; // 描述
|
|
int32 sort = 5; // 排序
|
|
bool enable = 6; // 是否启用
|
|
google.protobuf.Timestamp created_at = 7
|
|
[ (gogoproto.stdtime) = true ]; // 创建时间
|
|
google.protobuf.Timestamp updated_at = 8
|
|
[ (gogoproto.stdtime) = true ]; // 更新时间
|
|
}
|
|
|
|
// 删除友情链接
|
|
message DeleteFriendlinkRequest { repeated int64 id = 1; }
|
|
|
|
// 获取友情链接
|
|
message GetFriendlinkRequest { int64 id = 1; }
|
|
|
|
// 友情链接列表
|
|
message ListFriendlinkRequest {
|
|
int32 page = 1;
|
|
int32 size = 2;
|
|
string wd = 3;
|
|
repeated bool enable = 4;
|
|
repeated string field = 5;
|
|
}
|
|
|
|
// 友情链接列表
|
|
message ListFriendlinkReply {
|
|
repeated Friendlink friendlink = 1;
|
|
int64 total = 2;
|
|
}
|
|
|
|
// 友情链接服务
|
|
service FriendlinkAPI {
|
|
|
|
// 创建友情链接
|
|
rpc CreateFriendlink(Friendlink) returns (Friendlink) {
|
|
option (google.api.http) = {
|
|
post : '/api/v1/friendlink',
|
|
body : '*',
|
|
};
|
|
}
|
|
|
|
// 更新友情链接
|
|
rpc UpdateFriendlink(Friendlink) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put : '/api/v1/friendlink',
|
|
body : '*',
|
|
};
|
|
}
|
|
|
|
// 删除友情链接
|
|
rpc DeleteFriendlink(DeleteFriendlinkRequest)
|
|
returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
delete : '/api/v1/friendlink',
|
|
};
|
|
}
|
|
|
|
// 获取友情链接
|
|
rpc GetFriendlink(GetFriendlinkRequest) returns (Friendlink) {
|
|
option (google.api.http) = {
|
|
get : '/api/v1/friendlink',
|
|
};
|
|
}
|
|
|
|
// 获取友情链接
|
|
rpc ListFriendlink(ListFriendlinkRequest) returns (ListFriendlinkReply) {
|
|
option (google.api.http) = {
|
|
get : '/api/v1/friendlink/list',
|
|
};
|
|
}
|
|
} |