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.

49 lines
1.1 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";
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
//列表
2 years ago
rpc list(loginRequest)returns(loginResponse){
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
//等了
2 years ago
rpc login(loginRequest)returns(loginResponse){
2 years ago
option(auth.auth) = true;
2 years ago
option (google.api.http) = {
2 years ago
get: "/api/v1/user/login",
2 years ago
};
}
1 year ago
rpc delete(loginRequest)returns(loginResponse){
option(auth.auth) = false;
option (google.api.http) = {
get: "/api/v1/user/delete",
};
}
rpc delete1(loginRequest)returns(loginResponse){
option (google.api.http) = {
get: "/api/v1/user/delete1",
};
}
2 years ago
}
message loginRequest{
2 years ago
//用户名
string username = 1 [(validate.rules).string = {min_len:4,max_len:10}];
string password = 2 [(validate.rules).string = {min_len:4,max_len:10}];
string first_name = 3;
2 years ago
}
message loginResponse{
2 years ago
//密钥
string token = 1;
}