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.

59 lines
1.2 KiB

2 years ago
syntax = "proto3";
2 years ago
package com.diulo.api;
2 years ago
option go_package = "./;user";
2 years ago
//import "validate/validate.proto";
2 years ago
import "google/api/annotations.proto";
2 years ago
//import "google/protobuf/wrappers.proto";
2 years ago
import "auth/auth.proto";
2 years ago
//import "google/protobuf/descriptor.proto";
2 years ago
2 years ago
service user{
2 years ago
rpc list(request)returns(response){
2 years ago
option(auth.auth_key) = "user:list";
2 years ago
option(google.api.http) = {
2 years ago
get:"/api/v1/user/list"
2 years ago
};
}
2 years ago
rpc all(request)returns(response){
2 years ago
option(auth.auth) = true;
2 years ago
option (google.api.http) = {
2 years ago
get: "/api/v1/user/all",
2 years ago
};
}
2 years ago
rpc auto(request)returns(response){
2 years ago
option(auth.auth) = false;
2 years ago
option (google.api.http) = {
2 years ago
get: "/api/v1/user/auto",
2 years ago
};
}
2 years ago
2 years ago
//有 "user:list"
rpc loginWithList(request)returns(response){
2 years ago
option (google.api.http) = {
2 years ago
get: "/api/v1/user/login_list",
2 years ago
};
}
2 years ago
// 没有 "user:list" 权限
rpc login(request)returns(response){
2 years ago
option (google.api.http) = {
2 years ago
get: "/api/v1/user/login",
2 years ago
};
}
1 year ago
rpc login1(request)returns(response){
option (google.api.http) = {
post: "/api/v1/user/login1",
body:"*",
};
}
2 years ago
}
2 years ago
message request{
2 years ago
}
2 years ago
message response{
2 years ago
//密钥
string token = 1;
}