[系统用户]增加OTP动态密码二次认证

This commit is contained in:
刘祥超
2020-12-24 17:16:37 +08:00
parent 7f41028704
commit 2a2b3bba67
8 changed files with 1008 additions and 134 deletions

View File

@@ -37,6 +37,7 @@ type Admin struct {
IsSuper bool `protobuf:"varint,5,opt,name=isSuper,proto3" json:"isSuper,omitempty"`
CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Modules []*AdminModule `protobuf:"bytes,7,rep,name=Modules,proto3" json:"Modules,omitempty"`
OtpLogin *Login `protobuf:"bytes,8,opt,name=otpLogin,proto3" json:"otpLogin,omitempty"` // OTP认证
}
func (x *Admin) Reset() {
@@ -120,26 +121,37 @@ func (x *Admin) GetModules() []*AdminModule {
return nil
}
func (x *Admin) GetOtpLogin() *Login {
if x != nil {
return x.OtpLogin
}
return nil
}
var File_model_admin_proto protoreflect.FileDescriptor
var file_model_admin_proto_rawDesc = []byte{
0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61,
0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x05, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66,
0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66,
0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70,
0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65,
0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12,
0x29, 0x0a, 0x07, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x52, 0x07, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x1a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x01, 0x0a, 0x05, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a,
0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73,
0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73,
0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73,
0x53, 0x75, 0x70, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x53,
0x75, 0x70, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
0x41, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x07, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x25, 0x0a,
0x08, 0x6f, 0x74, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x08, 0x6f, 0x74, 0x70, 0x4c,
0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -158,14 +170,16 @@ var file_model_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_admin_proto_goTypes = []interface{}{
(*Admin)(nil), // 0: pb.Admin
(*AdminModule)(nil), // 1: pb.AdminModule
(*Login)(nil), // 2: pb.Login
}
var file_model_admin_proto_depIdxs = []int32{
1, // 0: pb.Admin.Modules:type_name -> pb.AdminModule
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
2, // 1: pb.Admin.otpLogin:type_name -> pb.Login
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_model_admin_proto_init() }
@@ -174,6 +188,7 @@ func file_model_admin_proto_init() {
return
}
file_model_admin_module_proto_init()
file_model_login_proto_init()
if !protoimpl.UnsafeEnabled {
file_model_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Admin); i {

View File

@@ -0,0 +1,193 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_login.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Login struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
ParamsJSON []byte `protobuf:"bytes,3,opt,name=paramsJSON,proto3" json:"paramsJSON,omitempty"`
IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"`
AdminId int64 `protobuf:"varint,5,opt,name=adminId,proto3" json:"adminId,omitempty"`
UserId int64 `protobuf:"varint,6,opt,name=userId,proto3" json:"userId,omitempty"`
}
func (x *Login) Reset() {
*x = Login{}
if protoimpl.UnsafeEnabled {
mi := &file_model_login_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Login) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Login) ProtoMessage() {}
func (x *Login) ProtoReflect() protoreflect.Message {
mi := &file_model_login_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Login.ProtoReflect.Descriptor instead.
func (*Login) Descriptor() ([]byte, []int) {
return file_model_login_proto_rawDescGZIP(), []int{0}
}
func (x *Login) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *Login) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Login) GetParamsJSON() []byte {
if x != nil {
return x.ParamsJSON
}
return nil
}
func (x *Login) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *Login) GetAdminId() int64 {
if x != nil {
return x.AdminId
}
return 0
}
func (x *Login) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
var File_model_login_proto protoreflect.FileDescriptor
var file_model_login_proto_rawDesc = []byte{
0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x91, 0x01, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69,
0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a,
0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20,
0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d,
0x69, 0x6e, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69,
0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_login_proto_rawDescOnce sync.Once
file_model_login_proto_rawDescData = file_model_login_proto_rawDesc
)
func file_model_login_proto_rawDescGZIP() []byte {
file_model_login_proto_rawDescOnce.Do(func() {
file_model_login_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_login_proto_rawDescData)
})
return file_model_login_proto_rawDescData
}
var file_model_login_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_login_proto_goTypes = []interface{}{
(*Login)(nil), // 0: pb.Login
}
var file_model_login_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_model_login_proto_init() }
func file_model_login_proto_init() {
if File_model_login_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_login_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Login); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_model_login_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_login_proto_goTypes,
DependencyIndexes: file_model_login_proto_depIdxs,
MessageInfos: file_model_login_proto_msgTypes,
}.Build()
File_model_login_proto = out.File
file_model_login_proto_rawDesc = nil
file_model_login_proto_goTypes = nil
file_model_login_proto_depIdxs = nil
}

View File

@@ -1266,6 +1266,101 @@ func (x *DeleteAdminRequest) GetAdminId() int64 {
return 0
}
// 根据用户名检查是否需要输入OTP
type CheckAdminOTPWithUsernameRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
}
func (x *CheckAdminOTPWithUsernameRequest) Reset() {
*x = CheckAdminOTPWithUsernameRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckAdminOTPWithUsernameRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckAdminOTPWithUsernameRequest) ProtoMessage() {}
func (x *CheckAdminOTPWithUsernameRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckAdminOTPWithUsernameRequest.ProtoReflect.Descriptor instead.
func (*CheckAdminOTPWithUsernameRequest) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{23}
}
func (x *CheckAdminOTPWithUsernameRequest) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
type CheckAdminOTPWithUsernameResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RequireOTP bool `protobuf:"varint,1,opt,name=requireOTP,proto3" json:"requireOTP,omitempty"`
}
func (x *CheckAdminOTPWithUsernameResponse) Reset() {
*x = CheckAdminOTPWithUsernameResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckAdminOTPWithUsernameResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckAdminOTPWithUsernameResponse) ProtoMessage() {}
func (x *CheckAdminOTPWithUsernameResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_proto_msgTypes[24]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckAdminOTPWithUsernameResponse.ProtoReflect.Descriptor instead.
func (*CheckAdminOTPWithUsernameResponse) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{24}
}
func (x *CheckAdminOTPWithUsernameResponse) GetRequireOTP() bool {
if x != nil {
return x.RequireOTP
}
return false
}
var File_service_admin_proto protoreflect.FileDescriptor
var file_service_admin_proto_rawDesc = []byte{
@@ -1384,73 +1479,88 @@ var file_service_admin_proto_rawDesc = []byte{
0x69, 0x6e, 0x73, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d,
0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69,
0x6e, 0x49, 0x64, 0x32, 0x91, 0x08, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c,
0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45,
0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x53, 0x0a, 0x12, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73,
0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69,
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d,
0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a,
0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69,
0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x56,
0x0a, 0x13, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41,
0x6c, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41,
0x6c, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x4f, 0x0a,
0x15, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50,
0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50,
0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x35, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12,
0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6e, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69,
0x6e, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x21, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69,
0x6e, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75,
0x69, 0x72, 0x65, 0x4f, 0x54, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65,
0x71, 0x75, 0x69, 0x72, 0x65, 0x4f, 0x54, 0x50, 0x32, 0xfb, 0x08, 0x0a, 0x0c, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41,
0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65,
0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64,
0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x70, 0x62,
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69,
0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75,
0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c,
0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10,
0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64,
0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d,
0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69,
0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, 0x13, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x41, 0x64,
0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64,
0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62,
0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41,
0x64, 0x6d, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x68, 0x0a, 0x19,
0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74,
0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68,
0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4f,
0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -1465,40 +1575,42 @@ func file_service_admin_proto_rawDescGZIP() []byte {
return file_service_admin_proto_rawDescData
}
var file_service_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_service_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 25)
var file_service_admin_proto_goTypes = []interface{}{
(*LoginAdminRequest)(nil), // 0: pb.LoginAdminRequest
(*LoginAdminResponse)(nil), // 1: pb.LoginAdminResponse
(*CheckAdminExistsRequest)(nil), // 2: pb.CheckAdminExistsRequest
(*CheckAdminExistsResponse)(nil), // 3: pb.CheckAdminExistsResponse
(*CheckAdminUsernameRequest)(nil), // 4: pb.CheckAdminUsernameRequest
(*CheckAdminUsernameResponse)(nil), // 5: pb.CheckAdminUsernameResponse
(*FindAdminFullnameRequest)(nil), // 6: pb.FindAdminFullnameRequest
(*FindAdminFullnameResponse)(nil), // 7: pb.FindAdminFullnameResponse
(*FindEnabledAdminRequest)(nil), // 8: pb.FindEnabledAdminRequest
(*FindEnabledAdminResponse)(nil), // 9: pb.FindEnabledAdminResponse
(*CreateOrUpdateAdminRequest)(nil), // 10: pb.CreateOrUpdateAdminRequest
(*CreateOrUpdateAdminResponse)(nil), // 11: pb.CreateOrUpdateAdminResponse
(*UpdateAdminInfoRequest)(nil), // 12: pb.UpdateAdminInfoRequest
(*UpdateAdminLoginRequest)(nil), // 13: pb.UpdateAdminLoginRequest
(*FindAllAdminModulesRequest)(nil), // 14: pb.FindAllAdminModulesRequest
(*FindAllAdminModulesResponse)(nil), // 15: pb.FindAllAdminModulesResponse
(*CreateAdminRequest)(nil), // 16: pb.CreateAdminRequest
(*CreateAdminResponse)(nil), // 17: pb.CreateAdminResponse
(*UpdateAdminRequest)(nil), // 18: pb.UpdateAdminRequest
(*CountAllEnabledAdminsRequest)(nil), // 19: pb.CountAllEnabledAdminsRequest
(*ListEnabledAdminsRequest)(nil), // 20: pb.ListEnabledAdminsRequest
(*ListEnabledAdminsResponse)(nil), // 21: pb.ListEnabledAdminsResponse
(*DeleteAdminRequest)(nil), // 22: pb.DeleteAdminRequest
(*Admin)(nil), // 23: pb.Admin
(*AdminModuleList)(nil), // 24: pb.AdminModuleList
(*RPCSuccess)(nil), // 25: pb.RPCSuccess
(*RPCCountResponse)(nil), // 26: pb.RPCCountResponse
(*LoginAdminRequest)(nil), // 0: pb.LoginAdminRequest
(*LoginAdminResponse)(nil), // 1: pb.LoginAdminResponse
(*CheckAdminExistsRequest)(nil), // 2: pb.CheckAdminExistsRequest
(*CheckAdminExistsResponse)(nil), // 3: pb.CheckAdminExistsResponse
(*CheckAdminUsernameRequest)(nil), // 4: pb.CheckAdminUsernameRequest
(*CheckAdminUsernameResponse)(nil), // 5: pb.CheckAdminUsernameResponse
(*FindAdminFullnameRequest)(nil), // 6: pb.FindAdminFullnameRequest
(*FindAdminFullnameResponse)(nil), // 7: pb.FindAdminFullnameResponse
(*FindEnabledAdminRequest)(nil), // 8: pb.FindEnabledAdminRequest
(*FindEnabledAdminResponse)(nil), // 9: pb.FindEnabledAdminResponse
(*CreateOrUpdateAdminRequest)(nil), // 10: pb.CreateOrUpdateAdminRequest
(*CreateOrUpdateAdminResponse)(nil), // 11: pb.CreateOrUpdateAdminResponse
(*UpdateAdminInfoRequest)(nil), // 12: pb.UpdateAdminInfoRequest
(*UpdateAdminLoginRequest)(nil), // 13: pb.UpdateAdminLoginRequest
(*FindAllAdminModulesRequest)(nil), // 14: pb.FindAllAdminModulesRequest
(*FindAllAdminModulesResponse)(nil), // 15: pb.FindAllAdminModulesResponse
(*CreateAdminRequest)(nil), // 16: pb.CreateAdminRequest
(*CreateAdminResponse)(nil), // 17: pb.CreateAdminResponse
(*UpdateAdminRequest)(nil), // 18: pb.UpdateAdminRequest
(*CountAllEnabledAdminsRequest)(nil), // 19: pb.CountAllEnabledAdminsRequest
(*ListEnabledAdminsRequest)(nil), // 20: pb.ListEnabledAdminsRequest
(*ListEnabledAdminsResponse)(nil), // 21: pb.ListEnabledAdminsResponse
(*DeleteAdminRequest)(nil), // 22: pb.DeleteAdminRequest
(*CheckAdminOTPWithUsernameRequest)(nil), // 23: pb.CheckAdminOTPWithUsernameRequest
(*CheckAdminOTPWithUsernameResponse)(nil), // 24: pb.CheckAdminOTPWithUsernameResponse
(*Admin)(nil), // 25: pb.Admin
(*AdminModuleList)(nil), // 26: pb.AdminModuleList
(*RPCSuccess)(nil), // 27: pb.RPCSuccess
(*RPCCountResponse)(nil), // 28: pb.RPCCountResponse
}
var file_service_admin_proto_depIdxs = []int32{
23, // 0: pb.FindEnabledAdminResponse.admin:type_name -> pb.Admin
24, // 1: pb.FindAllAdminModulesResponse.adminModules:type_name -> pb.AdminModuleList
23, // 2: pb.ListEnabledAdminsResponse.admins:type_name -> pb.Admin
25, // 0: pb.FindEnabledAdminResponse.admin:type_name -> pb.Admin
26, // 1: pb.FindAllAdminModulesResponse.adminModules:type_name -> pb.AdminModuleList
25, // 2: pb.ListEnabledAdminsResponse.admins:type_name -> pb.Admin
0, // 3: pb.AdminService.loginAdmin:input_type -> pb.LoginAdminRequest
2, // 4: pb.AdminService.checkAdminExists:input_type -> pb.CheckAdminExistsRequest
4, // 5: pb.AdminService.checkAdminUsername:input_type -> pb.CheckAdminUsernameRequest
@@ -1513,22 +1625,24 @@ var file_service_admin_proto_depIdxs = []int32{
19, // 14: pb.AdminService.countAllEnabledAdmins:input_type -> pb.CountAllEnabledAdminsRequest
20, // 15: pb.AdminService.listEnabledAdmins:input_type -> pb.ListEnabledAdminsRequest
22, // 16: pb.AdminService.deleteAdmin:input_type -> pb.DeleteAdminRequest
1, // 17: pb.AdminService.loginAdmin:output_type -> pb.LoginAdminResponse
3, // 18: pb.AdminService.checkAdminExists:output_type -> pb.CheckAdminExistsResponse
5, // 19: pb.AdminService.checkAdminUsername:output_type -> pb.CheckAdminUsernameResponse
7, // 20: pb.AdminService.findAdminFullname:output_type -> pb.FindAdminFullnameResponse
9, // 21: pb.AdminService.findEnabledAdmin:output_type -> pb.FindEnabledAdminResponse
11, // 22: pb.AdminService.createOrUpdateAdmin:output_type -> pb.CreateOrUpdateAdminResponse
25, // 23: pb.AdminService.updateAdminInfo:output_type -> pb.RPCSuccess
25, // 24: pb.AdminService.updateAdminLogin:output_type -> pb.RPCSuccess
15, // 25: pb.AdminService.findAllAdminModules:output_type -> pb.FindAllAdminModulesResponse
17, // 26: pb.AdminService.createAdmin:output_type -> pb.CreateAdminResponse
25, // 27: pb.AdminService.updateAdmin:output_type -> pb.RPCSuccess
26, // 28: pb.AdminService.countAllEnabledAdmins:output_type -> pb.RPCCountResponse
21, // 29: pb.AdminService.listEnabledAdmins:output_type -> pb.ListEnabledAdminsResponse
25, // 30: pb.AdminService.deleteAdmin:output_type -> pb.RPCSuccess
17, // [17:31] is the sub-list for method output_type
3, // [3:17] is the sub-list for method input_type
23, // 17: pb.AdminService.checkAdminOTPWithUsername:input_type -> pb.CheckAdminOTPWithUsernameRequest
1, // 18: pb.AdminService.loginAdmin:output_type -> pb.LoginAdminResponse
3, // 19: pb.AdminService.checkAdminExists:output_type -> pb.CheckAdminExistsResponse
5, // 20: pb.AdminService.checkAdminUsername:output_type -> pb.CheckAdminUsernameResponse
7, // 21: pb.AdminService.findAdminFullname:output_type -> pb.FindAdminFullnameResponse
9, // 22: pb.AdminService.findEnabledAdmin:output_type -> pb.FindEnabledAdminResponse
11, // 23: pb.AdminService.createOrUpdateAdmin:output_type -> pb.CreateOrUpdateAdminResponse
27, // 24: pb.AdminService.updateAdminInfo:output_type -> pb.RPCSuccess
27, // 25: pb.AdminService.updateAdminLogin:output_type -> pb.RPCSuccess
15, // 26: pb.AdminService.findAllAdminModules:output_type -> pb.FindAllAdminModulesResponse
17, // 27: pb.AdminService.createAdmin:output_type -> pb.CreateAdminResponse
27, // 28: pb.AdminService.updateAdmin:output_type -> pb.RPCSuccess
28, // 29: pb.AdminService.countAllEnabledAdmins:output_type -> pb.RPCCountResponse
21, // 30: pb.AdminService.listEnabledAdmins:output_type -> pb.ListEnabledAdminsResponse
27, // 31: pb.AdminService.deleteAdmin:output_type -> pb.RPCSuccess
24, // 32: pb.AdminService.checkAdminOTPWithUsername:output_type -> pb.CheckAdminOTPWithUsernameResponse
18, // [18:33] is the sub-list for method output_type
3, // [3:18] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
@@ -1819,6 +1933,30 @@ func file_service_admin_proto_init() {
return nil
}
}
file_service_admin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckAdminOTPWithUsernameRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckAdminOTPWithUsernameResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -1826,7 +1964,7 @@ func file_service_admin_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_admin_proto_rawDesc,
NumEnums: 0,
NumMessages: 23,
NumMessages: 25,
NumExtensions: 0,
NumServices: 1,
},
@@ -1880,6 +2018,8 @@ type AdminServiceClient interface {
ListEnabledAdmins(ctx context.Context, in *ListEnabledAdminsRequest, opts ...grpc.CallOption) (*ListEnabledAdminsResponse, error)
// 删除管理员
DeleteAdmin(ctx context.Context, in *DeleteAdminRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 根据用户名检查是否需要输入OTP
CheckAdminOTPWithUsername(ctx context.Context, in *CheckAdminOTPWithUsernameRequest, opts ...grpc.CallOption) (*CheckAdminOTPWithUsernameResponse, error)
}
type adminServiceClient struct {
@@ -2016,6 +2156,15 @@ func (c *adminServiceClient) DeleteAdmin(ctx context.Context, in *DeleteAdminReq
return out, nil
}
func (c *adminServiceClient) CheckAdminOTPWithUsername(ctx context.Context, in *CheckAdminOTPWithUsernameRequest, opts ...grpc.CallOption) (*CheckAdminOTPWithUsernameResponse, error) {
out := new(CheckAdminOTPWithUsernameResponse)
err := c.cc.Invoke(ctx, "/pb.AdminService/checkAdminOTPWithUsername", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AdminServiceServer is the server API for AdminService service.
type AdminServiceServer interface {
// 登录
@@ -2046,6 +2195,8 @@ type AdminServiceServer interface {
ListEnabledAdmins(context.Context, *ListEnabledAdminsRequest) (*ListEnabledAdminsResponse, error)
// 删除管理员
DeleteAdmin(context.Context, *DeleteAdminRequest) (*RPCSuccess, error)
// 根据用户名检查是否需要输入OTP
CheckAdminOTPWithUsername(context.Context, *CheckAdminOTPWithUsernameRequest) (*CheckAdminOTPWithUsernameResponse, error)
}
// UnimplementedAdminServiceServer can be embedded to have forward compatible implementations.
@@ -2094,6 +2245,9 @@ func (*UnimplementedAdminServiceServer) ListEnabledAdmins(context.Context, *List
func (*UnimplementedAdminServiceServer) DeleteAdmin(context.Context, *DeleteAdminRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteAdmin not implemented")
}
func (*UnimplementedAdminServiceServer) CheckAdminOTPWithUsername(context.Context, *CheckAdminOTPWithUsernameRequest) (*CheckAdminOTPWithUsernameResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckAdminOTPWithUsername not implemented")
}
func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer) {
s.RegisterService(&_AdminService_serviceDesc, srv)
@@ -2351,6 +2505,24 @@ func _AdminService_DeleteAdmin_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _AdminService_CheckAdminOTPWithUsername_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckAdminOTPWithUsernameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServiceServer).CheckAdminOTPWithUsername(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.AdminService/CheckAdminOTPWithUsername",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServiceServer).CheckAdminOTPWithUsername(ctx, req.(*CheckAdminOTPWithUsernameRequest))
}
return interceptor(ctx, in, info, handler)
}
var _AdminService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.AdminService",
HandlerType: (*AdminServiceServer)(nil),
@@ -2411,6 +2583,10 @@ var _AdminService_serviceDesc = grpc.ServiceDesc{
MethodName: "deleteAdmin",
Handler: _AdminService_DeleteAdmin_Handler,
},
{
MethodName: "checkAdminOTPWithUsername",
Handler: _AdminService_CheckAdminOTPWithUsername_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_admin.proto",

View File

@@ -0,0 +1,432 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_login.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 查找认证
type FindEnabledLoginRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
}
func (x *FindEnabledLoginRequest) Reset() {
*x = FindEnabledLoginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_login_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledLoginRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledLoginRequest) ProtoMessage() {}
func (x *FindEnabledLoginRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_login_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FindEnabledLoginRequest.ProtoReflect.Descriptor instead.
func (*FindEnabledLoginRequest) Descriptor() ([]byte, []int) {
return file_service_login_proto_rawDescGZIP(), []int{0}
}
func (x *FindEnabledLoginRequest) GetAdminId() int64 {
if x != nil {
return x.AdminId
}
return 0
}
func (x *FindEnabledLoginRequest) GetType() string {
if x != nil {
return x.Type
}
return ""
}
type FindEnabledLoginResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Login *Login `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"`
}
func (x *FindEnabledLoginResponse) Reset() {
*x = FindEnabledLoginResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_login_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledLoginResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledLoginResponse) ProtoMessage() {}
func (x *FindEnabledLoginResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_login_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FindEnabledLoginResponse.ProtoReflect.Descriptor instead.
func (*FindEnabledLoginResponse) Descriptor() ([]byte, []int) {
return file_service_login_proto_rawDescGZIP(), []int{1}
}
func (x *FindEnabledLoginResponse) GetLogin() *Login {
if x != nil {
return x.Login
}
return nil
}
// 修改认证
type UpdateLoginRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Login *Login `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"`
}
func (x *UpdateLoginRequest) Reset() {
*x = UpdateLoginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_login_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateLoginRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateLoginRequest) ProtoMessage() {}
func (x *UpdateLoginRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_login_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateLoginRequest.ProtoReflect.Descriptor instead.
func (*UpdateLoginRequest) Descriptor() ([]byte, []int) {
return file_service_login_proto_rawDescGZIP(), []int{2}
}
func (x *UpdateLoginRequest) GetLogin() *Login {
if x != nil {
return x.Login
}
return nil
}
var File_service_login_proto protoreflect.FileDescriptor
var file_service_login_proto_rawDesc = []byte{
0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x72, 0x70,
0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0x47, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4c,
0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61,
0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64,
0x6d, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3b, 0x0a, 0x18, 0x46, 0x69, 0x6e,
0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x35, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x05,
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62,
0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x32, 0x94, 0x01,
0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d,
0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a,
0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x70,
0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_login_proto_rawDescOnce sync.Once
file_service_login_proto_rawDescData = file_service_login_proto_rawDesc
)
func file_service_login_proto_rawDescGZIP() []byte {
file_service_login_proto_rawDescOnce.Do(func() {
file_service_login_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_login_proto_rawDescData)
})
return file_service_login_proto_rawDescData
}
var file_service_login_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_service_login_proto_goTypes = []interface{}{
(*FindEnabledLoginRequest)(nil), // 0: pb.FindEnabledLoginRequest
(*FindEnabledLoginResponse)(nil), // 1: pb.FindEnabledLoginResponse
(*UpdateLoginRequest)(nil), // 2: pb.UpdateLoginRequest
(*Login)(nil), // 3: pb.Login
(*RPCSuccess)(nil), // 4: pb.RPCSuccess
}
var file_service_login_proto_depIdxs = []int32{
3, // 0: pb.FindEnabledLoginResponse.login:type_name -> pb.Login
3, // 1: pb.UpdateLoginRequest.login:type_name -> pb.Login
0, // 2: pb.LoginService.findEnabledLogin:input_type -> pb.FindEnabledLoginRequest
2, // 3: pb.LoginService.updateLogin:input_type -> pb.UpdateLoginRequest
1, // 4: pb.LoginService.findEnabledLogin:output_type -> pb.FindEnabledLoginResponse
4, // 5: pb.LoginService.updateLogin:output_type -> pb.RPCSuccess
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_service_login_proto_init() }
func file_service_login_proto_init() {
if File_service_login_proto != nil {
return
}
file_model_login_proto_init()
file_rpc_messages_proto_init()
if !protoimpl.UnsafeEnabled {
file_service_login_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledLoginRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_login_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindEnabledLoginResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_login_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateLoginRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_login_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_login_proto_goTypes,
DependencyIndexes: file_service_login_proto_depIdxs,
MessageInfos: file_service_login_proto_msgTypes,
}.Build()
File_service_login_proto = out.File
file_service_login_proto_rawDesc = nil
file_service_login_proto_goTypes = nil
file_service_login_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// LoginServiceClient is the client API for LoginService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LoginServiceClient interface {
// 查找认证
FindEnabledLogin(ctx context.Context, in *FindEnabledLoginRequest, opts ...grpc.CallOption) (*FindEnabledLoginResponse, error)
// 修改认证
UpdateLogin(ctx context.Context, in *UpdateLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
}
type loginServiceClient struct {
cc grpc.ClientConnInterface
}
func NewLoginServiceClient(cc grpc.ClientConnInterface) LoginServiceClient {
return &loginServiceClient{cc}
}
func (c *loginServiceClient) FindEnabledLogin(ctx context.Context, in *FindEnabledLoginRequest, opts ...grpc.CallOption) (*FindEnabledLoginResponse, error) {
out := new(FindEnabledLoginResponse)
err := c.cc.Invoke(ctx, "/pb.LoginService/findEnabledLogin", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loginServiceClient) UpdateLogin(ctx context.Context, in *UpdateLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.LoginService/updateLogin", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// LoginServiceServer is the server API for LoginService service.
type LoginServiceServer interface {
// 查找认证
FindEnabledLogin(context.Context, *FindEnabledLoginRequest) (*FindEnabledLoginResponse, error)
// 修改认证
UpdateLogin(context.Context, *UpdateLoginRequest) (*RPCSuccess, error)
}
// UnimplementedLoginServiceServer can be embedded to have forward compatible implementations.
type UnimplementedLoginServiceServer struct {
}
func (*UnimplementedLoginServiceServer) FindEnabledLogin(context.Context, *FindEnabledLoginRequest) (*FindEnabledLoginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledLogin not implemented")
}
func (*UnimplementedLoginServiceServer) UpdateLogin(context.Context, *UpdateLoginRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateLogin not implemented")
}
func RegisterLoginServiceServer(s *grpc.Server, srv LoginServiceServer) {
s.RegisterService(&_LoginService_serviceDesc, srv)
}
func _LoginService_FindEnabledLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindEnabledLoginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoginServiceServer).FindEnabledLogin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.LoginService/FindEnabledLogin",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoginServiceServer).FindEnabledLogin(ctx, req.(*FindEnabledLoginRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoginService_UpdateLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateLoginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoginServiceServer).UpdateLogin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.LoginService/UpdateLogin",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoginServiceServer).UpdateLogin(ctx, req.(*UpdateLoginRequest))
}
return interceptor(ctx, in, info, handler)
}
var _LoginService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.LoginService",
HandlerType: (*LoginServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "findEnabledLogin",
Handler: _LoginService_FindEnabledLogin_Handler,
},
{
MethodName: "updateLogin",
Handler: _LoginService_UpdateLogin_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_login.proto",
}

View File

@@ -4,6 +4,7 @@ option go_package = "./pb";
package pb;
import "model_admin_module.proto";
import "model_login.proto";
message Admin {
int64 id = 1;
@@ -13,4 +14,5 @@ message Admin {
bool isSuper = 5;
int64 createdAt = 6;
repeated AdminModule Modules = 7;
Login otpLogin = 8; // OTP认证
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message Login {
int64 id = 1;
string type = 2;
bytes paramsJSON = 3;
bool isOn = 4;
int64 adminId = 5;
int64 userId = 6;
}

View File

@@ -49,6 +49,9 @@ service AdminService {
// 删除管理员
rpc deleteAdmin (DeleteAdminRequest) returns (RPCSuccess);
// 根据用户名检查是否需要输入OTP
rpc checkAdminOTPWithUsername (CheckAdminOTPWithUsernameRequest) returns (CheckAdminOTPWithUsernameResponse);
}
// 登录
@@ -176,3 +179,12 @@ message ListEnabledAdminsResponse {
message DeleteAdminRequest {
int64 adminId = 1;
}
// 根据用户名检查是否需要输入OTP
message CheckAdminOTPWithUsernameRequest {
string username = 1;
}
message CheckAdminOTPWithUsernameResponse {
bool requireOTP = 1;
}

View File

@@ -0,0 +1,31 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_login.proto";
import "rpc_messages.proto";
// 认证相关服务
service LoginService {
// 查找认证
rpc findEnabledLogin (FindEnabledLoginRequest) returns (FindEnabledLoginResponse);
// 修改认证
rpc updateLogin (UpdateLoginRequest) returns (RPCSuccess);
}
// 查找认证
message FindEnabledLoginRequest {
int64 adminId = 1;
string type = 2;
}
message FindEnabledLoginResponse {
Login login = 1;
}
// 修改认证
message UpdateLoginRequest {
Login login = 1;
}