generated from VLADIMIR/template
add roles routes
This commit is contained in:
@@ -110,11 +110,31 @@ service EveningDetectiveServer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc GetUserById(GetUserByIdReq) returns (GetUserByIdRsp) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
get: "/api/users/{id}"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
rpc GetMe(GetMeReq) returns (GetMeRsp) {
|
rpc GetMe(GetMeReq) returns (GetMeRsp) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/api/me"
|
get: "/api/me"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc AddUserRole(AddUserRoleReq) returns (AddUserRoleRsp) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
post: "/api/users/{id}/role/add"
|
||||||
|
body: "*"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
rpc DeleteUserRole(DeleteUserRoleReq) returns (DeleteUserRoleRsp) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
post: "/api/users/{id}/role/delete"
|
||||||
|
body : "*"
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message PingReq {}
|
message PingReq {}
|
||||||
@@ -183,9 +203,36 @@ message User {
|
|||||||
google.protobuf.Timestamp created_at = 6;
|
google.protobuf.Timestamp created_at = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetUserByIdReq {
|
||||||
|
int32 id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetUserByIdRsp {
|
||||||
|
string error = 1;
|
||||||
|
User user = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message GetMeReq {}
|
message GetMeReq {}
|
||||||
|
|
||||||
message GetMeRsp {
|
message GetMeRsp {
|
||||||
string error = 1;
|
string error = 1;
|
||||||
User user = 2;
|
User user = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message AddUserRoleReq {
|
||||||
|
int32 id = 1;
|
||||||
|
string role = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AddUserRoleRsp {
|
||||||
|
string error = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeleteUserRoleReq {
|
||||||
|
int32 id = 1;
|
||||||
|
string role = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeleteUserRoleRsp {
|
||||||
|
string error = 1;
|
||||||
|
}
|
||||||
|
|||||||
@@ -269,9 +269,150 @@
|
|||||||
"EveningDetectiveServer"
|
"EveningDetectiveServer"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/api/users/{id}": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "EveningDetectiveServer_GetUserById",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "A successful response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/evening_detective_serverGetUserByIdRsp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "An unexpected error response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/rpcStatus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"EveningDetectiveServer"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/users/{id}/role/add": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "EveningDetectiveServer_AddUserRole",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "A successful response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/evening_detective_serverAddUserRoleRsp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "An unexpected error response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/rpcStatus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/EveningDetectiveServerAddUserRoleBody"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"EveningDetectiveServer"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/users/{id}/role/delete": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "EveningDetectiveServer_DeleteUserRole",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "A successful response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/evening_detective_serverDeleteUserRoleRsp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "An unexpected error response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/rpcStatus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/EveningDetectiveServerDeleteUserRoleBody"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"EveningDetectiveServer"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
"EveningDetectiveServerAddUserRoleBody": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"role": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"EveningDetectiveServerDeleteUserRoleBody": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"role": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"evening_detective_serverAddUserRoleRsp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"evening_detective_serverDeleteUserRoleRsp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"evening_detective_serverEchoRsp": {
|
"evening_detective_serverEchoRsp": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -291,6 +432,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"evening_detective_serverGetUserByIdRsp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"$ref": "#/definitions/evening_detective_serverUser"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"evening_detective_serverGetUsersRsp": {
|
"evening_detective_serverGetUsersRsp": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
+41
-1
@@ -3,6 +3,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"evening_detective_server/internal/modules/processor_jwt"
|
"evening_detective_server/internal/modules/processor_jwt"
|
||||||
|
"evening_detective_server/internal/modules/roles"
|
||||||
"evening_detective_server/internal/services/users_service"
|
"evening_detective_server/internal/services/users_service"
|
||||||
proto "evening_detective_server/proto"
|
proto "evening_detective_server/proto"
|
||||||
|
|
||||||
@@ -80,7 +81,7 @@ func (s *server) Refresh(ctx context.Context, req *proto.RefreshReq) (*proto.Ref
|
|||||||
|
|
||||||
func (s *server) GetUsers(ctx context.Context, req *proto.GetUsersReq) (*proto.GetUsersRsp, error) {
|
func (s *server) GetUsers(ctx context.Context, req *proto.GetUsersReq) (*proto.GetUsersRsp, error) {
|
||||||
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
if !claims.HasRole("admin") {
|
if !claims.HasRole(roles.Admin) {
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
}
|
}
|
||||||
users, err := s.usersService.GetUsers(ctx)
|
users, err := s.usersService.GetUsers(ctx)
|
||||||
@@ -99,6 +100,19 @@ func (s *server) GetUsers(ctx context.Context, req *proto.GetUsersReq) (*proto.G
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *server) GetUserById(ctx context.Context, req *proto.GetUserByIdReq) (*proto.GetUserByIdRsp, error) {
|
||||||
|
user, err := s.usersService.GetUserByID(ctx, int(req.Id))
|
||||||
|
if err != nil {
|
||||||
|
return &proto.GetUserByIdRsp{
|
||||||
|
Error: err.Error(),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return &proto.GetUserByIdRsp{
|
||||||
|
User: mapUser(user),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *server) GetMe(ctx context.Context, req *proto.GetMeReq) (*proto.GetMeRsp, error) {
|
func (s *server) GetMe(ctx context.Context, req *proto.GetMeReq) (*proto.GetMeRsp, error) {
|
||||||
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
user, err := s.usersService.GetUserByID(ctx, claims.UserID)
|
user, err := s.usersService.GetUserByID(ctx, claims.UserID)
|
||||||
@@ -112,3 +126,29 @@ func (s *server) GetMe(ctx context.Context, req *proto.GetMeReq) (*proto.GetMeRs
|
|||||||
User: mapUser(user),
|
User: mapUser(user),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *server) AddUserRole(ctx context.Context, req *proto.AddUserRoleReq) (*proto.AddUserRoleRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !claims.HasRole(roles.Admin) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
if err := s.usersService.AddUserRole(ctx, int(req.Id), req.Role); err != nil {
|
||||||
|
return &proto.AddUserRoleRsp{
|
||||||
|
Error: err.Error(),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
return &proto.AddUserRoleRsp{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *server) DeleteUserRole(ctx context.Context, req *proto.DeleteUserRoleReq) (*proto.DeleteUserRoleRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !claims.HasRole(roles.Admin) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
if err := s.usersService.DeleteUserRole(ctx, int(req.Id), req.Role); err != nil {
|
||||||
|
return &proto.DeleteUserRoleRsp{
|
||||||
|
Error: err.Error(),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
return &proto.DeleteUserRoleRsp{}, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package roles
|
||||||
|
|
||||||
|
const (
|
||||||
|
Admin = "admin"
|
||||||
|
Author = "author"
|
||||||
|
Organizer = "organizer"
|
||||||
|
User = "user"
|
||||||
|
)
|
||||||
|
|
||||||
|
var AllRoles = []string{
|
||||||
|
Admin,
|
||||||
|
Author,
|
||||||
|
Organizer,
|
||||||
|
User,
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"evening_detective_server/internal/repos"
|
"evening_detective_server/internal/repos"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/jackc/pgx/v5/pgxpool"
|
"github.com/jackc/pgx/v5/pgxpool"
|
||||||
@@ -175,3 +176,35 @@ func (s *UsersRepo) GetUsers(
|
|||||||
|
|
||||||
return users, nil
|
return users, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *UsersRepo) AddUserRole(
|
||||||
|
ctx context.Context,
|
||||||
|
userId int,
|
||||||
|
role string,
|
||||||
|
) error {
|
||||||
|
_, err := s.pool.Exec(
|
||||||
|
ctx,
|
||||||
|
`UPDATE users
|
||||||
|
SET roles = roles || $1::jsonb
|
||||||
|
WHERE id = $2 AND NOT roles @> $1::jsonb`,
|
||||||
|
fmt.Sprintf(`["%s"]`, role),
|
||||||
|
userId,
|
||||||
|
)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UsersRepo) DeleteUserRole(
|
||||||
|
ctx context.Context,
|
||||||
|
userId int,
|
||||||
|
role string,
|
||||||
|
) error {
|
||||||
|
_, err := s.pool.Exec(
|
||||||
|
ctx,
|
||||||
|
`UPDATE users
|
||||||
|
SET roles = roles - $1::text
|
||||||
|
WHERE id = $2`,
|
||||||
|
role,
|
||||||
|
userId,
|
||||||
|
)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import (
|
|||||||
"evening_detective_server/internal/modules/email_sender"
|
"evening_detective_server/internal/modules/email_sender"
|
||||||
"evening_detective_server/internal/modules/password_generator"
|
"evening_detective_server/internal/modules/password_generator"
|
||||||
"evening_detective_server/internal/modules/processor_jwt"
|
"evening_detective_server/internal/modules/processor_jwt"
|
||||||
|
"evening_detective_server/internal/modules/roles"
|
||||||
"evening_detective_server/internal/repos"
|
"evening_detective_server/internal/repos"
|
||||||
"evening_detective_server/internal/repos/refresh_tokens_repo"
|
"evening_detective_server/internal/repos/refresh_tokens_repo"
|
||||||
"evening_detective_server/internal/repos/users_repo"
|
"evening_detective_server/internal/repos/users_repo"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
@@ -208,3 +210,25 @@ func (s *UsersService) GetUserByID(
|
|||||||
}
|
}
|
||||||
return user, nil
|
return user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *UsersService) AddUserRole(
|
||||||
|
ctx context.Context,
|
||||||
|
userId int,
|
||||||
|
role string,
|
||||||
|
) error {
|
||||||
|
if !slices.Contains(roles.AllRoles, role) {
|
||||||
|
return fmt.Errorf("role %s not support", role)
|
||||||
|
}
|
||||||
|
return s.usersRepo.AddUserRole(ctx, userId, role)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UsersService) DeleteUserRole(
|
||||||
|
ctx context.Context,
|
||||||
|
userId int,
|
||||||
|
role string,
|
||||||
|
) error {
|
||||||
|
if !slices.Contains(roles.AllRoles, role) {
|
||||||
|
return fmt.Errorf("role %s not support", role)
|
||||||
|
}
|
||||||
|
return s.usersRepo.DeleteUserRole(ctx, userId, role)
|
||||||
|
}
|
||||||
|
|||||||
+357
-38
@@ -756,6 +756,102 @@ func (x *User) GetCreatedAt() *timestamppb.Timestamp {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetUserByIdReq struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdReq) Reset() {
|
||||||
|
*x = GetUserByIdReq{}
|
||||||
|
mi := &file_main_proto_msgTypes[15]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetUserByIdReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetUserByIdReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[15]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetUserByIdReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetUserByIdReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{15}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdReq) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetUserByIdRsp struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
|
||||||
|
User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdRsp) Reset() {
|
||||||
|
*x = GetUserByIdRsp{}
|
||||||
|
mi := &file_main_proto_msgTypes[16]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdRsp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetUserByIdRsp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetUserByIdRsp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[16]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetUserByIdRsp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetUserByIdRsp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{16}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdRsp) GetError() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Error
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetUserByIdRsp) GetUser() *User {
|
||||||
|
if x != nil {
|
||||||
|
return x.User
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type GetMeReq struct {
|
type GetMeReq struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
@@ -764,7 +860,7 @@ type GetMeReq struct {
|
|||||||
|
|
||||||
func (x *GetMeReq) Reset() {
|
func (x *GetMeReq) Reset() {
|
||||||
*x = GetMeReq{}
|
*x = GetMeReq{}
|
||||||
mi := &file_main_proto_msgTypes[15]
|
mi := &file_main_proto_msgTypes[17]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -776,7 +872,7 @@ func (x *GetMeReq) String() string {
|
|||||||
func (*GetMeReq) ProtoMessage() {}
|
func (*GetMeReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetMeReq) ProtoReflect() protoreflect.Message {
|
func (x *GetMeReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_main_proto_msgTypes[15]
|
mi := &file_main_proto_msgTypes[17]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -789,7 +885,7 @@ func (x *GetMeReq) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetMeReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetMeReq.ProtoReflect.Descriptor instead.
|
||||||
func (*GetMeReq) Descriptor() ([]byte, []int) {
|
func (*GetMeReq) Descriptor() ([]byte, []int) {
|
||||||
return file_main_proto_rawDescGZIP(), []int{15}
|
return file_main_proto_rawDescGZIP(), []int{17}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetMeRsp struct {
|
type GetMeRsp struct {
|
||||||
@@ -802,7 +898,7 @@ type GetMeRsp struct {
|
|||||||
|
|
||||||
func (x *GetMeRsp) Reset() {
|
func (x *GetMeRsp) Reset() {
|
||||||
*x = GetMeRsp{}
|
*x = GetMeRsp{}
|
||||||
mi := &file_main_proto_msgTypes[16]
|
mi := &file_main_proto_msgTypes[18]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -814,7 +910,7 @@ func (x *GetMeRsp) String() string {
|
|||||||
func (*GetMeRsp) ProtoMessage() {}
|
func (*GetMeRsp) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetMeRsp) ProtoReflect() protoreflect.Message {
|
func (x *GetMeRsp) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_main_proto_msgTypes[16]
|
mi := &file_main_proto_msgTypes[18]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -827,7 +923,7 @@ func (x *GetMeRsp) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetMeRsp.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetMeRsp.ProtoReflect.Descriptor instead.
|
||||||
func (*GetMeRsp) Descriptor() ([]byte, []int) {
|
func (*GetMeRsp) Descriptor() ([]byte, []int) {
|
||||||
return file_main_proto_rawDescGZIP(), []int{16}
|
return file_main_proto_rawDescGZIP(), []int{18}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetMeRsp) GetError() string {
|
func (x *GetMeRsp) GetError() string {
|
||||||
@@ -844,6 +940,198 @@ func (x *GetMeRsp) GetUser() *User {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AddUserRoleReq struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleReq) Reset() {
|
||||||
|
*x = AddUserRoleReq{}
|
||||||
|
mi := &file_main_proto_msgTypes[19]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*AddUserRoleReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *AddUserRoleReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[19]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use AddUserRoleReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*AddUserRoleReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{19}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleReq) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleReq) GetRole() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Role
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type AddUserRoleRsp struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleRsp) Reset() {
|
||||||
|
*x = AddUserRoleRsp{}
|
||||||
|
mi := &file_main_proto_msgTypes[20]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleRsp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*AddUserRoleRsp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *AddUserRoleRsp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[20]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use AddUserRoleRsp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*AddUserRoleRsp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{20}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AddUserRoleRsp) GetError() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Error
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteUserRoleReq struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleReq) Reset() {
|
||||||
|
*x = DeleteUserRoleReq{}
|
||||||
|
mi := &file_main_proto_msgTypes[21]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeleteUserRoleReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[21]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DeleteUserRoleReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeleteUserRoleReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{21}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleReq) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleReq) GetRole() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Role
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteUserRoleRsp struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleRsp) Reset() {
|
||||||
|
*x = DeleteUserRoleRsp{}
|
||||||
|
mi := &file_main_proto_msgTypes[22]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleRsp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeleteUserRoleRsp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleRsp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_main_proto_msgTypes[22]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DeleteUserRoleRsp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeleteUserRoleRsp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_main_proto_rawDescGZIP(), []int{22}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteUserRoleRsp) GetError() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Error
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_main_proto protoreflect.FileDescriptor
|
var File_main_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
const file_main_proto_rawDesc = "" +
|
const file_main_proto_rawDesc = "" +
|
||||||
@@ -891,12 +1179,27 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"\x05roles\x18\x04 \x03(\tR\x05roles\x12\x1b\n" +
|
"\x05roles\x18\x04 \x03(\tR\x05roles\x12\x1b\n" +
|
||||||
"\tis_active\x18\x05 \x01(\bR\bisActive\x129\n" +
|
"\tis_active\x18\x05 \x01(\bR\bisActive\x129\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\"\n" +
|
"created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\" \n" +
|
||||||
|
"\x0eGetUserByIdReq\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x05R\x02id\"`\n" +
|
||||||
|
"\x0eGetUserByIdRsp\x12\x14\n" +
|
||||||
|
"\x05error\x18\x01 \x01(\tR\x05error\x128\n" +
|
||||||
|
"\x04user\x18\x02 \x01(\v2$.crabs.evening_detective_server.UserR\x04user\"\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\bGetMeReq\"Z\n" +
|
"\bGetMeReq\"Z\n" +
|
||||||
"\bGetMeRsp\x12\x14\n" +
|
"\bGetMeRsp\x12\x14\n" +
|
||||||
"\x05error\x18\x01 \x01(\tR\x05error\x128\n" +
|
"\x05error\x18\x01 \x01(\tR\x05error\x128\n" +
|
||||||
"\x04user\x18\x02 \x01(\v2$.crabs.evening_detective_server.UserR\x04user2\xa4\b\n" +
|
"\x04user\x18\x02 \x01(\v2$.crabs.evening_detective_server.UserR\x04user\"4\n" +
|
||||||
|
"\x0eAddUserRoleReq\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" +
|
||||||
|
"\x04role\x18\x02 \x01(\tR\x04role\"&\n" +
|
||||||
|
"\x0eAddUserRoleRsp\x12\x14\n" +
|
||||||
|
"\x05error\x18\x01 \x01(\tR\x05error\"7\n" +
|
||||||
|
"\x11DeleteUserRoleReq\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" +
|
||||||
|
"\x04role\x18\x02 \x01(\tR\x04role\")\n" +
|
||||||
|
"\x11DeleteUserRoleRsp\x12\x14\n" +
|
||||||
|
"\x05error\x18\x01 \x01(\tR\x05error2\xe3\v\n" +
|
||||||
"\x16EveningDetectiveServer\x12v\n" +
|
"\x16EveningDetectiveServer\x12v\n" +
|
||||||
"\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"\x1c\x92A\bb\x06\n" +
|
"\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"\x1c\x92A\bb\x06\n" +
|
||||||
"\x04\n" +
|
"\x04\n" +
|
||||||
@@ -918,8 +1221,11 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"\x04\n" +
|
"\x04\n" +
|
||||||
"\x00\x12\x00\x82\xd3\xe4\x93\x02\x11:\x01*\"\f/api/refresh\x12x\n" +
|
"\x00\x12\x00\x82\xd3\xe4\x93\x02\x11:\x01*\"\f/api/refresh\x12x\n" +
|
||||||
"\bGetUsers\x12+.crabs.evening_detective_server.GetUsersReq\x1a+.crabs.evening_detective_server.GetUsersRsp\"\x12\x82\xd3\xe4\x93\x02\f\x12\n" +
|
"\bGetUsers\x12+.crabs.evening_detective_server.GetUsersReq\x1a+.crabs.evening_detective_server.GetUsersRsp\"\x12\x82\xd3\xe4\x93\x02\f\x12\n" +
|
||||||
"/api/users\x12l\n" +
|
"/api/users\x12\x86\x01\n" +
|
||||||
"\x05GetMe\x12(.crabs.evening_detective_server.GetMeReq\x1a(.crabs.evening_detective_server.GetMeRsp\"\x0f\x82\xd3\xe4\x93\x02\t\x12\a/api/meB\xd7\x01\x92A\xc8\x01\x12U\n" +
|
"\vGetUserById\x12..crabs.evening_detective_server.GetUserByIdReq\x1a..crabs.evening_detective_server.GetUserByIdRsp\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/api/users/{id}\x12l\n" +
|
||||||
|
"\x05GetMe\x12(.crabs.evening_detective_server.GetMeReq\x1a(.crabs.evening_detective_server.GetMeRsp\"\x0f\x82\xd3\xe4\x93\x02\t\x12\a/api/me\x12\x92\x01\n" +
|
||||||
|
"\vAddUserRole\x12..crabs.evening_detective_server.AddUserRoleReq\x1a..crabs.evening_detective_server.AddUserRoleRsp\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/api/users/{id}/role/add\x12\x9e\x01\n" +
|
||||||
|
"\x0eDeleteUserRole\x121.crabs.evening_detective_server.DeleteUserRoleReq\x1a1.crabs.evening_detective_server.DeleteUserRoleRsp\"&\x82\xd3\xe4\x93\x02 :\x01*\"\x1b/api/users/{id}/role/deleteB\xd7\x01\x92A\xc8\x01\x12U\n" +
|
||||||
"KДокументация сервиса \"Вечерний детектив\"2\x06v0.1.0Z]\n" +
|
"KДокументация сервиса \"Вечерний детектив\"2\x06v0.1.0Z]\n" +
|
||||||
"[\n" +
|
"[\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
@@ -940,7 +1246,7 @@ func file_main_proto_rawDescGZIP() []byte {
|
|||||||
return file_main_proto_rawDescData
|
return file_main_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
|
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
|
||||||
var file_main_proto_goTypes = []any{
|
var file_main_proto_goTypes = []any{
|
||||||
(*PingReq)(nil), // 0: crabs.evening_detective_server.PingReq
|
(*PingReq)(nil), // 0: crabs.evening_detective_server.PingReq
|
||||||
(*PingRsp)(nil), // 1: crabs.evening_detective_server.PingRsp
|
(*PingRsp)(nil), // 1: crabs.evening_detective_server.PingRsp
|
||||||
@@ -957,35 +1263,48 @@ var file_main_proto_goTypes = []any{
|
|||||||
(*GetUsersReq)(nil), // 12: crabs.evening_detective_server.GetUsersReq
|
(*GetUsersReq)(nil), // 12: crabs.evening_detective_server.GetUsersReq
|
||||||
(*GetUsersRsp)(nil), // 13: crabs.evening_detective_server.GetUsersRsp
|
(*GetUsersRsp)(nil), // 13: crabs.evening_detective_server.GetUsersRsp
|
||||||
(*User)(nil), // 14: crabs.evening_detective_server.User
|
(*User)(nil), // 14: crabs.evening_detective_server.User
|
||||||
(*GetMeReq)(nil), // 15: crabs.evening_detective_server.GetMeReq
|
(*GetUserByIdReq)(nil), // 15: crabs.evening_detective_server.GetUserByIdReq
|
||||||
(*GetMeRsp)(nil), // 16: crabs.evening_detective_server.GetMeRsp
|
(*GetUserByIdRsp)(nil), // 16: crabs.evening_detective_server.GetUserByIdRsp
|
||||||
(*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
|
(*GetMeReq)(nil), // 17: crabs.evening_detective_server.GetMeReq
|
||||||
|
(*GetMeRsp)(nil), // 18: crabs.evening_detective_server.GetMeRsp
|
||||||
|
(*AddUserRoleReq)(nil), // 19: crabs.evening_detective_server.AddUserRoleReq
|
||||||
|
(*AddUserRoleRsp)(nil), // 20: crabs.evening_detective_server.AddUserRoleRsp
|
||||||
|
(*DeleteUserRoleReq)(nil), // 21: crabs.evening_detective_server.DeleteUserRoleReq
|
||||||
|
(*DeleteUserRoleRsp)(nil), // 22: crabs.evening_detective_server.DeleteUserRoleRsp
|
||||||
|
(*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
|
||||||
}
|
}
|
||||||
var file_main_proto_depIdxs = []int32{
|
var file_main_proto_depIdxs = []int32{
|
||||||
14, // 0: crabs.evening_detective_server.GetUsersRsp.users:type_name -> crabs.evening_detective_server.User
|
14, // 0: crabs.evening_detective_server.GetUsersRsp.users:type_name -> crabs.evening_detective_server.User
|
||||||
17, // 1: crabs.evening_detective_server.User.created_at:type_name -> google.protobuf.Timestamp
|
23, // 1: crabs.evening_detective_server.User.created_at:type_name -> google.protobuf.Timestamp
|
||||||
14, // 2: crabs.evening_detective_server.GetMeRsp.user:type_name -> crabs.evening_detective_server.User
|
14, // 2: crabs.evening_detective_server.GetUserByIdRsp.user:type_name -> crabs.evening_detective_server.User
|
||||||
0, // 3: crabs.evening_detective_server.EveningDetectiveServer.Ping:input_type -> crabs.evening_detective_server.PingReq
|
14, // 3: crabs.evening_detective_server.GetMeRsp.user:type_name -> crabs.evening_detective_server.User
|
||||||
2, // 4: crabs.evening_detective_server.EveningDetectiveServer.Echo:input_type -> crabs.evening_detective_server.EchoReq
|
0, // 4: crabs.evening_detective_server.EveningDetectiveServer.Ping:input_type -> crabs.evening_detective_server.PingReq
|
||||||
4, // 5: crabs.evening_detective_server.EveningDetectiveServer.Signup:input_type -> crabs.evening_detective_server.SignupReq
|
2, // 5: crabs.evening_detective_server.EveningDetectiveServer.Echo:input_type -> crabs.evening_detective_server.EchoReq
|
||||||
6, // 6: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:input_type -> crabs.evening_detective_server.RefreshPasswordReq
|
4, // 6: crabs.evening_detective_server.EveningDetectiveServer.Signup:input_type -> crabs.evening_detective_server.SignupReq
|
||||||
8, // 7: crabs.evening_detective_server.EveningDetectiveServer.Login:input_type -> crabs.evening_detective_server.LoginReq
|
6, // 7: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:input_type -> crabs.evening_detective_server.RefreshPasswordReq
|
||||||
10, // 8: crabs.evening_detective_server.EveningDetectiveServer.Refresh:input_type -> crabs.evening_detective_server.RefreshReq
|
8, // 8: crabs.evening_detective_server.EveningDetectiveServer.Login:input_type -> crabs.evening_detective_server.LoginReq
|
||||||
12, // 9: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:input_type -> crabs.evening_detective_server.GetUsersReq
|
10, // 9: crabs.evening_detective_server.EveningDetectiveServer.Refresh:input_type -> crabs.evening_detective_server.RefreshReq
|
||||||
15, // 10: crabs.evening_detective_server.EveningDetectiveServer.GetMe:input_type -> crabs.evening_detective_server.GetMeReq
|
12, // 10: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:input_type -> crabs.evening_detective_server.GetUsersReq
|
||||||
1, // 11: crabs.evening_detective_server.EveningDetectiveServer.Ping:output_type -> crabs.evening_detective_server.PingRsp
|
15, // 11: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:input_type -> crabs.evening_detective_server.GetUserByIdReq
|
||||||
3, // 12: crabs.evening_detective_server.EveningDetectiveServer.Echo:output_type -> crabs.evening_detective_server.EchoRsp
|
17, // 12: crabs.evening_detective_server.EveningDetectiveServer.GetMe:input_type -> crabs.evening_detective_server.GetMeReq
|
||||||
5, // 13: crabs.evening_detective_server.EveningDetectiveServer.Signup:output_type -> crabs.evening_detective_server.SignupRsp
|
19, // 13: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:input_type -> crabs.evening_detective_server.AddUserRoleReq
|
||||||
7, // 14: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:output_type -> crabs.evening_detective_server.RefreshPasswordRsp
|
21, // 14: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:input_type -> crabs.evening_detective_server.DeleteUserRoleReq
|
||||||
9, // 15: crabs.evening_detective_server.EveningDetectiveServer.Login:output_type -> crabs.evening_detective_server.LoginRsp
|
1, // 15: crabs.evening_detective_server.EveningDetectiveServer.Ping:output_type -> crabs.evening_detective_server.PingRsp
|
||||||
11, // 16: crabs.evening_detective_server.EveningDetectiveServer.Refresh:output_type -> crabs.evening_detective_server.RefreshRsp
|
3, // 16: crabs.evening_detective_server.EveningDetectiveServer.Echo:output_type -> crabs.evening_detective_server.EchoRsp
|
||||||
13, // 17: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:output_type -> crabs.evening_detective_server.GetUsersRsp
|
5, // 17: crabs.evening_detective_server.EveningDetectiveServer.Signup:output_type -> crabs.evening_detective_server.SignupRsp
|
||||||
16, // 18: crabs.evening_detective_server.EveningDetectiveServer.GetMe:output_type -> crabs.evening_detective_server.GetMeRsp
|
7, // 18: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:output_type -> crabs.evening_detective_server.RefreshPasswordRsp
|
||||||
11, // [11:19] is the sub-list for method output_type
|
9, // 19: crabs.evening_detective_server.EveningDetectiveServer.Login:output_type -> crabs.evening_detective_server.LoginRsp
|
||||||
3, // [3:11] is the sub-list for method input_type
|
11, // 20: crabs.evening_detective_server.EveningDetectiveServer.Refresh:output_type -> crabs.evening_detective_server.RefreshRsp
|
||||||
3, // [3:3] is the sub-list for extension type_name
|
13, // 21: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:output_type -> crabs.evening_detective_server.GetUsersRsp
|
||||||
3, // [3:3] is the sub-list for extension extendee
|
16, // 22: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:output_type -> crabs.evening_detective_server.GetUserByIdRsp
|
||||||
0, // [0:3] is the sub-list for field type_name
|
18, // 23: crabs.evening_detective_server.EveningDetectiveServer.GetMe:output_type -> crabs.evening_detective_server.GetMeRsp
|
||||||
|
20, // 24: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:output_type -> crabs.evening_detective_server.AddUserRoleRsp
|
||||||
|
22, // 25: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:output_type -> crabs.evening_detective_server.DeleteUserRoleRsp
|
||||||
|
15, // [15:26] is the sub-list for method output_type
|
||||||
|
4, // [4:15] is the sub-list for method input_type
|
||||||
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
|
0, // [0:4] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_main_proto_init() }
|
func init() { file_main_proto_init() }
|
||||||
@@ -999,7 +1318,7 @@ func file_main_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_main_proto_rawDesc), len(file_main_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_main_proto_rawDesc), len(file_main_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 17,
|
NumMessages: 23,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -220,6 +220,45 @@ func local_request_EveningDetectiveServer_GetUsers_0(ctx context.Context, marsha
|
|||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func request_EveningDetectiveServer_GetUserById_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq GetUserByIdReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := client.GetUserById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_EveningDetectiveServer_GetUserById_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq GetUserByIdReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := server.GetUserById(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
func request_EveningDetectiveServer_GetMe_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_EveningDetectiveServer_GetMe_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq GetMeReq
|
protoReq GetMeReq
|
||||||
@@ -241,6 +280,96 @@ func local_request_EveningDetectiveServer_GetMe_0(ctx context.Context, marshaler
|
|||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func request_EveningDetectiveServer_AddUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq AddUserRoleReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := client.AddUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_EveningDetectiveServer_AddUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq AddUserRoleReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := server.AddUserRole(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func request_EveningDetectiveServer_DeleteUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq DeleteUserRoleReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := client.DeleteUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_EveningDetectiveServer_DeleteUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq DeleteUserRoleReq
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
val, ok := pathParams["id"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||||
|
}
|
||||||
|
protoReq.Id, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
|
}
|
||||||
|
msg, err := server.DeleteUserRole(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterEveningDetectiveServerHandlerServer registers the http handlers for service EveningDetectiveServer to "mux".
|
// RegisterEveningDetectiveServerHandlerServer registers the http handlers for service EveningDetectiveServer to "mux".
|
||||||
// UnaryRPC :call EveningDetectiveServerServer directly.
|
// UnaryRPC :call EveningDetectiveServerServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
@@ -387,6 +516,26 @@ func RegisterEveningDetectiveServerHandlerServer(ctx context.Context, mux *runti
|
|||||||
}
|
}
|
||||||
forward_EveningDetectiveServer_GetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_EveningDetectiveServer_GetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetUserById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetUserById", runtime.WithHTTPPathPattern("/api/users/{id}"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_EveningDetectiveServer_GetUserById_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_GetUserById_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetMe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetMe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -407,6 +556,46 @@ func RegisterEveningDetectiveServerHandlerServer(ctx context.Context, mux *runti
|
|||||||
}
|
}
|
||||||
forward_EveningDetectiveServer_GetMe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_EveningDetectiveServer_GetMe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/AddUserRole", runtime.WithHTTPPathPattern("/api/users/{id}/role/add"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_EveningDetectiveServer_AddUserRole_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_AddUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
|
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_DeleteUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/DeleteUserRole", runtime.WithHTTPPathPattern("/api/users/{id}/role/delete"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_EveningDetectiveServer_DeleteUserRole_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_DeleteUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -566,6 +755,23 @@ func RegisterEveningDetectiveServerHandlerClient(ctx context.Context, mux *runti
|
|||||||
}
|
}
|
||||||
forward_EveningDetectiveServer_GetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_EveningDetectiveServer_GetUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetUserById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetUserById", runtime.WithHTTPPathPattern("/api/users/{id}"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_EveningDetectiveServer_GetUserById_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_GetUserById_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetMe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetMe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -583,6 +789,40 @@ func RegisterEveningDetectiveServerHandlerClient(ctx context.Context, mux *runti
|
|||||||
}
|
}
|
||||||
forward_EveningDetectiveServer_GetMe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_EveningDetectiveServer_GetMe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/AddUserRole", runtime.WithHTTPPathPattern("/api/users/{id}/role/add"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_EveningDetectiveServer_AddUserRole_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_AddUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
|
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_DeleteUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/DeleteUserRole", runtime.WithHTTPPathPattern("/api/users/{id}/role/delete"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_EveningDetectiveServer_DeleteUserRole_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forward_EveningDetectiveServer_DeleteUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,7 +834,10 @@ var (
|
|||||||
pattern_EveningDetectiveServer_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "login"}, ""))
|
pattern_EveningDetectiveServer_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "login"}, ""))
|
||||||
pattern_EveningDetectiveServer_Refresh_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "refresh"}, ""))
|
pattern_EveningDetectiveServer_Refresh_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "refresh"}, ""))
|
||||||
pattern_EveningDetectiveServer_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "users"}, ""))
|
pattern_EveningDetectiveServer_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "users"}, ""))
|
||||||
|
pattern_EveningDetectiveServer_GetUserById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "users", "id"}, ""))
|
||||||
pattern_EveningDetectiveServer_GetMe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "me"}, ""))
|
pattern_EveningDetectiveServer_GetMe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "me"}, ""))
|
||||||
|
pattern_EveningDetectiveServer_AddUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"api", "users", "id", "role", "add"}, ""))
|
||||||
|
pattern_EveningDetectiveServer_DeleteUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"api", "users", "id", "role", "delete"}, ""))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -605,5 +848,8 @@ var (
|
|||||||
forward_EveningDetectiveServer_Login_0 = runtime.ForwardResponseMessage
|
forward_EveningDetectiveServer_Login_0 = runtime.ForwardResponseMessage
|
||||||
forward_EveningDetectiveServer_Refresh_0 = runtime.ForwardResponseMessage
|
forward_EveningDetectiveServer_Refresh_0 = runtime.ForwardResponseMessage
|
||||||
forward_EveningDetectiveServer_GetUsers_0 = runtime.ForwardResponseMessage
|
forward_EveningDetectiveServer_GetUsers_0 = runtime.ForwardResponseMessage
|
||||||
|
forward_EveningDetectiveServer_GetUserById_0 = runtime.ForwardResponseMessage
|
||||||
forward_EveningDetectiveServer_GetMe_0 = runtime.ForwardResponseMessage
|
forward_EveningDetectiveServer_GetMe_0 = runtime.ForwardResponseMessage
|
||||||
|
forward_EveningDetectiveServer_AddUserRole_0 = runtime.ForwardResponseMessage
|
||||||
|
forward_EveningDetectiveServer_DeleteUserRole_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,10 @@ const (
|
|||||||
EveningDetectiveServer_Login_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Login"
|
EveningDetectiveServer_Login_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Login"
|
||||||
EveningDetectiveServer_Refresh_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Refresh"
|
EveningDetectiveServer_Refresh_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Refresh"
|
||||||
EveningDetectiveServer_GetUsers_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetUsers"
|
EveningDetectiveServer_GetUsers_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetUsers"
|
||||||
|
EveningDetectiveServer_GetUserById_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetUserById"
|
||||||
EveningDetectiveServer_GetMe_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetMe"
|
EveningDetectiveServer_GetMe_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetMe"
|
||||||
|
EveningDetectiveServer_AddUserRole_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/AddUserRole"
|
||||||
|
EveningDetectiveServer_DeleteUserRole_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DeleteUserRole"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EveningDetectiveServerClient is the client API for EveningDetectiveServer service.
|
// EveningDetectiveServerClient is the client API for EveningDetectiveServer service.
|
||||||
@@ -40,7 +43,10 @@ type EveningDetectiveServerClient interface {
|
|||||||
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginRsp, error)
|
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginRsp, error)
|
||||||
Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshRsp, error)
|
Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshRsp, error)
|
||||||
GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersRsp, error)
|
GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersRsp, error)
|
||||||
|
GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdRsp, error)
|
||||||
GetMe(ctx context.Context, in *GetMeReq, opts ...grpc.CallOption) (*GetMeRsp, error)
|
GetMe(ctx context.Context, in *GetMeReq, opts ...grpc.CallOption) (*GetMeRsp, error)
|
||||||
|
AddUserRole(ctx context.Context, in *AddUserRoleReq, opts ...grpc.CallOption) (*AddUserRoleRsp, error)
|
||||||
|
DeleteUserRole(ctx context.Context, in *DeleteUserRoleReq, opts ...grpc.CallOption) (*DeleteUserRoleRsp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type eveningDetectiveServerClient struct {
|
type eveningDetectiveServerClient struct {
|
||||||
@@ -121,6 +127,16 @@ func (c *eveningDetectiveServerClient) GetUsers(ctx context.Context, in *GetUser
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *eveningDetectiveServerClient) GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdRsp, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(GetUserByIdRsp)
|
||||||
|
err := c.cc.Invoke(ctx, EveningDetectiveServer_GetUserById_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *eveningDetectiveServerClient) GetMe(ctx context.Context, in *GetMeReq, opts ...grpc.CallOption) (*GetMeRsp, error) {
|
func (c *eveningDetectiveServerClient) GetMe(ctx context.Context, in *GetMeReq, opts ...grpc.CallOption) (*GetMeRsp, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetMeRsp)
|
out := new(GetMeRsp)
|
||||||
@@ -131,6 +147,26 @@ func (c *eveningDetectiveServerClient) GetMe(ctx context.Context, in *GetMeReq,
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *eveningDetectiveServerClient) AddUserRole(ctx context.Context, in *AddUserRoleReq, opts ...grpc.CallOption) (*AddUserRoleRsp, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(AddUserRoleRsp)
|
||||||
|
err := c.cc.Invoke(ctx, EveningDetectiveServer_AddUserRole_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *eveningDetectiveServerClient) DeleteUserRole(ctx context.Context, in *DeleteUserRoleReq, opts ...grpc.CallOption) (*DeleteUserRoleRsp, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(DeleteUserRoleRsp)
|
||||||
|
err := c.cc.Invoke(ctx, EveningDetectiveServer_DeleteUserRole_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// EveningDetectiveServerServer is the server API for EveningDetectiveServer service.
|
// EveningDetectiveServerServer is the server API for EveningDetectiveServer service.
|
||||||
// All implementations must embed UnimplementedEveningDetectiveServerServer
|
// All implementations must embed UnimplementedEveningDetectiveServerServer
|
||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
@@ -142,7 +178,10 @@ type EveningDetectiveServerServer interface {
|
|||||||
Login(context.Context, *LoginReq) (*LoginRsp, error)
|
Login(context.Context, *LoginReq) (*LoginRsp, error)
|
||||||
Refresh(context.Context, *RefreshReq) (*RefreshRsp, error)
|
Refresh(context.Context, *RefreshReq) (*RefreshRsp, error)
|
||||||
GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error)
|
GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error)
|
||||||
|
GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdRsp, error)
|
||||||
GetMe(context.Context, *GetMeReq) (*GetMeRsp, error)
|
GetMe(context.Context, *GetMeReq) (*GetMeRsp, error)
|
||||||
|
AddUserRole(context.Context, *AddUserRoleReq) (*AddUserRoleRsp, error)
|
||||||
|
DeleteUserRole(context.Context, *DeleteUserRoleReq) (*DeleteUserRoleRsp, error)
|
||||||
mustEmbedUnimplementedEveningDetectiveServerServer()
|
mustEmbedUnimplementedEveningDetectiveServerServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,9 +213,18 @@ func (UnimplementedEveningDetectiveServerServer) Refresh(context.Context, *Refre
|
|||||||
func (UnimplementedEveningDetectiveServerServer) GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error) {
|
func (UnimplementedEveningDetectiveServerServer) GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented")
|
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedEveningDetectiveServerServer) GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdRsp, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetUserById not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedEveningDetectiveServerServer) GetMe(context.Context, *GetMeReq) (*GetMeRsp, error) {
|
func (UnimplementedEveningDetectiveServerServer) GetMe(context.Context, *GetMeReq) (*GetMeRsp, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method GetMe not implemented")
|
return nil, status.Error(codes.Unimplemented, "method GetMe not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedEveningDetectiveServerServer) AddUserRole(context.Context, *AddUserRoleReq) (*AddUserRoleRsp, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method AddUserRole not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedEveningDetectiveServerServer) DeleteUserRole(context.Context, *DeleteUserRoleReq) (*DeleteUserRoleRsp, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method DeleteUserRole not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedEveningDetectiveServerServer) mustEmbedUnimplementedEveningDetectiveServerServer() {
|
func (UnimplementedEveningDetectiveServerServer) mustEmbedUnimplementedEveningDetectiveServerServer() {
|
||||||
}
|
}
|
||||||
func (UnimplementedEveningDetectiveServerServer) testEmbeddedByValue() {}
|
func (UnimplementedEveningDetectiveServerServer) testEmbeddedByValue() {}
|
||||||
@@ -325,6 +373,24 @@ func _EveningDetectiveServer_GetUsers_Handler(srv interface{}, ctx context.Conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _EveningDetectiveServer_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetUserByIdReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(EveningDetectiveServerServer).GetUserById(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: EveningDetectiveServer_GetUserById_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(EveningDetectiveServerServer).GetUserById(ctx, req.(*GetUserByIdReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _EveningDetectiveServer_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EveningDetectiveServer_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetMeReq)
|
in := new(GetMeReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@@ -343,6 +409,42 @@ func _EveningDetectiveServer_GetMe_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _EveningDetectiveServer_AddUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(AddUserRoleReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(EveningDetectiveServerServer).AddUserRole(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: EveningDetectiveServer_AddUserRole_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(EveningDetectiveServerServer).AddUserRole(ctx, req.(*AddUserRoleReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _EveningDetectiveServer_DeleteUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteUserRoleReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(EveningDetectiveServerServer).DeleteUserRole(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: EveningDetectiveServer_DeleteUserRole_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(EveningDetectiveServerServer).DeleteUserRole(ctx, req.(*DeleteUserRoleReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// EveningDetectiveServer_ServiceDesc is the grpc.ServiceDesc for EveningDetectiveServer service.
|
// EveningDetectiveServer_ServiceDesc is the grpc.ServiceDesc for EveningDetectiveServer service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -378,10 +480,22 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetUsers",
|
MethodName: "GetUsers",
|
||||||
Handler: _EveningDetectiveServer_GetUsers_Handler,
|
Handler: _EveningDetectiveServer_GetUsers_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetUserById",
|
||||||
|
Handler: _EveningDetectiveServer_GetUserById_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetMe",
|
MethodName: "GetMe",
|
||||||
Handler: _EveningDetectiveServer_GetMe_Handler,
|
Handler: _EveningDetectiveServer_GetMe_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "AddUserRole",
|
||||||
|
Handler: _EveningDetectiveServer_AddUserRole_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteUserRole",
|
||||||
|
Handler: _EveningDetectiveServer_DeleteUserRole_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "main.proto",
|
Metadata: "main.proto",
|
||||||
|
|||||||
Reference in New Issue
Block a user