31 lines
678 B
Protocol Buffer
31 lines
678 B
Protocol Buffer
|
syntax = "proto3"; //版本声明,使用v3版本
|
|||
|
|
|||
|
package service.auth;
|
|||
|
option go_package = "fusen-auth/gen/go/auth/";
|
|||
|
|
|||
|
// 导入google/api/annotations.proto 注释依赖
|
|||
|
import "google/api/annotations.proto";
|
|||
|
// import "basic.proto";
|
|||
|
|
|||
|
//定义服务
|
|||
|
service AuthService {
|
|||
|
//定义服务方法
|
|||
|
rpc SayHello (AuthRequest) returns (Response) {
|
|||
|
//添加http网关注解
|
|||
|
option (google.api.http) = {
|
|||
|
post: "/api/auth/example/echo"
|
|||
|
body: "*"
|
|||
|
};
|
|||
|
}
|
|||
|
rpc SayHelloAgain (AuthRequest) returns (Response) {}
|
|||
|
}
|
|||
|
|
|||
|
// 定义请求消息类型.
|
|||
|
message AuthRequest {
|
|||
|
string name = 1;
|
|||
|
}
|
|||
|
|
|||
|
// 定义响应消息类型.
|
|||
|
message Response {
|
|||
|
string message = 1;
|
|||
|
}
|