更新管理员相关接口
This commit is contained in:
@@ -440,6 +440,43 @@ message Statistics {
|
||||
int32 active_printers = 6;
|
||||
}
|
||||
|
||||
// 创建管理员请求
|
||||
message CreateAdminRequest {
|
||||
string username = 1;
|
||||
string password = 2;
|
||||
string nickname = 3;
|
||||
int32 role = 4; // 1:普通管理员 2:超级管理员
|
||||
}
|
||||
|
||||
// 创建管理员响应
|
||||
message CreateAdminResponse {
|
||||
Admin admin = 1;
|
||||
}
|
||||
|
||||
// 获取管理员列表请求
|
||||
message GetAdminListRequest {
|
||||
int32 page = 1;
|
||||
int32 page_size = 2;
|
||||
}
|
||||
|
||||
// 管理员列表响应
|
||||
message AdminListResponse {
|
||||
repeated Admin admins = 1;
|
||||
int32 total = 2;
|
||||
}
|
||||
|
||||
// 更新管理员请求
|
||||
message UpdateAdminRequest {
|
||||
int32 id = 1;
|
||||
string nickname = 2;
|
||||
int32 role = 3;
|
||||
}
|
||||
|
||||
// 删除管理员请求
|
||||
message DeleteAdminRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
// ============ 服务定义 ============
|
||||
|
||||
service AuthService {
|
||||
@@ -499,4 +536,8 @@ service PayService {
|
||||
service AdminService {
|
||||
rpc Login(AdminLoginRequest) returns (AdminLoginResponse);
|
||||
rpc GetStatistics(GetStatisticsRequest) returns (Statistics);
|
||||
rpc CreateAdmin(CreateAdminRequest) returns (CreateAdminResponse);
|
||||
rpc GetAdminList(GetAdminListRequest) returns (AdminListResponse);
|
||||
rpc UpdateAdmin(UpdateAdminRequest) returns (Admin);
|
||||
rpc DeleteAdmin(DeleteAdminRequest) returns (Empty);
|
||||
}
|
||||
|
||||
@@ -4203,6 +4203,326 @@ func (x *Statistics) GetActivePrinters() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// CreateAdminRequest 创建管理员请求
|
||||
type CreateAdminRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||
Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"`
|
||||
Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) Reset() {
|
||||
*x = CreateAdminRequest{}
|
||||
mi := &file_cloudprint_proto_msgTypes[69]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateAdminRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreateAdminRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[69]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*CreateAdminRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{69}
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) GetNickname() string {
|
||||
if x != nil {
|
||||
return x.Nickname
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateAdminRequest) GetRole() int32 {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// CreateAdminResponse 创建管理员响应
|
||||
type CreateAdminResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Admin *Admin `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateAdminResponse) Reset() {
|
||||
*x = CreateAdminResponse{}
|
||||
mi := &file_cloudprint_proto_msgTypes[70]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateAdminResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateAdminResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CreateAdminResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[70]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*CreateAdminResponse) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{70}
|
||||
}
|
||||
|
||||
func (x *CreateAdminResponse) GetAdmin() *Admin {
|
||||
if x != nil {
|
||||
return x.Admin
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetAdminListRequest 获取管理员列表请求
|
||||
type GetAdminListRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
|
||||
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetAdminListRequest) Reset() {
|
||||
*x = GetAdminListRequest{}
|
||||
mi := &file_cloudprint_proto_msgTypes[71]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAdminListRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAdminListRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetAdminListRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[71]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*GetAdminListRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{71}
|
||||
}
|
||||
|
||||
func (x *GetAdminListRequest) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetAdminListRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// AdminListResponse 管理员列表响应
|
||||
type AdminListResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Admins []*Admin `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"`
|
||||
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AdminListResponse) Reset() {
|
||||
*x = AdminListResponse{}
|
||||
mi := &file_cloudprint_proto_msgTypes[72]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AdminListResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AdminListResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AdminListResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[72]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*AdminListResponse) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{72}
|
||||
}
|
||||
|
||||
func (x *AdminListResponse) GetAdmins() []*Admin {
|
||||
if x != nil {
|
||||
return x.Admins
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AdminListResponse) GetTotal() int32 {
|
||||
if x != nil {
|
||||
return x.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// UpdateAdminRequest 更新管理员请求
|
||||
type UpdateAdminRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
|
||||
Role int32 `protobuf:"varint,3,opt,name=role,proto3" json:"role,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateAdminRequest) Reset() {
|
||||
*x = UpdateAdminRequest{}
|
||||
mi := &file_cloudprint_proto_msgTypes[73]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateAdminRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateAdminRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateAdminRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[73]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateAdminRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{73}
|
||||
}
|
||||
|
||||
func (x *UpdateAdminRequest) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UpdateAdminRequest) GetNickname() string {
|
||||
if x != nil {
|
||||
return x.Nickname
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateAdminRequest) GetRole() int32 {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// DeleteAdminRequest 删除管理员请求
|
||||
type DeleteAdminRequest 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 *DeleteAdminRequest) Reset() {
|
||||
*x = DeleteAdminRequest{}
|
||||
mi := &file_cloudprint_proto_msgTypes[74]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteAdminRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteAdminRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteAdminRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_cloudprint_proto_msgTypes[74]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteAdminRequest) Descriptor() ([]byte, []int) {
|
||||
return file_cloudprint_proto_rawDescGZIP(), []int{74}
|
||||
}
|
||||
|
||||
func (x *DeleteAdminRequest) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_cloudprint_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_cloudprint_proto_rawDesc = "" +
|
||||
|
||||
@@ -1718,6 +1718,10 @@ var PayService_ServiceDesc = grpc.ServiceDesc{
|
||||
const (
|
||||
AdminService_Login_FullMethodName = "/cloudprint.AdminService/Login"
|
||||
AdminService_GetStatistics_FullMethodName = "/cloudprint.AdminService/GetStatistics"
|
||||
AdminService_CreateAdmin_FullMethodName = "/cloudprint.AdminService/CreateAdmin"
|
||||
AdminService_GetAdminList_FullMethodName = "/cloudprint.AdminService/GetAdminList"
|
||||
AdminService_UpdateAdmin_FullMethodName = "/cloudprint.AdminService/UpdateAdmin"
|
||||
AdminService_DeleteAdmin_FullMethodName = "/cloudprint.AdminService/DeleteAdmin"
|
||||
)
|
||||
|
||||
// AdminServiceClient is the client API for AdminService service.
|
||||
@@ -1726,6 +1730,10 @@ const (
|
||||
type AdminServiceClient interface {
|
||||
Login(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*AdminLoginResponse, error)
|
||||
GetStatistics(ctx context.Context, in *GetStatisticsRequest, opts ...grpc.CallOption) (*Statistics, error)
|
||||
CreateAdmin(ctx context.Context, in *CreateAdminRequest, opts ...grpc.CallOption) (*CreateAdminResponse, error)
|
||||
GetAdminList(ctx context.Context, in *GetAdminListRequest, opts ...grpc.CallOption) (*AdminListResponse, error)
|
||||
UpdateAdmin(ctx context.Context, in *UpdateAdminRequest, opts ...grpc.CallOption) (*Admin, error)
|
||||
DeleteAdmin(ctx context.Context, in *DeleteAdminRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
}
|
||||
|
||||
type adminServiceClient struct {
|
||||
@@ -1756,12 +1764,56 @@ func (c *adminServiceClient) GetStatistics(ctx context.Context, in *GetStatistic
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) CreateAdmin(ctx context.Context, in *CreateAdminRequest, opts ...grpc.CallOption) (*CreateAdminResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateAdminResponse)
|
||||
err := c.cc.Invoke(ctx, AdminService_CreateAdmin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) GetAdminList(ctx context.Context, in *GetAdminListRequest, opts ...grpc.CallOption) (*AdminListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AdminListResponse)
|
||||
err := c.cc.Invoke(ctx, AdminService_GetAdminList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) UpdateAdmin(ctx context.Context, in *UpdateAdminRequest, opts ...grpc.CallOption) (*Admin, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Admin)
|
||||
err := c.cc.Invoke(ctx, AdminService_UpdateAdmin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) DeleteAdmin(ctx context.Context, in *DeleteAdminRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, AdminService_DeleteAdmin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AdminServiceServer is the server API for AdminService service.
|
||||
// All implementations must embed UnimplementedAdminServiceServer
|
||||
// for forward compatibility.
|
||||
type AdminServiceServer interface {
|
||||
Login(context.Context, *AdminLoginRequest) (*AdminLoginResponse, error)
|
||||
GetStatistics(context.Context, *GetStatisticsRequest) (*Statistics, error)
|
||||
CreateAdmin(context.Context, *CreateAdminRequest) (*CreateAdminResponse, error)
|
||||
GetAdminList(context.Context, *GetAdminListRequest) (*AdminListResponse, error)
|
||||
UpdateAdmin(context.Context, *UpdateAdminRequest) (*Admin, error)
|
||||
DeleteAdmin(context.Context, *DeleteAdminRequest) (*Empty, error)
|
||||
mustEmbedUnimplementedAdminServiceServer()
|
||||
}
|
||||
|
||||
@@ -1778,6 +1830,18 @@ func (UnimplementedAdminServiceServer) Login(context.Context, *AdminLoginRequest
|
||||
func (UnimplementedAdminServiceServer) GetStatistics(context.Context, *GetStatisticsRequest) (*Statistics, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetStatistics not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) CreateAdmin(context.Context, *CreateAdminRequest) (*CreateAdminResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateAdmin not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) GetAdminList(context.Context, *GetAdminListRequest) (*AdminListResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAdminList not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) UpdateAdmin(context.Context, *UpdateAdminRequest) (*Admin, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateAdmin not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) DeleteAdmin(context.Context, *DeleteAdminRequest) (*Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteAdmin not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
||||
func (UnimplementedAdminServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -1835,6 +1899,78 @@ func _AdminService_GetStatistics_Handler(srv interface{}, ctx context.Context, d
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_CreateAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateAdminRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminServiceServer).CreateAdmin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminService_CreateAdmin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminServiceServer).CreateAdmin(ctx, req.(*CreateAdminRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_GetAdminList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAdminListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminServiceServer).GetAdminList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminService_GetAdminList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminServiceServer).GetAdminList(ctx, req.(*GetAdminListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_UpdateAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateAdminRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminServiceServer).UpdateAdmin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminService_UpdateAdmin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminServiceServer).UpdateAdmin(ctx, req.(*UpdateAdminRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_DeleteAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteAdminRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminServiceServer).DeleteAdmin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminService_DeleteAdmin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminServiceServer).DeleteAdmin(ctx, req.(*DeleteAdminRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -1850,6 +1986,22 @@ var AdminService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetStatistics",
|
||||
Handler: _AdminService_GetStatistics_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateAdmin",
|
||||
Handler: _AdminService_CreateAdmin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAdminList",
|
||||
Handler: _AdminService_GetAdminList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateAdmin",
|
||||
Handler: _AdminService_UpdateAdmin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteAdmin",
|
||||
Handler: _AdminService_DeleteAdmin_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cloudprint.proto",
|
||||
|
||||
Reference in New Issue
Block a user