增加文件和用户界面相关配置

This commit is contained in:
GoEdgeLab
2021-02-25 21:08:08 +08:00
parent fbedbc17c7
commit c570d48365
6 changed files with 278 additions and 52 deletions

View File

@@ -30,9 +30,11 @@ type File struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsPublic bool `protobuf:"varint,5,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
}
func (x *File) Reset() {
@@ -88,17 +90,34 @@ func (x *File) GetSize() int64 {
return 0
}
func (x *File) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *File) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
var File_models_model_file_proto protoreflect.FileDescriptor
var file_models_model_file_proto_rawDesc = []byte{
0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x66,
0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x46, 0x0a,
0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x80, 0x01,
0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x64, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74,
0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -29,6 +29,101 @@ const (
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 查找文件
type FindEnabledFileRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FileId int64 `protobuf:"varint,1,opt,name=fileId,proto3" json:"fileId,omitempty"`
}
func (x *FindEnabledFileRequest) Reset() {
*x = FindEnabledFileRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_file_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledFileRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledFileRequest) ProtoMessage() {}
func (x *FindEnabledFileRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_file_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 FindEnabledFileRequest.ProtoReflect.Descriptor instead.
func (*FindEnabledFileRequest) Descriptor() ([]byte, []int) {
return file_service_file_proto_rawDescGZIP(), []int{0}
}
func (x *FindEnabledFileRequest) GetFileId() int64 {
if x != nil {
return x.FileId
}
return 0
}
type FindEnabledFileResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
File *File `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
}
func (x *FindEnabledFileResponse) Reset() {
*x = FindEnabledFileResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_file_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindEnabledFileResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindEnabledFileResponse) ProtoMessage() {}
func (x *FindEnabledFileResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_file_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 FindEnabledFileResponse.ProtoReflect.Descriptor instead.
func (*FindEnabledFileResponse) Descriptor() ([]byte, []int) {
return file_service_file_proto_rawDescGZIP(), []int{1}
}
func (x *FindEnabledFileResponse) GetFile() *File {
if x != nil {
return x.File
}
return nil
}
// 创建文件
type CreateFileRequest struct {
state protoimpl.MessageState
@@ -37,12 +132,13 @@ type CreateFileRequest struct {
Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
IsPublic bool `protobuf:"varint,3,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
}
func (x *CreateFileRequest) Reset() {
*x = CreateFileRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_file_proto_msgTypes[0]
mi := &file_service_file_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -55,7 +151,7 @@ func (x *CreateFileRequest) String() string {
func (*CreateFileRequest) ProtoMessage() {}
func (x *CreateFileRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_file_proto_msgTypes[0]
mi := &file_service_file_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -68,7 +164,7 @@ func (x *CreateFileRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateFileRequest.ProtoReflect.Descriptor instead.
func (*CreateFileRequest) Descriptor() ([]byte, []int) {
return file_service_file_proto_rawDescGZIP(), []int{0}
return file_service_file_proto_rawDescGZIP(), []int{2}
}
func (x *CreateFileRequest) GetFilename() string {
@@ -85,6 +181,13 @@ func (x *CreateFileRequest) GetSize() int64 {
return 0
}
func (x *CreateFileRequest) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
type CreateFileResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -96,7 +199,7 @@ type CreateFileResponse struct {
func (x *CreateFileResponse) Reset() {
*x = CreateFileResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_file_proto_msgTypes[1]
mi := &file_service_file_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -109,7 +212,7 @@ func (x *CreateFileResponse) String() string {
func (*CreateFileResponse) ProtoMessage() {}
func (x *CreateFileResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_file_proto_msgTypes[1]
mi := &file_service_file_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -122,7 +225,7 @@ func (x *CreateFileResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateFileResponse.ProtoReflect.Descriptor instead.
func (*CreateFileResponse) Descriptor() ([]byte, []int) {
return file_service_file_proto_rawDescGZIP(), []int{1}
return file_service_file_proto_rawDescGZIP(), []int{3}
}
func (x *CreateFileResponse) GetFileId() int64 {
@@ -144,7 +247,7 @@ type UpdateFileFinishedRequest struct {
func (x *UpdateFileFinishedRequest) Reset() {
*x = UpdateFileFinishedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_file_proto_msgTypes[2]
mi := &file_service_file_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -157,7 +260,7 @@ func (x *UpdateFileFinishedRequest) String() string {
func (*UpdateFileFinishedRequest) ProtoMessage() {}
func (x *UpdateFileFinishedRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_file_proto_msgTypes[2]
mi := &file_service_file_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -170,7 +273,7 @@ func (x *UpdateFileFinishedRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateFileFinishedRequest.ProtoReflect.Descriptor instead.
func (*UpdateFileFinishedRequest) Descriptor() ([]byte, []int) {
return file_service_file_proto_rawDescGZIP(), []int{2}
return file_service_file_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateFileFinishedRequest) GetFileId() int64 {
@@ -186,27 +289,42 @@ var file_service_file_proto_rawDesc = []byte{
0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61,
0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65,
0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x16,
0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x37,
0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x66, 0x69, 0x6c,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c,
0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x5f, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08,
0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x2c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x46, 0x69, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x32, 0x8f, 0x01, 0x0a, 0x0b,
0x46, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1d,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x46, 0x69,
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 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,
0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x32, 0xdb, 0x01, 0x0a, 0x0b,
0x46, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a,
0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46,
0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69,
0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68,
0x65, 0x64, 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 (
@@ -221,23 +339,29 @@ func file_service_file_proto_rawDescGZIP() []byte {
return file_service_file_proto_rawDescData
}
var file_service_file_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_service_file_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_service_file_proto_goTypes = []interface{}{
(*CreateFileRequest)(nil), // 0: pb.CreateFileRequest
(*CreateFileResponse)(nil), // 1: pb.CreateFileResponse
(*UpdateFileFinishedRequest)(nil), // 2: pb.UpdateFileFinishedRequest
(*RPCSuccess)(nil), // 3: pb.RPCSuccess
(*FindEnabledFileRequest)(nil), // 0: pb.FindEnabledFileRequest
(*FindEnabledFileResponse)(nil), // 1: pb.FindEnabledFileResponse
(*CreateFileRequest)(nil), // 2: pb.CreateFileRequest
(*CreateFileResponse)(nil), // 3: pb.CreateFileResponse
(*UpdateFileFinishedRequest)(nil), // 4: pb.UpdateFileFinishedRequest
(*File)(nil), // 5: pb.File
(*RPCSuccess)(nil), // 6: pb.RPCSuccess
}
var file_service_file_proto_depIdxs = []int32{
0, // 0: pb.FileService.createFile:input_type -> pb.CreateFileRequest
2, // 1: pb.FileService.updateFileFinished:input_type -> pb.UpdateFileFinishedRequest
1, // 2: pb.FileService.createFile:output_type -> pb.CreateFileResponse
3, // 3: pb.FileService.updateFileFinished:output_type -> pb.RPCSuccess
2, // [2:4] is the sub-list for method output_type
0, // [0:2] 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
5, // 0: pb.FindEnabledFileResponse.file:type_name -> pb.File
0, // 1: pb.FileService.findEnabledFile:input_type -> pb.FindEnabledFileRequest
2, // 2: pb.FileService.createFile:input_type -> pb.CreateFileRequest
4, // 3: pb.FileService.updateFileFinished:input_type -> pb.UpdateFileFinishedRequest
1, // 4: pb.FileService.findEnabledFile:output_type -> pb.FindEnabledFileResponse
3, // 5: pb.FileService.createFile:output_type -> pb.CreateFileResponse
6, // 6: pb.FileService.updateFileFinished:output_type -> pb.RPCSuccess
4, // [4:7] is the sub-list for method output_type
1, // [1:4] 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
}
func init() { file_service_file_proto_init() }
@@ -246,9 +370,10 @@ func file_service_file_proto_init() {
return
}
file_models_rpc_messages_proto_init()
file_models_model_file_proto_init()
if !protoimpl.UnsafeEnabled {
file_service_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateFileRequest); i {
switch v := v.(*FindEnabledFileRequest); i {
case 0:
return &v.state
case 1:
@@ -260,7 +385,7 @@ func file_service_file_proto_init() {
}
}
file_service_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateFileResponse); i {
switch v := v.(*FindEnabledFileResponse); i {
case 0:
return &v.state
case 1:
@@ -272,6 +397,30 @@ func file_service_file_proto_init() {
}
}
file_service_file_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateFileRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_file_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateFileResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_file_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateFileFinishedRequest); i {
case 0:
return &v.state
@@ -290,7 +439,7 @@ func file_service_file_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_file_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
@@ -316,6 +465,8 @@ const _ = grpc.SupportPackageIsVersion6
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type FileServiceClient interface {
// 查找文件
FindEnabledFile(ctx context.Context, in *FindEnabledFileRequest, opts ...grpc.CallOption) (*FindEnabledFileResponse, error)
// 创建文件
CreateFile(ctx context.Context, in *CreateFileRequest, opts ...grpc.CallOption) (*CreateFileResponse, error)
// 将文件置为已完成
@@ -330,6 +481,15 @@ func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
return &fileServiceClient{cc}
}
func (c *fileServiceClient) FindEnabledFile(ctx context.Context, in *FindEnabledFileRequest, opts ...grpc.CallOption) (*FindEnabledFileResponse, error) {
out := new(FindEnabledFileResponse)
err := c.cc.Invoke(ctx, "/pb.FileService/findEnabledFile", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileServiceClient) CreateFile(ctx context.Context, in *CreateFileRequest, opts ...grpc.CallOption) (*CreateFileResponse, error) {
out := new(CreateFileResponse)
err := c.cc.Invoke(ctx, "/pb.FileService/createFile", in, out, opts...)
@@ -350,6 +510,8 @@ func (c *fileServiceClient) UpdateFileFinished(ctx context.Context, in *UpdateFi
// FileServiceServer is the server API for FileService service.
type FileServiceServer interface {
// 查找文件
FindEnabledFile(context.Context, *FindEnabledFileRequest) (*FindEnabledFileResponse, error)
// 创建文件
CreateFile(context.Context, *CreateFileRequest) (*CreateFileResponse, error)
// 将文件置为已完成
@@ -360,6 +522,9 @@ type FileServiceServer interface {
type UnimplementedFileServiceServer struct {
}
func (*UnimplementedFileServiceServer) FindEnabledFile(context.Context, *FindEnabledFileRequest) (*FindEnabledFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledFile not implemented")
}
func (*UnimplementedFileServiceServer) CreateFile(context.Context, *CreateFileRequest) (*CreateFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateFile not implemented")
}
@@ -371,6 +536,24 @@ func RegisterFileServiceServer(s *grpc.Server, srv FileServiceServer) {
s.RegisterService(&_FileService_serviceDesc, srv)
}
func _FileService_FindEnabledFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindEnabledFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServiceServer).FindEnabledFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.FileService/FindEnabledFile",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServiceServer).FindEnabledFile(ctx, req.(*FindEnabledFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _FileService_CreateFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateFileRequest)
if err := dec(in); err != nil {
@@ -411,6 +594,10 @@ var _FileService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.FileService",
HandlerType: (*FileServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "findEnabledFile",
Handler: _FileService_FindEnabledFile_Handler,
},
{
MethodName: "createFile",
Handler: _FileService_CreateFile_Handler,

View File

@@ -7,4 +7,6 @@ message File {
int64 id = 1;
string filename = 2;
int64 size = 3;
int64 createdAt = 4;
bool isPublic = 5;
}

View File

@@ -4,9 +4,13 @@ option go_package = "./pb";
package pb;
import "models/rpc_messages.proto";
import "models/model_file.proto";
// 文件相关服务
service FileService {
// 查找文件
rpc findEnabledFile (FindEnabledFileRequest) returns (FindEnabledFileResponse);
// 创建文件
rpc createFile (CreateFileRequest) returns (CreateFileResponse);
@@ -14,10 +18,20 @@ service FileService {
rpc updateFileFinished (UpdateFileFinishedRequest) returns (RPCSuccess);
}
// 查找文件
message FindEnabledFileRequest {
int64 fileId = 1;
}
message FindEnabledFileResponse {
File file = 1;
}
// 创建文件
message CreateFileRequest {
string filename = 1;
int64 size = 2;
bool isPublic = 3;
}
message CreateFileResponse {

View File

@@ -8,4 +8,6 @@ type AdminUIConfig struct {
ShowVersion bool `json:"showVersion"` // 是否显示版本号
Version string `json:"version"` // 显示的版本号
ShowFinance bool `json:"showFinance"` // 是否显示财务相关信息
FaviconFileId int64 `json:"faviconFileId"` // Favicon文件ID
LogoFileId int64 `json:"logoFileId"` // Logo文件ID
}

View File

@@ -8,4 +8,6 @@ type UserUIConfig struct {
ShowVersion bool `json:"showVersion"` // 是否显示版本号
Version string `json:"version"` // 显示的版本号
ShowFinance bool `json:"showFinance"` // 是否显示财务相关信息
FaviconFileId int64 `json:"faviconFileId"` // Favicon文件ID
LogoFileId int64 `json:"logoFileId"` // Logo文件ID
}