Redis cache

This commit is contained in:
2025-03-29 02:24:15 +08:00
parent f3f9ebb5af
commit 1651328a74
26 changed files with 786 additions and 636 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.35.1
// protoc v5.28.3
// protoc-gen-go v1.36.6
// protoc v5.29.3
// source: user.proto
package proto
@@ -11,6 +11,7 @@ import (
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
@@ -21,15 +22,14 @@ const (
)
type UserInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"`
PermNodes []byte `protobuf:"bytes,3,opt,name=perm_nodes,json=permNodes,proto3,oneof" json:"perm_nodes,omitempty"`
Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3,oneof" json:"metadata,omitempty"`
unknownFields protoimpl.UnknownFields
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"`
PermNodes []byte `protobuf:"bytes,3,opt,name=perm_nodes,json=permNodes,proto3,oneof" json:"perm_nodes,omitempty"`
Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3,oneof" json:"metadata,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *UserInfo) Reset() {
@@ -98,11 +98,10 @@ func (x *UserInfo) GetMetadata() []byte {
}
type MultipleUserInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Data []*UserInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
Data []*UserInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *MultipleUserInfo) Reset() {
@@ -143,12 +142,11 @@ func (x *MultipleUserInfo) GetData() []*UserInfo {
}
type GetUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
UserId *uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
UserId *uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *GetUserRequest) Reset() {
@@ -196,11 +194,10 @@ func (x *GetUserRequest) GetName() string {
}
type ListUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
unknownFields protoimpl.UnknownFields
UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *ListUserRequest) Reset() {
@@ -241,13 +238,12 @@ func (x *ListUserRequest) GetUserId() []uint64 {
}
type ListUserRelativeRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
IsRelated bool `protobuf:"varint,3,opt,name=is_related,json=isRelated,proto3" json:"is_related,omitempty"`
unknownFields protoimpl.UnknownFields
UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
IsRelated bool `protobuf:"varint,3,opt,name=is_related,json=isRelated,proto3" json:"is_related,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *ListUserRelativeRequest) Reset() {
@@ -302,11 +298,10 @@ func (x *ListUserRelativeRequest) GetIsRelated() bool {
}
type ListUserRelativeResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Data []*UserInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
Data []*UserInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
sizeCache protoimpl.SizeCache
}
func (x *ListUserRelativeResponse) Reset() {
@@ -348,67 +343,49 @@ func (x *ListUserRelativeResponse) GetData() []*UserInfo {
var File_user_proto protoreflect.FileDescriptor
var file_user_proto_rawDesc = []byte{
0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xab, 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
0x12, 0x22, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x4e, 0x6f, 0x64, 0x65,
0x73, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x5f, 0x6e,
0x6f, 0x64, 0x65, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0x22, 0x37, 0x0a, 0x10, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65,
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x0e, 0x47, 0x65,
0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x07,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52,
0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42,
0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74,
0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75,
0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x22,
0x3f, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74,
0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
0x32, 0xd8, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x33, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49,
0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
0x72, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e,
0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e,
0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
const file_user_proto_rawDesc = "" +
"\n" +
"\n" +
"user.proto\x12\x05proto\"\xab\x01\n" +
"\bUserInfo\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x04R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" +
"\blanguage\x18\x05 \x01(\tR\blanguage\x12\"\n" +
"\n" +
"perm_nodes\x18\x03 \x01(\fH\x00R\tpermNodes\x88\x01\x01\x12\x1f\n" +
"\bmetadata\x18\x04 \x01(\fH\x01R\bmetadata\x88\x01\x01B\r\n" +
"\v_perm_nodesB\v\n" +
"\t_metadata\"7\n" +
"\x10MultipleUserInfo\x12#\n" +
"\x04data\x18\x01 \x03(\v2\x0f.proto.UserInfoR\x04data\"\\\n" +
"\x0eGetUserRequest\x12\x1c\n" +
"\auser_id\x18\x01 \x01(\x04H\x00R\x06userId\x88\x01\x01\x12\x17\n" +
"\x04name\x18\x02 \x01(\tH\x01R\x04name\x88\x01\x01B\n" +
"\n" +
"\b_user_idB\a\n" +
"\x05_name\"*\n" +
"\x0fListUserRequest\x12\x17\n" +
"\auser_id\x18\x01 \x03(\x04R\x06userId\"i\n" +
"\x17ListUserRelativeRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\x04R\x06userId\x12\x16\n" +
"\x06status\x18\x02 \x01(\x05R\x06status\x12\x1d\n" +
"\n" +
"is_related\x18\x03 \x01(\bR\tisRelated\"?\n" +
"\x18ListUserRelativeResponse\x12#\n" +
"\x04data\x18\x01 \x03(\v2\x0f.proto.UserInfoR\x04data2\xd8\x01\n" +
"\vUserService\x123\n" +
"\aGetUser\x12\x15.proto.GetUserRequest\x1a\x0f.proto.UserInfo\"\x00\x12=\n" +
"\bListUser\x12\x16.proto.ListUserRequest\x1a\x17.proto.MultipleUserInfo\"\x00\x12U\n" +
"\x10ListUserRelative\x12\x1e.proto.ListUserRelativeRequest\x1a\x1f.proto.ListUserRelativeResponse\"\x00B\tZ\a.;protob\x06proto3"
var (
file_user_proto_rawDescOnce sync.Once
file_user_proto_rawDescData = file_user_proto_rawDesc
file_user_proto_rawDescData []byte
)
func file_user_proto_rawDescGZIP() []byte {
file_user_proto_rawDescOnce.Do(func() {
file_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_proto_rawDescData)
file_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)))
})
return file_user_proto_rawDescData
}
@@ -449,7 +426,7 @@ func file_user_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_user_proto_rawDesc,
RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
@@ -460,7 +437,6 @@ func file_user_proto_init() {
MessageInfos: file_user_proto_msgTypes,
}.Build()
File_user_proto = out.File
file_user_proto_rawDesc = nil
file_user_proto_goTypes = nil
file_user_proto_depIdxs = nil
}