Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
457cf92c
Commit
457cf92c
authored
Jul 11, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(api): implement get resource by uid
parent
1ab2c894
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
409 additions
and
130 deletions
+409
-130
apidocs.swagger.yaml
docs/apidocs.swagger.yaml
+21
-0
resource_service.proto
proto/api/v1/resource_service.proto
+10
-0
resource_service.pb.go
proto/gen/api/v1/resource_service.pb.go
+192
-118
resource_service.pb.gw.go
proto/gen/api/v1/resource_service.pb.gw.go
+103
-0
resource_service_grpc.pb.go
proto/gen/api/v1/resource_service_grpc.pb.go
+40
-0
resource_service.go
server/router/api/v1/resource_service.go
+19
-7
resource.go
store/db/mysql/resource.go
+3
-0
resource.go
store/db/postgres/resource.go
+3
-0
resource.go
store/db/sqlite/resource.go
+3
-0
resource.go
store/resource.go
+1
-0
EmbeddedResource.tsx
...mponents/MemoContent/EmbeddedContent/EmbeddedResource.tsx
+5
-5
resource.ts
web/src/store/v1/resource.ts
+9
-0
No files found.
docs/apidocs.swagger.yaml
View file @
457cf92c
...
@@ -494,6 +494,27 @@ paths:
...
@@ -494,6 +494,27 @@ paths:
$ref
:
'
#/definitions/v1Resource'
$ref
:
'
#/definitions/v1Resource'
tags
:
tags
:
-
ResourceService
-
ResourceService
/api/v1/resources:by-uid/{uid}
:
get
:
summary
:
GetResourceByUid returns a resource by uid.
operationId
:
ResourceService_GetResourceByUid
responses
:
"
200"
:
description
:
A successful response.
schema
:
$ref
:
'
#/definitions/v1Resource'
default
:
description
:
An unexpected error response.
schema
:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
uid
description
:
The uid of the resource.
in
:
path
required
:
true
type
:
string
tags
:
-
ResourceService
/api/v1/resources:search
:
/api/v1/resources:search
:
get
:
get
:
summary
:
SearchResources searches memos.
summary
:
SearchResources searches memos.
...
...
proto/api/v1/resource_service.proto
View file @
457cf92c
...
@@ -33,6 +33,11 @@ service ResourceService {
...
@@ -33,6 +33,11 @@ service ResourceService {
option
(
google.api.http
)
=
{
get
:
"/api/v1/{name=resources/*}"
};
option
(
google.api.http
)
=
{
get
:
"/api/v1/{name=resources/*}"
};
option
(
google.api.method_signature
)
=
"name"
;
option
(
google.api.method_signature
)
=
"name"
;
}
}
// GetResourceByUid returns a resource by uid.
rpc
GetResourceByUid
(
GetResourceByUidRequest
)
returns
(
Resource
)
{
option
(
google.api.http
)
=
{
get
:
"/api/v1/resources:by-uid/{uid}"
};
option
(
google.api.method_signature
)
=
"uid"
;
}
// GetResourceBinary returns a resource binary by name.
// GetResourceBinary returns a resource binary by name.
rpc
GetResourceBinary
(
GetResourceBinaryRequest
)
returns
(
google.api.HttpBody
)
{
rpc
GetResourceBinary
(
GetResourceBinaryRequest
)
returns
(
google.api.HttpBody
)
{
option
(
google.api.http
)
=
{
get
:
"/file/{name=resources/*}/{filename}"
};
option
(
google.api.http
)
=
{
get
:
"/file/{name=resources/*}/{filename}"
};
...
@@ -104,6 +109,11 @@ message GetResourceRequest {
...
@@ -104,6 +109,11 @@ message GetResourceRequest {
string
name
=
1
;
string
name
=
1
;
}
}
message
GetResourceByUidRequest
{
// The uid of the resource.
string
uid
=
1
;
}
message
GetResourceBinaryRequest
{
message
GetResourceBinaryRequest
{
// The name of the resource.
// The name of the resource.
// Format: resources/{id}
// Format: resources/{id}
...
...
proto/gen/api/v1/resource_service.pb.go
View file @
457cf92c
...
@@ -418,6 +418,54 @@ func (x *GetResourceRequest) GetName() string {
...
@@ -418,6 +418,54 @@ func (x *GetResourceRequest) GetName() string {
return
""
return
""
}
}
type
GetResourceByUidRequest
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
// The uid of the resource.
Uid
string
`protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
}
func
(
x
*
GetResourceByUidRequest
)
Reset
()
{
*
x
=
GetResourceByUidRequest
{}
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
7
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
}
func
(
x
*
GetResourceByUidRequest
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
GetResourceByUidRequest
)
ProtoMessage
()
{}
func
(
x
*
GetResourceByUidRequest
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
7
]
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 GetResourceByUidRequest.ProtoReflect.Descriptor instead.
func
(
*
GetResourceByUidRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
7
}
}
func
(
x
*
GetResourceByUidRequest
)
GetUid
()
string
{
if
x
!=
nil
{
return
x
.
Uid
}
return
""
}
type
GetResourceBinaryRequest
struct
{
type
GetResourceBinaryRequest
struct
{
state
protoimpl
.
MessageState
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
sizeCache
protoimpl
.
SizeCache
...
@@ -434,7 +482,7 @@ type GetResourceBinaryRequest struct {
...
@@ -434,7 +482,7 @@ type GetResourceBinaryRequest struct {
func
(
x
*
GetResourceBinaryRequest
)
Reset
()
{
func
(
x
*
GetResourceBinaryRequest
)
Reset
()
{
*
x
=
GetResourceBinaryRequest
{}
*
x
=
GetResourceBinaryRequest
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
7
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
8
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
ms
.
StoreMessageInfo
(
mi
)
}
}
...
@@ -447,7 +495,7 @@ func (x *GetResourceBinaryRequest) String() string {
...
@@ -447,7 +495,7 @@ func (x *GetResourceBinaryRequest) String() string {
func
(
*
GetResourceBinaryRequest
)
ProtoMessage
()
{}
func
(
*
GetResourceBinaryRequest
)
ProtoMessage
()
{}
func
(
x
*
GetResourceBinaryRequest
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
GetResourceBinaryRequest
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
7
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
8
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
if
ms
.
LoadMessageInfo
()
==
nil
{
...
@@ -460,7 +508,7 @@ func (x *GetResourceBinaryRequest) ProtoReflect() protoreflect.Message {
...
@@ -460,7 +508,7 @@ func (x *GetResourceBinaryRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetResourceBinaryRequest.ProtoReflect.Descriptor instead.
// Deprecated: Use GetResourceBinaryRequest.ProtoReflect.Descriptor instead.
func
(
*
GetResourceBinaryRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
GetResourceBinaryRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
7
}
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
8
}
}
}
func
(
x
*
GetResourceBinaryRequest
)
GetName
()
string
{
func
(
x
*
GetResourceBinaryRequest
)
GetName
()
string
{
...
@@ -489,7 +537,7 @@ type UpdateResourceRequest struct {
...
@@ -489,7 +537,7 @@ type UpdateResourceRequest struct {
func
(
x
*
UpdateResourceRequest
)
Reset
()
{
func
(
x
*
UpdateResourceRequest
)
Reset
()
{
*
x
=
UpdateResourceRequest
{}
*
x
=
UpdateResourceRequest
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
8
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
9
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
ms
.
StoreMessageInfo
(
mi
)
}
}
...
@@ -502,7 +550,7 @@ func (x *UpdateResourceRequest) String() string {
...
@@ -502,7 +550,7 @@ func (x *UpdateResourceRequest) String() string {
func
(
*
UpdateResourceRequest
)
ProtoMessage
()
{}
func
(
*
UpdateResourceRequest
)
ProtoMessage
()
{}
func
(
x
*
UpdateResourceRequest
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
UpdateResourceRequest
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
8
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
9
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
if
ms
.
LoadMessageInfo
()
==
nil
{
...
@@ -515,7 +563,7 @@ func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message {
...
@@ -515,7 +563,7 @@ func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateResourceRequest.ProtoReflect.Descriptor instead.
// Deprecated: Use UpdateResourceRequest.ProtoReflect.Descriptor instead.
func
(
*
UpdateResourceRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
UpdateResourceRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
8
}
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
9
}
}
}
func
(
x
*
UpdateResourceRequest
)
GetResource
()
*
Resource
{
func
(
x
*
UpdateResourceRequest
)
GetResource
()
*
Resource
{
...
@@ -546,7 +594,7 @@ type DeleteResourceRequest struct {
...
@@ -546,7 +594,7 @@ type DeleteResourceRequest struct {
func
(
x
*
DeleteResourceRequest
)
Reset
()
{
func
(
x
*
DeleteResourceRequest
)
Reset
()
{
*
x
=
DeleteResourceRequest
{}
*
x
=
DeleteResourceRequest
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
9
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
10
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
ms
.
StoreMessageInfo
(
mi
)
}
}
...
@@ -559,7 +607,7 @@ func (x *DeleteResourceRequest) String() string {
...
@@ -559,7 +607,7 @@ func (x *DeleteResourceRequest) String() string {
func
(
*
DeleteResourceRequest
)
ProtoMessage
()
{}
func
(
*
DeleteResourceRequest
)
ProtoMessage
()
{}
func
(
x
*
DeleteResourceRequest
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
DeleteResourceRequest
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
9
]
mi
:=
&
file_api_v1_resource_service_proto_msgTypes
[
10
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
if
ms
.
LoadMessageInfo
()
==
nil
{
...
@@ -572,7 +620,7 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message {
...
@@ -572,7 +620,7 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead.
// Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead.
func
(
*
DeleteResourceRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
DeleteResourceRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
9
}
return
file_api_v1_resource_service_proto_rawDescGZIP
(),
[]
int
{
10
}
}
}
func
(
x
*
DeleteResourceRequest
)
GetName
()
string
{
func
(
x
*
DeleteResourceRequest
)
GetName
()
string
{
...
@@ -641,92 +689,103 @@ var file_api_v1_resource_service_proto_rawDesc = []byte{
...
@@ -641,92 +689,103 @@ var file_api_v1_resource_service_proto_rawDesc = []byte{
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x22
,
0x28
,
0x0a
,
0x12
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x22
,
0x28
,
0x0a
,
0x12
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x22
,
0x4a
,
0x0a
,
0x18
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x6d
,
0x65
,
0x22
,
0x2b
,
0x0a
,
0x17
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x65
,
0x42
,
0x79
,
0x55
,
0x69
,
0x64
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x10
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x03
,
0x75
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x03
,
0x75
,
0x69
,
0x64
,
0x22
,
0x6d
,
0x65
,
0x12
,
0x1a
,
0x0a
,
0x08
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x02
,
0x4a
,
0x0a
,
0x18
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x08
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x22
,
0x88
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x01
,
0x0a
,
0x15
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x32
,
0x0a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x1a
,
0x0a
,
0x08
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x75
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x09
,
0x52
,
0x08
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x22
,
0x88
,
0x01
,
0x0a
,
0x15
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x3b
,
0x0a
,
0x0b
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x32
,
0x0a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x73
,
0x6b
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x0b
,
0x32
,
0x1a
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x62
,
0x75
,
0x66
,
0x2e
,
0x46
,
0x69
,
0x65
,
0x6c
,
0x64
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x52
,
0x0a
,
0x75
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x3b
,
0x0a
,
0x0b
,
0x75
,
0x70
,
0x64
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x22
,
0x2b
,
0x0a
,
0x15
,
0x44
,
0x65
,
0x6c
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x73
,
0x6b
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x1a
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x62
,
0x75
,
0x66
,
0x73
,
0x74
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x2e
,
0x46
,
0x69
,
0x65
,
0x6c
,
0x64
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x52
,
0x0a
,
0x75
,
0x70
,
0x64
,
0x61
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x32
,
0x9a
,
0x07
,
0x0a
,
0x0f
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x74
,
0x65
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x22
,
0x2b
,
0x0a
,
0x15
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x72
,
0x0a
,
0x0e
,
0x43
,
0x72
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x61
,
0x6d
,
0x65
,
0x32
,
0x9b
,
0x08
,
0x0a
,
0x0f
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x72
,
0x0a
,
0x0e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x23
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1d
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x73
,
0x0a
,
0x0d
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x22
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x19
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x13
,
0x12
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x80
,
0x01
,
0x0a
,
0x0f
,
0x53
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x25
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x20
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1a
,
0x12
,
0x18
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x3a
,
0x73
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x12
,
0x72
,
0x0a
,
0x0b
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x20
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x29
,
0xda
,
0x41
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1c
,
0x12
,
0x1a
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x12
,
0x7f
,
0x0a
,
0x10
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x79
,
0x55
,
0x69
,
0x64
,
0x12
,
0x25
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x79
,
0x55
,
0x69
,
0x64
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x2c
,
0xda
,
0x41
,
0x03
,
0x75
,
0x69
,
0x64
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x20
,
0x12
,
0x1e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x3a
,
0x62
,
0x79
,
0x2d
,
0x75
,
0x69
,
0x64
,
0x2f
,
0x7b
,
0x75
,
0x69
,
0x64
,
0x7d
,
0x12
,
0x8e
,
0x01
,
0x0a
,
0x11
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x12
,
0x26
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x14
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x48
,
0x74
,
0x74
,
0x70
,
0x42
,
0x6f
,
0x64
,
0x79
,
0x22
,
0x3b
,
0xda
,
0x41
,
0x0d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x2c
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x25
,
0x12
,
0x23
,
0x2f
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x2f
,
0x7b
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x2f
,
0x7b
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x7d
,
0x12
,
0x9b
,
0x01
,
0x0a
,
0x0e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x23
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x4c
,
0xda
,
0x41
,
0x14
,
0x72
,
0x65
,
0x1d
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2c
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x73
,
0x73
,
0x6b
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x2f
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x0a
,
0x0d
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x63
,
0x65
,
0x32
,
0x23
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x72
,
0x65
,
0x73
,
0x22
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x4c
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2e
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x12
,
0x78
,
0x0a
,
0x0e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x76
,
0x31
,
0x2e
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x19
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x13
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x12
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x62
,
0x75
,
0x66
,
0x63
,
0x65
,
0x73
,
0x12
,
0x80
,
0x01
,
0x0a
,
0x0f
,
0x53
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x2e
,
0x45
,
0x6d
,
0x70
,
0x74
,
0x79
,
0x22
,
0x29
,
0xda
,
0x41
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1c
,
0x2a
,
0x1a
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x73
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x25
,
0x2e
,
0x7d
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x65
,
0x61
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x42
,
0x14
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x72
,
0x63
,
0x68
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x20
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1a
,
0x12
,
0x18
,
0x2f
,
0x61
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x3a
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x73
,
0x65
,
0x61
,
0x72
,
0x63
,
0x68
,
0x12
,
0x72
,
0x0a
,
0x0b
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x31
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x20
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x31
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x69
,
0x5c
,
0x56
,
0x31
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x5c
,
0x56
,
0x31
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x29
,
0xda
,
0x41
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1c
,
0x12
,
0x1a
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x31
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x12
,
0x8e
,
0x01
,
0x0a
,
0x11
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x12
,
0x26
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x42
,
0x69
,
0x6e
,
0x61
,
0x72
,
0x79
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x14
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x48
,
0x74
,
0x74
,
0x70
,
0x42
,
0x6f
,
0x64
,
0x79
,
0x22
,
0x3b
,
0xda
,
0x41
,
0x0d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x2c
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x25
,
0x12
,
0x23
,
0x2f
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x2f
,
0x7b
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x2f
,
0x7b
,
0x66
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x7d
,
0x12
,
0x9b
,
0x01
,
0x0a
,
0x0e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x4c
,
0xda
,
0x41
,
0x14
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2c
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x73
,
0x6b
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x2f
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x32
,
0x23
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2e
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x12
,
0x78
,
0x0a
,
0x0e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x16
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x62
,
0x75
,
0x66
,
0x2e
,
0x45
,
0x6d
,
0x70
,
0x74
,
0x79
,
0x22
,
0x29
,
0xda
,
0x41
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1c
,
0x2a
,
0x1a
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x7b
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x2a
,
0x7d
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x42
,
0x14
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x31
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x31
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x31
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x31
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x31
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
}
var
(
var
(
...
@@ -741,7 +800,7 @@ func file_api_v1_resource_service_proto_rawDescGZIP() []byte {
...
@@ -741,7 +800,7 @@ func file_api_v1_resource_service_proto_rawDescGZIP() []byte {
return
file_api_v1_resource_service_proto_rawDescData
return
file_api_v1_resource_service_proto_rawDescData
}
}
var
file_api_v1_resource_service_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
1
0
)
var
file_api_v1_resource_service_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
1
1
)
var
file_api_v1_resource_service_proto_goTypes
=
[]
any
{
var
file_api_v1_resource_service_proto_goTypes
=
[]
any
{
(
*
Resource
)(
nil
),
// 0: memos.api.v1.Resource
(
*
Resource
)(
nil
),
// 0: memos.api.v1.Resource
(
*
CreateResourceRequest
)(
nil
),
// 1: memos.api.v1.CreateResourceRequest
(
*
CreateResourceRequest
)(
nil
),
// 1: memos.api.v1.CreateResourceRequest
...
@@ -750,37 +809,40 @@ var file_api_v1_resource_service_proto_goTypes = []any{
...
@@ -750,37 +809,40 @@ var file_api_v1_resource_service_proto_goTypes = []any{
(
*
SearchResourcesRequest
)(
nil
),
// 4: memos.api.v1.SearchResourcesRequest
(
*
SearchResourcesRequest
)(
nil
),
// 4: memos.api.v1.SearchResourcesRequest
(
*
SearchResourcesResponse
)(
nil
),
// 5: memos.api.v1.SearchResourcesResponse
(
*
SearchResourcesResponse
)(
nil
),
// 5: memos.api.v1.SearchResourcesResponse
(
*
GetResourceRequest
)(
nil
),
// 6: memos.api.v1.GetResourceRequest
(
*
GetResourceRequest
)(
nil
),
// 6: memos.api.v1.GetResourceRequest
(
*
GetResourceBinaryRequest
)(
nil
),
// 7: memos.api.v1.GetResourceBinaryRequest
(
*
GetResourceByUidRequest
)(
nil
),
// 7: memos.api.v1.GetResourceByUidRequest
(
*
UpdateResourceRequest
)(
nil
),
// 8: memos.api.v1.UpdateResourceRequest
(
*
GetResourceBinaryRequest
)(
nil
),
// 8: memos.api.v1.GetResourceBinaryRequest
(
*
DeleteResourceRequest
)(
nil
),
// 9: memos.api.v1.DeleteResourceRequest
(
*
UpdateResourceRequest
)(
nil
),
// 9: memos.api.v1.UpdateResourceRequest
(
*
timestamppb
.
Timestamp
)(
nil
),
// 10: google.protobuf.Timestamp
(
*
DeleteResourceRequest
)(
nil
),
// 10: memos.api.v1.DeleteResourceRequest
(
*
fieldmaskpb
.
FieldMask
)(
nil
),
// 11: google.protobuf.FieldMask
(
*
timestamppb
.
Timestamp
)(
nil
),
// 11: google.protobuf.Timestamp
(
*
httpbody
.
HttpBody
)(
nil
),
// 12: google.api.HttpBody
(
*
fieldmaskpb
.
FieldMask
)(
nil
),
// 12: google.protobuf.FieldMask
(
*
emptypb
.
Empty
)(
nil
),
// 13: google.protobuf.Empty
(
*
httpbody
.
HttpBody
)(
nil
),
// 13: google.api.HttpBody
(
*
emptypb
.
Empty
)(
nil
),
// 14: google.protobuf.Empty
}
}
var
file_api_v1_resource_service_proto_depIdxs
=
[]
int32
{
var
file_api_v1_resource_service_proto_depIdxs
=
[]
int32
{
1
0
,
// 0: memos.api.v1.Resource.create_time:type_name -> google.protobuf.Timestamp
1
1
,
// 0: memos.api.v1.Resource.create_time:type_name -> google.protobuf.Timestamp
0
,
// 1: memos.api.v1.CreateResourceRequest.resource:type_name -> memos.api.v1.Resource
0
,
// 1: memos.api.v1.CreateResourceRequest.resource:type_name -> memos.api.v1.Resource
0
,
// 2: memos.api.v1.ListResourcesResponse.resources:type_name -> memos.api.v1.Resource
0
,
// 2: memos.api.v1.ListResourcesResponse.resources:type_name -> memos.api.v1.Resource
0
,
// 3: memos.api.v1.SearchResourcesResponse.resources:type_name -> memos.api.v1.Resource
0
,
// 3: memos.api.v1.SearchResourcesResponse.resources:type_name -> memos.api.v1.Resource
0
,
// 4: memos.api.v1.UpdateResourceRequest.resource:type_name -> memos.api.v1.Resource
0
,
// 4: memos.api.v1.UpdateResourceRequest.resource:type_name -> memos.api.v1.Resource
1
1
,
// 5: memos.api.v1.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask
1
2
,
// 5: memos.api.v1.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask
1
,
// 6: memos.api.v1.ResourceService.CreateResource:input_type -> memos.api.v1.CreateResourceRequest
1
,
// 6: memos.api.v1.ResourceService.CreateResource:input_type -> memos.api.v1.CreateResourceRequest
2
,
// 7: memos.api.v1.ResourceService.ListResources:input_type -> memos.api.v1.ListResourcesRequest
2
,
// 7: memos.api.v1.ResourceService.ListResources:input_type -> memos.api.v1.ListResourcesRequest
4
,
// 8: memos.api.v1.ResourceService.SearchResources:input_type -> memos.api.v1.SearchResourcesRequest
4
,
// 8: memos.api.v1.ResourceService.SearchResources:input_type -> memos.api.v1.SearchResourcesRequest
6
,
// 9: memos.api.v1.ResourceService.GetResource:input_type -> memos.api.v1.GetResourceRequest
6
,
// 9: memos.api.v1.ResourceService.GetResource:input_type -> memos.api.v1.GetResourceRequest
7
,
// 10: memos.api.v1.ResourceService.GetResourceBinary:input_type -> memos.api.v1.GetResourceBinaryRequest
7
,
// 10: memos.api.v1.ResourceService.GetResourceByUid:input_type -> memos.api.v1.GetResourceByUidRequest
8
,
// 11: memos.api.v1.ResourceService.UpdateResource:input_type -> memos.api.v1.UpdateResourceRequest
8
,
// 11: memos.api.v1.ResourceService.GetResourceBinary:input_type -> memos.api.v1.GetResourceBinaryRequest
9
,
// 12: memos.api.v1.ResourceService.DeleteResource:input_type -> memos.api.v1.DeleteResourceRequest
9
,
// 12: memos.api.v1.ResourceService.UpdateResource:input_type -> memos.api.v1.UpdateResourceRequest
0
,
// 13: memos.api.v1.ResourceService.CreateResource:output_type -> memos.api.v1.Resource
10
,
// 13: memos.api.v1.ResourceService.DeleteResource:input_type -> memos.api.v1.DeleteResourceRequest
3
,
// 14: memos.api.v1.ResourceService.ListResources:output_type -> memos.api.v1.ListResourcesResponse
0
,
// 14: memos.api.v1.ResourceService.CreateResource:output_type -> memos.api.v1.Resource
5
,
// 15: memos.api.v1.ResourceService.SearchResources:output_type -> memos.api.v1.SearchResourcesResponse
3
,
// 15: memos.api.v1.ResourceService.ListResources:output_type -> memos.api.v1.ListResourcesResponse
0
,
// 16: memos.api.v1.ResourceService.GetResource:output_type -> memos.api.v1.Resource
5
,
// 16: memos.api.v1.ResourceService.SearchResources:output_type -> memos.api.v1.SearchResourcesResponse
12
,
// 17: memos.api.v1.ResourceService.GetResourceBinary:output_type -> google.api.HttpBody
0
,
// 17: memos.api.v1.ResourceService.GetResource:output_type -> memos.api.v1.Resource
0
,
// 18: memos.api.v1.ResourceService.UpdateResource:output_type -> memos.api.v1.Resource
0
,
// 18: memos.api.v1.ResourceService.GetResourceByUid:output_type -> memos.api.v1.Resource
13
,
// 19: memos.api.v1.ResourceService.DeleteResource:output_type -> google.protobuf.Empty
13
,
// 19: memos.api.v1.ResourceService.GetResourceBinary:output_type -> google.api.HttpBody
13
,
// [13:20] is the sub-list for method output_type
0
,
// 20: memos.api.v1.ResourceService.UpdateResource:output_type -> memos.api.v1.Resource
6
,
// [6:13] is the sub-list for method input_type
14
,
// 21: memos.api.v1.ResourceService.DeleteResource:output_type -> google.protobuf.Empty
14
,
// [14:22] is the sub-list for method output_type
6
,
// [6:14] is the sub-list for method input_type
6
,
// [6:6] is the sub-list for extension type_name
6
,
// [6:6] is the sub-list for extension type_name
6
,
// [6:6] is the sub-list for extension extendee
6
,
// [6:6] is the sub-list for extension extendee
0
,
// [0:6] is the sub-list for field type_name
0
,
// [0:6] is the sub-list for field type_name
...
@@ -877,7 +939,7 @@ func file_api_v1_resource_service_proto_init() {
...
@@ -877,7 +939,7 @@ func file_api_v1_resource_service_proto_init() {
}
}
}
}
file_api_v1_resource_service_proto_msgTypes
[
7
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
file_api_v1_resource_service_proto_msgTypes
[
7
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
switch
v
:=
v
.
(
*
GetResourceB
inary
Request
);
i
{
switch
v
:=
v
.
(
*
GetResourceB
yUid
Request
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -889,7 +951,7 @@ func file_api_v1_resource_service_proto_init() {
...
@@ -889,7 +951,7 @@ func file_api_v1_resource_service_proto_init() {
}
}
}
}
file_api_v1_resource_service_proto_msgTypes
[
8
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
file_api_v1_resource_service_proto_msgTypes
[
8
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
switch
v
:=
v
.
(
*
UpdateResource
Request
);
i
{
switch
v
:=
v
.
(
*
GetResourceBinary
Request
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -901,6 +963,18 @@ func file_api_v1_resource_service_proto_init() {
...
@@ -901,6 +963,18 @@ func file_api_v1_resource_service_proto_init() {
}
}
}
}
file_api_v1_resource_service_proto_msgTypes
[
9
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
file_api_v1_resource_service_proto_msgTypes
[
9
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
switch
v
:=
v
.
(
*
UpdateResourceRequest
);
i
{
case
0
:
return
&
v
.
state
case
1
:
return
&
v
.
sizeCache
case
2
:
return
&
v
.
unknownFields
default
:
return
nil
}
}
file_api_v1_resource_service_proto_msgTypes
[
10
]
.
Exporter
=
func
(
v
any
,
i
int
)
any
{
switch
v
:=
v
.
(
*
DeleteResourceRequest
);
i
{
switch
v
:=
v
.
(
*
DeleteResourceRequest
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
...
@@ -920,7 +994,7 @@ func file_api_v1_resource_service_proto_init() {
...
@@ -920,7 +994,7 @@ func file_api_v1_resource_service_proto_init() {
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
RawDescriptor
:
file_api_v1_resource_service_proto_rawDesc
,
RawDescriptor
:
file_api_v1_resource_service_proto_rawDesc
,
NumEnums
:
0
,
NumEnums
:
0
,
NumMessages
:
1
0
,
NumMessages
:
1
1
,
NumExtensions
:
0
,
NumExtensions
:
0
,
NumServices
:
1
,
NumServices
:
1
,
},
},
...
...
proto/gen/api/v1/resource_service.pb.gw.go
View file @
457cf92c
...
@@ -163,6 +163,58 @@ func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler
...
@@ -163,6 +163,58 @@ func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler
}
}
func
request_ResourceService_GetResourceByUid_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
ResourceServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
protoReq
GetResourceByUidRequest
var
metadata
runtime
.
ServerMetadata
var
(
val
string
ok
bool
err
error
_
=
err
)
val
,
ok
=
pathParams
[
"uid"
]
if
!
ok
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"missing parameter %s"
,
"uid"
)
}
protoReq
.
Uid
,
err
=
runtime
.
String
(
val
)
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"uid"
,
err
)
}
msg
,
err
:=
client
.
GetResourceByUid
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
func
local_request_ResourceService_GetResourceByUid_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
server
ResourceServiceServer
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
protoReq
GetResourceByUidRequest
var
metadata
runtime
.
ServerMetadata
var
(
val
string
ok
bool
err
error
_
=
err
)
val
,
ok
=
pathParams
[
"uid"
]
if
!
ok
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"missing parameter %s"
,
"uid"
)
}
protoReq
.
Uid
,
err
=
runtime
.
String
(
val
)
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"uid"
,
err
)
}
msg
,
err
:=
server
.
GetResourceByUid
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
func
request_ResourceService_GetResourceBinary_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
ResourceServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
func
request_ResourceService_GetResourceBinary_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
ResourceServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
protoReq
GetResourceBinaryRequest
var
protoReq
GetResourceBinaryRequest
var
metadata
runtime
.
ServerMetadata
var
metadata
runtime
.
ServerMetadata
...
@@ -493,6 +545,31 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
...
@@ -493,6 +545,31 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceByUid_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
defer
cancel
()
var
stream
runtime
.
ServerTransportStream
ctx
=
grpc
.
NewContextWithServerTransportStream
(
ctx
,
&
stream
)
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
var
err
error
var
annotatedContext
context
.
Context
annotatedContext
,
err
=
runtime
.
AnnotateIncomingContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.ResourceService/GetResourceByUid"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/resources:by-uid/{uid}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
resp
,
md
,
err
:=
local_request_ResourceService_GetResourceByUid_0
(
annotatedContext
,
inboundMarshaler
,
server
,
req
,
pathParams
)
md
.
HeaderMD
,
md
.
TrailerMD
=
metadata
.
Join
(
md
.
HeaderMD
,
stream
.
Header
()),
metadata
.
Join
(
md
.
TrailerMD
,
stream
.
Trailer
())
annotatedContext
=
runtime
.
NewServerMetadataContext
(
annotatedContext
,
md
)
if
err
!=
nil
{
runtime
.
HTTPError
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
forward_ResourceService_GetResourceByUid_0
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
resp
,
mux
.
GetForwardResponseOptions
()
...
)
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceBinary_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceBinary_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
defer
cancel
()
defer
cancel
()
...
@@ -697,6 +774,28 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
...
@@ -697,6 +774,28 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceByUid_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
defer
cancel
()
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
var
err
error
var
annotatedContext
context
.
Context
annotatedContext
,
err
=
runtime
.
AnnotateContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.ResourceService/GetResourceByUid"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/resources:by-uid/{uid}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
resp
,
md
,
err
:=
request_ResourceService_GetResourceByUid_0
(
annotatedContext
,
inboundMarshaler
,
client
,
req
,
pathParams
)
annotatedContext
=
runtime
.
NewServerMetadataContext
(
annotatedContext
,
md
)
if
err
!=
nil
{
runtime
.
HTTPError
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
forward_ResourceService_GetResourceByUid_0
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
resp
,
mux
.
GetForwardResponseOptions
()
...
)
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceBinary_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResourceBinary_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
defer
cancel
()
defer
cancel
()
...
@@ -775,6 +874,8 @@ var (
...
@@ -775,6 +874,8 @@ var (
pattern_ResourceService_GetResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
2
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"resources"
,
"name"
},
""
))
pattern_ResourceService_GetResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
2
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"resources"
,
"name"
},
""
))
pattern_ResourceService_GetResourceByUid_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"resources:by-uid"
,
"uid"
},
""
))
pattern_ResourceService_GetResourceBinary_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
1
,
0
,
4
,
2
,
5
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"file"
,
"resources"
,
"name"
,
"filename"
},
""
))
pattern_ResourceService_GetResourceBinary_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
1
,
0
,
4
,
2
,
5
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"file"
,
"resources"
,
"name"
,
"filename"
},
""
))
pattern_ResourceService_UpdateResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
2
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"resources"
,
"resource.name"
},
""
))
pattern_ResourceService_UpdateResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
2
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"resources"
,
"resource.name"
},
""
))
...
@@ -791,6 +892,8 @@ var (
...
@@ -791,6 +892,8 @@ var (
forward_ResourceService_GetResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_GetResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_GetResourceByUid_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_GetResourceBinary_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_GetResourceBinary_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_UpdateResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_UpdateResource_0
=
runtime
.
ForwardResponseMessage
...
...
proto/gen/api/v1/resource_service_grpc.pb.go
View file @
457cf92c
...
@@ -25,6 +25,7 @@ const (
...
@@ -25,6 +25,7 @@ const (
ResourceService_ListResources_FullMethodName
=
"/memos.api.v1.ResourceService/ListResources"
ResourceService_ListResources_FullMethodName
=
"/memos.api.v1.ResourceService/ListResources"
ResourceService_SearchResources_FullMethodName
=
"/memos.api.v1.ResourceService/SearchResources"
ResourceService_SearchResources_FullMethodName
=
"/memos.api.v1.ResourceService/SearchResources"
ResourceService_GetResource_FullMethodName
=
"/memos.api.v1.ResourceService/GetResource"
ResourceService_GetResource_FullMethodName
=
"/memos.api.v1.ResourceService/GetResource"
ResourceService_GetResourceByUid_FullMethodName
=
"/memos.api.v1.ResourceService/GetResourceByUid"
ResourceService_GetResourceBinary_FullMethodName
=
"/memos.api.v1.ResourceService/GetResourceBinary"
ResourceService_GetResourceBinary_FullMethodName
=
"/memos.api.v1.ResourceService/GetResourceBinary"
ResourceService_UpdateResource_FullMethodName
=
"/memos.api.v1.ResourceService/UpdateResource"
ResourceService_UpdateResource_FullMethodName
=
"/memos.api.v1.ResourceService/UpdateResource"
ResourceService_DeleteResource_FullMethodName
=
"/memos.api.v1.ResourceService/DeleteResource"
ResourceService_DeleteResource_FullMethodName
=
"/memos.api.v1.ResourceService/DeleteResource"
...
@@ -42,6 +43,8 @@ type ResourceServiceClient interface {
...
@@ -42,6 +43,8 @@ type ResourceServiceClient interface {
SearchResources
(
ctx
context
.
Context
,
in
*
SearchResourcesRequest
,
opts
...
grpc
.
CallOption
)
(
*
SearchResourcesResponse
,
error
)
SearchResources
(
ctx
context
.
Context
,
in
*
SearchResourcesRequest
,
opts
...
grpc
.
CallOption
)
(
*
SearchResourcesResponse
,
error
)
// GetResource returns a resource by name.
// GetResource returns a resource by name.
GetResource
(
ctx
context
.
Context
,
in
*
GetResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
Resource
,
error
)
GetResource
(
ctx
context
.
Context
,
in
*
GetResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
Resource
,
error
)
// GetResourceByUid returns a resource by uid.
GetResourceByUid
(
ctx
context
.
Context
,
in
*
GetResourceByUidRequest
,
opts
...
grpc
.
CallOption
)
(
*
Resource
,
error
)
// GetResourceBinary returns a resource binary by name.
// GetResourceBinary returns a resource binary by name.
GetResourceBinary
(
ctx
context
.
Context
,
in
*
GetResourceBinaryRequest
,
opts
...
grpc
.
CallOption
)
(
*
httpbody
.
HttpBody
,
error
)
GetResourceBinary
(
ctx
context
.
Context
,
in
*
GetResourceBinaryRequest
,
opts
...
grpc
.
CallOption
)
(
*
httpbody
.
HttpBody
,
error
)
// UpdateResource updates a resource.
// UpdateResource updates a resource.
...
@@ -98,6 +101,16 @@ func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResource
...
@@ -98,6 +101,16 @@ func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResource
return
out
,
nil
return
out
,
nil
}
}
func
(
c
*
resourceServiceClient
)
GetResourceByUid
(
ctx
context
.
Context
,
in
*
GetResourceByUidRequest
,
opts
...
grpc
.
CallOption
)
(
*
Resource
,
error
)
{
cOpts
:=
append
([]
grpc
.
CallOption
{
grpc
.
StaticMethod
()},
opts
...
)
out
:=
new
(
Resource
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
ResourceService_GetResourceByUid_FullMethodName
,
in
,
out
,
cOpts
...
)
if
err
!=
nil
{
return
nil
,
err
}
return
out
,
nil
}
func
(
c
*
resourceServiceClient
)
GetResourceBinary
(
ctx
context
.
Context
,
in
*
GetResourceBinaryRequest
,
opts
...
grpc
.
CallOption
)
(
*
httpbody
.
HttpBody
,
error
)
{
func
(
c
*
resourceServiceClient
)
GetResourceBinary
(
ctx
context
.
Context
,
in
*
GetResourceBinaryRequest
,
opts
...
grpc
.
CallOption
)
(
*
httpbody
.
HttpBody
,
error
)
{
cOpts
:=
append
([]
grpc
.
CallOption
{
grpc
.
StaticMethod
()},
opts
...
)
cOpts
:=
append
([]
grpc
.
CallOption
{
grpc
.
StaticMethod
()},
opts
...
)
out
:=
new
(
httpbody
.
HttpBody
)
out
:=
new
(
httpbody
.
HttpBody
)
...
@@ -140,6 +153,8 @@ type ResourceServiceServer interface {
...
@@ -140,6 +153,8 @@ type ResourceServiceServer interface {
SearchResources
(
context
.
Context
,
*
SearchResourcesRequest
)
(
*
SearchResourcesResponse
,
error
)
SearchResources
(
context
.
Context
,
*
SearchResourcesRequest
)
(
*
SearchResourcesResponse
,
error
)
// GetResource returns a resource by name.
// GetResource returns a resource by name.
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
Resource
,
error
)
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
Resource
,
error
)
// GetResourceByUid returns a resource by uid.
GetResourceByUid
(
context
.
Context
,
*
GetResourceByUidRequest
)
(
*
Resource
,
error
)
// GetResourceBinary returns a resource binary by name.
// GetResourceBinary returns a resource binary by name.
GetResourceBinary
(
context
.
Context
,
*
GetResourceBinaryRequest
)
(
*
httpbody
.
HttpBody
,
error
)
GetResourceBinary
(
context
.
Context
,
*
GetResourceBinaryRequest
)
(
*
httpbody
.
HttpBody
,
error
)
// UpdateResource updates a resource.
// UpdateResource updates a resource.
...
@@ -165,6 +180,9 @@ func (UnimplementedResourceServiceServer) SearchResources(context.Context, *Sear
...
@@ -165,6 +180,9 @@ func (UnimplementedResourceServiceServer) SearchResources(context.Context, *Sear
func
(
UnimplementedResourceServiceServer
)
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
Resource
,
error
)
{
func
(
UnimplementedResourceServiceServer
)
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
Resource
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResource not implemented"
)
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResource not implemented"
)
}
}
func
(
UnimplementedResourceServiceServer
)
GetResourceByUid
(
context
.
Context
,
*
GetResourceByUidRequest
)
(
*
Resource
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResourceByUid not implemented"
)
}
func
(
UnimplementedResourceServiceServer
)
GetResourceBinary
(
context
.
Context
,
*
GetResourceBinaryRequest
)
(
*
httpbody
.
HttpBody
,
error
)
{
func
(
UnimplementedResourceServiceServer
)
GetResourceBinary
(
context
.
Context
,
*
GetResourceBinaryRequest
)
(
*
httpbody
.
HttpBody
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResourceBinary not implemented"
)
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResourceBinary not implemented"
)
}
}
...
@@ -259,6 +277,24 @@ func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context,
...
@@ -259,6 +277,24 @@ func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context,
return
interceptor
(
ctx
,
in
,
info
,
handler
)
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
}
func
_ResourceService_GetResourceByUid_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
GetResourceByUidRequest
)
if
err
:=
dec
(
in
);
err
!=
nil
{
return
nil
,
err
}
if
interceptor
==
nil
{
return
srv
.
(
ResourceServiceServer
)
.
GetResourceByUid
(
ctx
,
in
)
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
ResourceService_GetResourceByUid_FullMethodName
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
ResourceServiceServer
)
.
GetResourceByUid
(
ctx
,
req
.
(
*
GetResourceByUidRequest
))
}
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
func
_ResourceService_GetResourceBinary_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
func
_ResourceService_GetResourceBinary_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
GetResourceBinaryRequest
)
in
:=
new
(
GetResourceBinaryRequest
)
if
err
:=
dec
(
in
);
err
!=
nil
{
if
err
:=
dec
(
in
);
err
!=
nil
{
...
@@ -336,6 +372,10 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{
...
@@ -336,6 +372,10 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{
MethodName
:
"GetResource"
,
MethodName
:
"GetResource"
,
Handler
:
_ResourceService_GetResource_Handler
,
Handler
:
_ResourceService_GetResource_Handler
,
},
},
{
MethodName
:
"GetResourceByUid"
,
Handler
:
_ResourceService_GetResourceByUid_Handler
,
},
{
{
MethodName
:
"GetResourceBinary"
,
MethodName
:
"GetResourceBinary"
,
Handler
:
_ResourceService_GetResourceBinary_Handler
,
Handler
:
_ResourceService_GetResourceBinary_Handler
,
...
...
server/router/api/v1/resource_service.go
View file @
457cf92c
...
@@ -111,8 +111,8 @@ func (s *APIV1Service) SearchResources(ctx context.Context, request *v1pb.Search
...
@@ -111,8 +111,8 @@ func (s *APIV1Service) SearchResources(ctx context.Context, request *v1pb.Search
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"failed to parse filter: %v"
,
err
)
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"failed to parse filter: %v"
,
err
)
}
}
resourceFind
:=
&
store
.
FindResource
{}
resourceFind
:=
&
store
.
FindResource
{}
if
filter
.
UID
!=
nil
{
if
filter
.
Filename
!=
nil
{
resourceFind
.
UID
=
filter
.
UID
resourceFind
.
FilenameSearch
=
filter
.
Filename
}
}
user
,
err
:=
s
.
GetCurrentUser
(
ctx
)
user
,
err
:=
s
.
GetCurrentUser
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -145,7 +145,19 @@ func (s *APIV1Service) GetResource(ctx context.Context, request *v1pb.GetResourc
...
@@ -145,7 +145,19 @@ func (s *APIV1Service) GetResource(ctx context.Context, request *v1pb.GetResourc
if
resource
==
nil
{
if
resource
==
nil
{
return
nil
,
status
.
Errorf
(
codes
.
NotFound
,
"resource not found"
)
return
nil
,
status
.
Errorf
(
codes
.
NotFound
,
"resource not found"
)
}
}
return
s
.
convertResourceFromStore
(
ctx
,
resource
),
nil
}
func
(
s
*
APIV1Service
)
GetResourceByUid
(
ctx
context
.
Context
,
request
*
v1pb
.
GetResourceByUidRequest
)
(
*
v1pb
.
Resource
,
error
)
{
resource
,
err
:=
s
.
Store
.
GetResource
(
ctx
,
&
store
.
FindResource
{
UID
:
&
request
.
Uid
,
})
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get resource: %v"
,
err
)
}
if
resource
==
nil
{
return
nil
,
status
.
Errorf
(
codes
.
NotFound
,
"resource not found"
)
}
return
s
.
convertResourceFromStore
(
ctx
,
resource
),
nil
return
s
.
convertResourceFromStore
(
ctx
,
resource
),
nil
}
}
...
@@ -427,11 +439,11 @@ func replaceFilenameWithPathTemplate(path, filename string) string {
...
@@ -427,11 +439,11 @@ func replaceFilenameWithPathTemplate(path, filename string) string {
// SearchResourcesFilterCELAttributes are the CEL attributes for SearchResourcesFilter.
// SearchResourcesFilterCELAttributes are the CEL attributes for SearchResourcesFilter.
var
SearchResourcesFilterCELAttributes
=
[]
cel
.
EnvOption
{
var
SearchResourcesFilterCELAttributes
=
[]
cel
.
EnvOption
{
cel
.
Variable
(
"
uid
"
,
cel
.
StringType
),
cel
.
Variable
(
"
filename
"
,
cel
.
StringType
),
}
}
type
SearchResourcesFilter
struct
{
type
SearchResourcesFilter
struct
{
UID
*
string
Filename
*
string
}
}
func
parseSearchResourcesFilter
(
expression
string
)
(
*
SearchResourcesFilter
,
error
)
{
func
parseSearchResourcesFilter
(
expression
string
)
(
*
SearchResourcesFilter
,
error
)
{
...
@@ -457,9 +469,9 @@ func findSearchResourcesField(callExpr *expr.Expr_Call, filter *SearchResourcesF
...
@@ -457,9 +469,9 @@ func findSearchResourcesField(callExpr *expr.Expr_Call, filter *SearchResourcesF
if
len
(
callExpr
.
Args
)
==
2
{
if
len
(
callExpr
.
Args
)
==
2
{
idExpr
:=
callExpr
.
Args
[
0
]
.
GetIdentExpr
()
idExpr
:=
callExpr
.
Args
[
0
]
.
GetIdentExpr
()
if
idExpr
!=
nil
{
if
idExpr
!=
nil
{
if
idExpr
.
Name
==
"
uid
"
{
if
idExpr
.
Name
==
"
filename
"
{
uid
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetStringValue
()
filename
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetStringValue
()
filter
.
UID
=
&
uid
filter
.
Filename
=
&
filename
}
}
return
return
}
}
...
...
store/db/mysql/resource.go
View file @
457cf92c
...
@@ -60,6 +60,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
...
@@ -60,6 +60,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
if
v
:=
find
.
Filename
;
v
!=
nil
{
if
v
:=
find
.
Filename
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`filename` = ?"
),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"`filename` = ?"
),
append
(
args
,
*
v
)
}
}
if
v
:=
find
.
FilenameSearch
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`filename` LIKE ?"
),
append
(
args
,
"%"
+*
v
+
"%"
)
}
if
v
:=
find
.
MemoID
;
v
!=
nil
{
if
v
:=
find
.
MemoID
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`memo_id` = ?"
),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"`memo_id` = ?"
),
append
(
args
,
*
v
)
}
}
...
...
store/db/postgres/resource.go
View file @
457cf92c
...
@@ -51,6 +51,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
...
@@ -51,6 +51,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
if
v
:=
find
.
Filename
;
v
!=
nil
{
if
v
:=
find
.
Filename
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"filename = "
+
placeholder
(
len
(
args
)
+
1
)),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"filename = "
+
placeholder
(
len
(
args
)
+
1
)),
append
(
args
,
*
v
)
}
}
if
v
:=
find
.
FilenameSearch
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"filename LIKE "
+
placeholder
(
len
(
args
)
+
1
)),
append
(
args
,
fmt
.
Sprintf
(
"%%%s%%"
,
*
v
))
}
if
v
:=
find
.
MemoID
;
v
!=
nil
{
if
v
:=
find
.
MemoID
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"memo_id = "
+
placeholder
(
len
(
args
)
+
1
)),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"memo_id = "
+
placeholder
(
len
(
args
)
+
1
)),
append
(
args
,
*
v
)
}
}
...
...
store/db/sqlite/resource.go
View file @
457cf92c
...
@@ -53,6 +53,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
...
@@ -53,6 +53,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
if
v
:=
find
.
Filename
;
v
!=
nil
{
if
v
:=
find
.
Filename
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`filename` = ?"
),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"`filename` = ?"
),
append
(
args
,
*
v
)
}
}
if
v
:=
find
.
FilenameSearch
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`filename` LIKE ?"
),
append
(
args
,
fmt
.
Sprintf
(
"%%%s%%"
,
*
v
))
}
if
v
:=
find
.
MemoID
;
v
!=
nil
{
if
v
:=
find
.
MemoID
;
v
!=
nil
{
where
,
args
=
append
(
where
,
"`memo_id` = ?"
),
append
(
args
,
*
v
)
where
,
args
=
append
(
where
,
"`memo_id` = ?"
),
append
(
args
,
*
v
)
}
}
...
...
store/resource.go
View file @
457cf92c
...
@@ -43,6 +43,7 @@ type FindResource struct {
...
@@ -43,6 +43,7 @@ type FindResource struct {
UID
*
string
UID
*
string
CreatorID
*
int32
CreatorID
*
int32
Filename
*
string
Filename
*
string
FilenameSearch
*
string
MemoID
*
int32
MemoID
*
int32
HasRelatedMemo
bool
HasRelatedMemo
bool
StorageType
*
storepb
.
ResourceStorageType
StorageType
*
storepb
.
ResourceStorageType
...
...
web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx
View file @
457cf92c
...
@@ -35,21 +35,21 @@ const getAdditionalClassNameWithParams = (params: URLSearchParams) => {
...
@@ -35,21 +35,21 @@ const getAdditionalClassNameWithParams = (params: URLSearchParams) => {
return
additionalClassNames
.
join
(
" "
);
return
additionalClassNames
.
join
(
" "
);
};
};
const
EmbeddedResource
=
({
resourceId
,
params
:
paramsStr
}:
Props
)
=>
{
const
EmbeddedResource
=
({
resourceId
:
uid
,
params
:
paramsStr
}:
Props
)
=>
{
const
loadingState
=
useLoading
();
const
loadingState
=
useLoading
();
const
resourceStore
=
useResourceStore
();
const
resourceStore
=
useResourceStore
();
const
resource
=
resourceStore
.
getResourceByName
(
resourceI
d
);
const
resource
=
resourceStore
.
getResourceByName
(
ui
d
);
const
params
=
new
URLSearchParams
(
paramsStr
);
const
params
=
new
URLSearchParams
(
paramsStr
);
useEffect
(()
=>
{
useEffect
(()
=>
{
resourceStore
.
searchResources
(
`uid ==
${
resourceId
}
`
).
finally
(()
=>
loadingState
.
setFinish
());
resourceStore
.
fetchResourceByUID
(
uid
).
finally
(()
=>
loadingState
.
setFinish
());
},
[
resourceI
d
]);
},
[
ui
d
]);
if
(
loadingState
.
isLoading
)
{
if
(
loadingState
.
isLoading
)
{
return
null
;
return
null
;
}
}
if
(
!
resource
)
{
if
(
!
resource
)
{
return
<
Error
message=
{
`Resource not found: ${
resourceI
d}`
}
/>;
return
<
Error
message=
{
`Resource not found: ${
ui
d}`
}
/>;
}
}
return
(
return
(
...
...
web/src/store/v1/resource.ts
View file @
457cf92c
...
@@ -26,6 +26,15 @@ export const useResourceStore = create(
...
@@ -26,6 +26,15 @@ export const useResourceStore = create(
set
({
resourceMapByName
:
resourceMap
});
set
({
resourceMapByName
:
resourceMap
});
return
resources
;
return
resources
;
},
},
fetchResourceByUID
:
async
(
uid
:
string
)
=>
{
const
resource
=
await
resourceServiceClient
.
getResourceByUid
({
uid
,
});
const
resourceMap
=
get
().
resourceMapByName
;
resourceMap
[
resource
.
name
]
=
resource
;
set
({
resourceMapByName
:
resourceMap
});
return
resource
;
},
getResourceByName
:
(
name
:
string
)
=>
{
getResourceByName
:
(
name
:
string
)
=>
{
const
resourceMap
=
get
().
resourceMapByName
;
const
resourceMap
=
get
().
resourceMapByName
;
return
Object
.
values
(
resourceMap
).
find
((
r
)
=>
r
.
name
===
name
);
return
Object
.
values
(
resourceMap
).
find
((
r
)
=>
r
.
name
===
name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment