增加清理老登录SESSION API
This commit is contained in:
@@ -26,9 +26,9 @@ type WriteLoginSessionValueRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"`
|
||||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // SESSION ID
|
||||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // 数据Key
|
||||
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // 数据值
|
||||
}
|
||||
|
||||
func (x *WriteLoginSessionValueRequest) Reset() {
|
||||
@@ -90,7 +90,7 @@ type DeleteLoginSessionRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"`
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // SESSION ID
|
||||
}
|
||||
|
||||
func (x *DeleteLoginSessionRequest) Reset() {
|
||||
@@ -138,7 +138,7 @@ type FindLoginSessionRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"`
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // SESSION ID
|
||||
}
|
||||
|
||||
func (x *FindLoginSessionRequest) Reset() {
|
||||
@@ -185,7 +185,7 @@ type FindLoginSessionResponse struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
LoginSession *LoginSession `protobuf:"bytes,1,opt,name=loginSession,proto3" json:"loginSession,omitempty"`
|
||||
LoginSession *LoginSession `protobuf:"bytes,1,opt,name=loginSession,proto3" json:"loginSession,omitempty"` // SESSION信息
|
||||
}
|
||||
|
||||
func (x *FindLoginSessionResponse) Reset() {
|
||||
@@ -227,6 +227,62 @@ func (x *FindLoginSessionResponse) GetLoginSession() *LoginSession {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 清理老的SESSION
|
||||
type ClearOldLoginSessionsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` // 当前SESSION ID
|
||||
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` // 当前操作IP
|
||||
}
|
||||
|
||||
func (x *ClearOldLoginSessionsRequest) Reset() {
|
||||
*x = ClearOldLoginSessionsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_login_session_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ClearOldLoginSessionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ClearOldLoginSessionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ClearOldLoginSessionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_login_session_proto_msgTypes[4]
|
||||
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 ClearOldLoginSessionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ClearOldLoginSessionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_service_login_session_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ClearOldLoginSessionsRequest) GetSid() string {
|
||||
if x != nil {
|
||||
return x.Sid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ClearOldLoginSessionsRequest) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_service_login_session_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_service_login_session_proto_rawDesc = []byte{
|
||||
@@ -252,23 +308,32 @@ var file_service_login_session_proto_rawDesc = []byte{
|
||||
0x65, 0x12, 0x34, 0x0a, 0x0c, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x69, 0x6e,
|
||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0xf6, 0x01, 0x0a, 0x13, 0x4c, 0x6f, 0x67, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||
0x4b, 0x0a, 0x16, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x57,
|
||||
0x72, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x12,
|
||||
0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 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, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4c,
|
||||
0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x6f, 0x67, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x40, 0x0a, 0x1c, 0x43, 0x6c, 0x65, 0x61, 0x72,
|
||||
0x4f, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x32, 0xc1, 0x02, 0x0a, 0x13, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x4b, 0x0a, 0x16, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x43,
|
||||
0x0a, 0x12, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
||||
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 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, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
||||
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e,
|
||||
0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x12, 0x49, 0x0a, 0x15, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x4f, 0x6c, 0x64, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4f, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 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 (
|
||||
@@ -283,25 +348,28 @@ func file_service_login_session_proto_rawDescGZIP() []byte {
|
||||
return file_service_login_session_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_service_login_session_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_service_login_session_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_service_login_session_proto_goTypes = []interface{}{
|
||||
(*WriteLoginSessionValueRequest)(nil), // 0: pb.WriteLoginSessionValueRequest
|
||||
(*DeleteLoginSessionRequest)(nil), // 1: pb.DeleteLoginSessionRequest
|
||||
(*FindLoginSessionRequest)(nil), // 2: pb.FindLoginSessionRequest
|
||||
(*FindLoginSessionResponse)(nil), // 3: pb.FindLoginSessionResponse
|
||||
(*LoginSession)(nil), // 4: pb.LoginSession
|
||||
(*RPCSuccess)(nil), // 5: pb.RPCSuccess
|
||||
(*ClearOldLoginSessionsRequest)(nil), // 4: pb.ClearOldLoginSessionsRequest
|
||||
(*LoginSession)(nil), // 5: pb.LoginSession
|
||||
(*RPCSuccess)(nil), // 6: pb.RPCSuccess
|
||||
}
|
||||
var file_service_login_session_proto_depIdxs = []int32{
|
||||
4, // 0: pb.FindLoginSessionResponse.loginSession:type_name -> pb.LoginSession
|
||||
5, // 0: pb.FindLoginSessionResponse.loginSession:type_name -> pb.LoginSession
|
||||
0, // 1: pb.LoginSessionService.writeLoginSessionValue:input_type -> pb.WriteLoginSessionValueRequest
|
||||
1, // 2: pb.LoginSessionService.deleteLoginSession:input_type -> pb.DeleteLoginSessionRequest
|
||||
2, // 3: pb.LoginSessionService.findLoginSession:input_type -> pb.FindLoginSessionRequest
|
||||
5, // 4: pb.LoginSessionService.writeLoginSessionValue:output_type -> pb.RPCSuccess
|
||||
5, // 5: pb.LoginSessionService.deleteLoginSession:output_type -> pb.RPCSuccess
|
||||
3, // 6: pb.LoginSessionService.findLoginSession:output_type -> pb.FindLoginSessionResponse
|
||||
4, // [4:7] is the sub-list for method output_type
|
||||
1, // [1:4] is the sub-list for method input_type
|
||||
4, // 4: pb.LoginSessionService.clearOldLoginSessions:input_type -> pb.ClearOldLoginSessionsRequest
|
||||
6, // 5: pb.LoginSessionService.writeLoginSessionValue:output_type -> pb.RPCSuccess
|
||||
6, // 6: pb.LoginSessionService.deleteLoginSession:output_type -> pb.RPCSuccess
|
||||
3, // 7: pb.LoginSessionService.findLoginSession:output_type -> pb.FindLoginSessionResponse
|
||||
6, // 8: pb.LoginSessionService.clearOldLoginSessions:output_type -> pb.RPCSuccess
|
||||
5, // [5:9] is the sub-list for method output_type
|
||||
1, // [1:5] 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
|
||||
@@ -363,6 +431,18 @@ func file_service_login_session_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_login_session_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ClearOldLoginSessionsRequest); 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{
|
||||
@@ -370,7 +450,7 @@ func file_service_login_session_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_service_login_session_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user