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