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.
goctls-template/rpc/template.tpl

59 lines
948 B
Smarty

1 year ago
syntax = "proto3";
package {{.package}};
option go_package="./{{.package}}";
// Base message
message Empty {}
message IDReq {
uint64 id = 1;
}
message IDsReq {
repeated uint64 ids = 1;
}
// 基础回执
message BaseResp {
uint32 code = 1;
string msg = 2;
}
// 基础回执带ID
message BaseIDResp {
uint64 id = 1;
uint32 code = 2;
string msg = 3;
}
// 分页参数
message Pagination {
uint64 size = 1; // 每页条目个数
uint64 total = 2; // 数据条目总数
uint64 current = 3; // 当前页码
}
// 操作类型
enum Operator {
EQ = 0; // ==
NEQ = 1; // !=
IN = 2; // in ()
NotIn = 3; // not in ()
GT = 4; // >
GTE = 5; // >=
LT = 6; // <
LTE = 7; // <=
Contains = 8; // %{}%
Prefix = 9; // {}%
Suffix = 10; // %{}
EqualFold = 11; // == with toLower
ContainsFold = 12; // %{}% with toLower
}
service {{.serviceName}} {
// group: base
rpc initDatabase (Empty) returns (BaseResp);
}