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
196facfa
Commit
196facfa
authored
Jan 20, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: implement embedded resource renderer
parent
afe75fd9
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
541 additions
and
125 deletions
+541
-125
resource_service.go
api/v2/resource_service.go
+13
-0
resource_service.proto
proto/api/v2/resource_service.proto
+13
-1
README.md
proto/gen/api/v2/README.md
+33
-0
resource_service.pb.go
proto/gen/api/v2/resource_service.pb.go
+239
-102
resource_service.pb.gw.go
proto/gen/api/v2/resource_service.pb.gw.go
+105
-2
resource_service_grpc.pb.go
proto/gen/api/v2/resource_service_grpc.pb.go
+37
-0
EmbeddedMemo.tsx
...c/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx
+8
-7
EmbeddedResource.tsx
...mponents/MemoContent/EmbeddedContent/EmbeddedResource.tsx
+24
-0
Error.tsx
web/src/components/MemoContent/EmbeddedContent/Error.tsx
+9
-0
index.tsx
web/src/components/MemoContent/EmbeddedContent/index.tsx
+5
-1
index.tsx
web/src/components/MemoContent/index.tsx
+2
-2
MemoRelationListView.tsx
web/src/components/MemoRelationListView.tsx
+2
-2
MemoResourceListView.tsx
web/src/components/MemoResourceListView.tsx
+2
-2
MemoView.tsx
web/src/components/MemoView.tsx
+4
-4
ShareMemoDialog.tsx
web/src/components/ShareMemoDialog.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+1
-1
index.ts
web/src/store/v1/index.ts
+1
-0
resource.ts
web/src/store/v1/resource.ts
+42
-0
No files found.
api/v2/resource_service.go
View file @
196facfa
...
@@ -66,6 +66,19 @@ func (s *APIV2Service) ListResources(ctx context.Context, _ *apiv2pb.ListResourc
...
@@ -66,6 +66,19 @@ func (s *APIV2Service) ListResources(ctx context.Context, _ *apiv2pb.ListResourc
return
response
,
nil
return
response
,
nil
}
}
func
(
s
*
APIV2Service
)
GetResource
(
ctx
context
.
Context
,
request
*
apiv2pb
.
GetResourceRequest
)
(
*
apiv2pb
.
GetResourceResponse
,
error
)
{
resource
,
err
:=
s
.
Store
.
GetResource
(
ctx
,
&
store
.
FindResource
{
ID
:
&
request
.
Id
,
})
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to list resources: %v"
,
err
)
}
return
&
apiv2pb
.
GetResourceResponse
{
Resource
:
s
.
convertResourceFromStore
(
ctx
,
resource
),
},
nil
}
func
(
s
*
APIV2Service
)
UpdateResource
(
ctx
context
.
Context
,
request
*
apiv2pb
.
UpdateResourceRequest
)
(
*
apiv2pb
.
UpdateResourceResponse
,
error
)
{
func
(
s
*
APIV2Service
)
UpdateResource
(
ctx
context
.
Context
,
request
*
apiv2pb
.
UpdateResourceRequest
)
(
*
apiv2pb
.
UpdateResourceResponse
,
error
)
{
if
request
.
UpdateMask
==
nil
||
len
(
request
.
UpdateMask
.
Paths
)
==
0
{
if
request
.
UpdateMask
==
nil
||
len
(
request
.
UpdateMask
.
Paths
)
==
0
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"update mask is required"
)
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"update mask is required"
)
...
...
proto/api/v2/resource_service.proto
View file @
196facfa
...
@@ -16,6 +16,10 @@ service ResourceService {
...
@@ -16,6 +16,10 @@ service ResourceService {
rpc
ListResources
(
ListResourcesRequest
)
returns
(
ListResourcesResponse
)
{
rpc
ListResources
(
ListResourcesRequest
)
returns
(
ListResourcesResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/api/v2/resources"
};
option
(
google.api.http
)
=
{
get
:
"/api/v2/resources"
};
}
}
rpc
GetResource
(
GetResourceRequest
)
returns
(
GetResourceResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/api/v2/resources/{id}"
};
option
(
google.api.method_signature
)
=
"id"
;
}
rpc
UpdateResource
(
UpdateResourceRequest
)
returns
(
UpdateResourceResponse
)
{
rpc
UpdateResource
(
UpdateResourceRequest
)
returns
(
UpdateResourceResponse
)
{
option
(
google.api.http
)
=
{
option
(
google.api.http
)
=
{
patch
:
"/api/v2/resources/{resource.id}"
,
patch
:
"/api/v2/resources/{resource.id}"
,
...
@@ -24,7 +28,7 @@ service ResourceService {
...
@@ -24,7 +28,7 @@ service ResourceService {
option
(
google.api.method_signature
)
=
"resource,update_mask"
;
option
(
google.api.method_signature
)
=
"resource,update_mask"
;
}
}
rpc
DeleteResource
(
DeleteResourceRequest
)
returns
(
DeleteResourceResponse
)
{
rpc
DeleteResource
(
DeleteResourceRequest
)
returns
(
DeleteResourceResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/api/v2/resources/{id}"
};
option
(
google.api.http
)
=
{
delete
:
"/api/v2/resources/{id}"
};
option
(
google.api.method_signature
)
=
"id"
;
option
(
google.api.method_signature
)
=
"id"
;
}
}
}
}
...
@@ -56,6 +60,14 @@ message ListResourcesResponse {
...
@@ -56,6 +60,14 @@ message ListResourcesResponse {
repeated
Resource
resources
=
1
;
repeated
Resource
resources
=
1
;
}
}
message
GetResourceRequest
{
int32
id
=
1
;
}
message
GetResourceResponse
{
Resource
resource
=
1
;
}
message
UpdateResourceRequest
{
message
UpdateResourceRequest
{
Resource
resource
=
1
;
Resource
resource
=
1
;
...
...
proto/gen/api/v2/README.md
View file @
196facfa
...
@@ -112,6 +112,8 @@
...
@@ -112,6 +112,8 @@
-
[
CreateResourceResponse
](
#memos-api-v2-CreateResourceResponse
)
-
[
CreateResourceResponse
](
#memos-api-v2-CreateResourceResponse
)
-
[
DeleteResourceRequest
](
#memos-api-v2-DeleteResourceRequest
)
-
[
DeleteResourceRequest
](
#memos-api-v2-DeleteResourceRequest
)
-
[
DeleteResourceResponse
](
#memos-api-v2-DeleteResourceResponse
)
-
[
DeleteResourceResponse
](
#memos-api-v2-DeleteResourceResponse
)
-
[
GetResourceRequest
](
#memos-api-v2-GetResourceRequest
)
-
[
GetResourceResponse
](
#memos-api-v2-GetResourceResponse
)
-
[
ListResourcesRequest
](
#memos-api-v2-ListResourcesRequest
)
-
[
ListResourcesRequest
](
#memos-api-v2-ListResourcesRequest
)
-
[
ListResourcesResponse
](
#memos-api-v2-ListResourcesResponse
)
-
[
ListResourcesResponse
](
#memos-api-v2-ListResourcesResponse
)
-
[
Resource
](
#memos-api-v2-Resource
)
-
[
Resource
](
#memos-api-v2-Resource
)
...
@@ -1637,6 +1639,36 @@
...
@@ -1637,6 +1639,36 @@
<a
name=
"memos-api-v2-GetResourceRequest"
></a>
### GetResourceRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id |
[
int32
](
#int32
)
| | |
<a
name=
"memos-api-v2-GetResourceResponse"
></a>
### GetResourceResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| resource |
[
Resource
](
#memos-api-v2-Resource
)
| | |
<a
name=
"memos-api-v2-ListResourcesRequest"
></a>
<a
name=
"memos-api-v2-ListResourcesRequest"
></a>
### ListResourcesRequest
### ListResourcesRequest
...
@@ -1729,6 +1761,7 @@
...
@@ -1729,6 +1761,7 @@
| ----------- | ------------ | ------------- | ------------|
| ----------- | ------------ | ------------- | ------------|
| CreateResource |
[
CreateResourceRequest
](
#memos-api-v2-CreateResourceRequest
)
|
[
CreateResourceResponse
](
#memos-api-v2-CreateResourceResponse
)
| |
| CreateResource |
[
CreateResourceRequest
](
#memos-api-v2-CreateResourceRequest
)
|
[
CreateResourceResponse
](
#memos-api-v2-CreateResourceResponse
)
| |
| ListResources |
[
ListResourcesRequest
](
#memos-api-v2-ListResourcesRequest
)
|
[
ListResourcesResponse
](
#memos-api-v2-ListResourcesResponse
)
| |
| ListResources |
[
ListResourcesRequest
](
#memos-api-v2-ListResourcesRequest
)
|
[
ListResourcesResponse
](
#memos-api-v2-ListResourcesResponse
)
| |
| GetResource |
[
GetResourceRequest
](
#memos-api-v2-GetResourceRequest
)
|
[
GetResourceResponse
](
#memos-api-v2-GetResourceResponse
)
| |
| UpdateResource |
[
UpdateResourceRequest
](
#memos-api-v2-UpdateResourceRequest
)
|
[
UpdateResourceResponse
](
#memos-api-v2-UpdateResourceResponse
)
| |
| UpdateResource |
[
UpdateResourceRequest
](
#memos-api-v2-UpdateResourceRequest
)
|
[
UpdateResourceResponse
](
#memos-api-v2-UpdateResourceResponse
)
| |
| DeleteResource |
[
DeleteResourceRequest
](
#memos-api-v2-DeleteResourceRequest
)
|
[
DeleteResourceResponse
](
#memos-api-v2-DeleteResourceResponse
)
| |
| DeleteResource |
[
DeleteResourceRequest
](
#memos-api-v2-DeleteResourceRequest
)
|
[
DeleteResourceResponse
](
#memos-api-v2-DeleteResourceResponse
)
| |
...
...
proto/gen/api/v2/resource_service.pb.go
View file @
196facfa
...
@@ -321,6 +321,100 @@ func (x *ListResourcesResponse) GetResources() []*Resource {
...
@@ -321,6 +321,100 @@ func (x *ListResourcesResponse) GetResources() []*Resource {
return
nil
return
nil
}
}
type
GetResourceRequest
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Id
int32
`protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func
(
x
*
GetResourceRequest
)
Reset
()
{
*
x
=
GetResourceRequest
{}
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
5
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
}
func
(
x
*
GetResourceRequest
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
GetResourceRequest
)
ProtoMessage
()
{}
func
(
x
*
GetResourceRequest
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
5
]
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 GetResourceRequest.ProtoReflect.Descriptor instead.
func
(
*
GetResourceRequest
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
5
}
}
func
(
x
*
GetResourceRequest
)
GetId
()
int32
{
if
x
!=
nil
{
return
x
.
Id
}
return
0
}
type
GetResourceResponse
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Resource
*
Resource
`protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
}
func
(
x
*
GetResourceResponse
)
Reset
()
{
*
x
=
GetResourceResponse
{}
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
6
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
}
func
(
x
*
GetResourceResponse
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
GetResourceResponse
)
ProtoMessage
()
{}
func
(
x
*
GetResourceResponse
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
6
]
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 GetResourceResponse.ProtoReflect.Descriptor instead.
func
(
*
GetResourceResponse
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
6
}
}
func
(
x
*
GetResourceResponse
)
GetResource
()
*
Resource
{
if
x
!=
nil
{
return
x
.
Resource
}
return
nil
}
type
UpdateResourceRequest
struct
{
type
UpdateResourceRequest
struct
{
state
protoimpl
.
MessageState
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
sizeCache
protoimpl
.
SizeCache
...
@@ -333,7 +427,7 @@ type UpdateResourceRequest struct {
...
@@ -333,7 +427,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_v2_resource_service_proto_msgTypes
[
5
]
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
7
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
ms
.
StoreMessageInfo
(
mi
)
}
}
...
@@ -346,7 +440,7 @@ func (x *UpdateResourceRequest) String() string {
...
@@ -346,7 +440,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_v2_resource_service_proto_msgTypes
[
5
]
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
7
]
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
{
...
@@ -359,7 +453,7 @@ func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message {
...
@@ -359,7 +453,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_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
5
}
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
7
}
}
}
func
(
x
*
UpdateResourceRequest
)
GetResource
()
*
Resource
{
func
(
x
*
UpdateResourceRequest
)
GetResource
()
*
Resource
{
...
@@ -387,7 +481,7 @@ type UpdateResourceResponse struct {
...
@@ -387,7 +481,7 @@ type UpdateResourceResponse struct {
func
(
x
*
UpdateResourceResponse
)
Reset
()
{
func
(
x
*
UpdateResourceResponse
)
Reset
()
{
*
x
=
UpdateResourceResponse
{}
*
x
=
UpdateResourceResponse
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
6
]
mi
:=
&
file_api_v2_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
)
}
}
...
@@ -400,7 +494,7 @@ func (x *UpdateResourceResponse) String() string {
...
@@ -400,7 +494,7 @@ func (x *UpdateResourceResponse) String() string {
func
(
*
UpdateResourceResponse
)
ProtoMessage
()
{}
func
(
*
UpdateResourceResponse
)
ProtoMessage
()
{}
func
(
x
*
UpdateResourceResponse
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
UpdateResourceResponse
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
6
]
mi
:=
&
file_api_v2_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
{
...
@@ -413,7 +507,7 @@ func (x *UpdateResourceResponse) ProtoReflect() protoreflect.Message {
...
@@ -413,7 +507,7 @@ func (x *UpdateResourceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateResourceResponse.ProtoReflect.Descriptor instead.
// Deprecated: Use UpdateResourceResponse.ProtoReflect.Descriptor instead.
func
(
*
UpdateResourceResponse
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
UpdateResourceResponse
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
6
}
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
8
}
}
}
func
(
x
*
UpdateResourceResponse
)
GetResource
()
*
Resource
{
func
(
x
*
UpdateResourceResponse
)
GetResource
()
*
Resource
{
...
@@ -434,7 +528,7 @@ type DeleteResourceRequest struct {
...
@@ -434,7 +528,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_v2_resource_service_proto_msgTypes
[
7
]
mi
:=
&
file_api_v2_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
)
}
}
...
@@ -447,7 +541,7 @@ func (x *DeleteResourceRequest) String() string {
...
@@ -447,7 +541,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_v2_resource_service_proto_msgTypes
[
7
]
mi
:=
&
file_api_v2_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
{
...
@@ -460,7 +554,7 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message {
...
@@ -460,7 +554,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_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
7
}
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
9
}
}
}
func
(
x
*
DeleteResourceRequest
)
GetId
()
int32
{
func
(
x
*
DeleteResourceRequest
)
GetId
()
int32
{
...
@@ -479,7 +573,7 @@ type DeleteResourceResponse struct {
...
@@ -479,7 +573,7 @@ type DeleteResourceResponse struct {
func
(
x
*
DeleteResourceResponse
)
Reset
()
{
func
(
x
*
DeleteResourceResponse
)
Reset
()
{
*
x
=
DeleteResourceResponse
{}
*
x
=
DeleteResourceResponse
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
8
]
mi
:=
&
file_api_v2_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
)
}
}
...
@@ -492,7 +586,7 @@ func (x *DeleteResourceResponse) String() string {
...
@@ -492,7 +586,7 @@ func (x *DeleteResourceResponse) String() string {
func
(
*
DeleteResourceResponse
)
ProtoMessage
()
{}
func
(
*
DeleteResourceResponse
)
ProtoMessage
()
{}
func
(
x
*
DeleteResourceResponse
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
DeleteResourceResponse
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v2_resource_service_proto_msgTypes
[
8
]
mi
:=
&
file_api_v2_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
{
...
@@ -505,7 +599,7 @@ func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message {
...
@@ -505,7 +599,7 @@ func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead.
// Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead.
func
(
*
DeleteResourceResponse
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
DeleteResourceResponse
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
8
}
return
file_api_v2_resource_service_proto_rawDescGZIP
(),
[]
int
{
10
}
}
}
var
File_api_v2_resource_service_proto
protoreflect
.
FileDescriptor
var
File_api_v2_resource_service_proto
protoreflect
.
FileDescriptor
...
@@ -557,71 +651,85 @@ var file_api_v2_resource_service_proto_rawDesc = []byte{
...
@@ -557,71 +651,85 @@ var file_api_v2_resource_service_proto_rawDesc = []byte{
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x18
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x18
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x09
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x09
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x22
,
0x88
,
0x01
,
0x0a
,
0x15
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x65
,
0x73
,
0x22
,
0x24
,
0x0a
,
0x12
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x32
,
0x0a
,
0x08
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x02
,
0x69
,
0x64
,
0x22
,
0x49
,
0x0a
,
0x13
,
0x47
,
0x65
,
0x74
,
0x52
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x65
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x32
,
0x0a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x12
,
0x3b
,
0x0a
,
0x0b
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x73
,
0x6b
,
0x18
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x1a
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x70
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x62
,
0x75
,
0x66
,
0x2e
,
0x46
,
0x69
,
0x65
,
0x6c
,
0x64
,
0x4d
,
0x61
,
0x73
,
0x72
,
0x63
,
0x65
,
0x22
,
0x88
,
0x01
,
0x0a
,
0x15
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x6b
,
0x52
,
0x0a
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x22
,
0x4c
,
0x0a
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x32
,
0x0a
,
0x16
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x32
,
0x0a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x3b
,
0x0a
,
0x0b
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x73
,
0x6b
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x27
,
0x0a
,
0x15
,
0x44
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x1a
,
0x2e
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2e
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x62
,
0x75
,
0x66
,
0x2e
,
0x46
,
0x69
,
0x65
,
0x6c
,
0x64
,
0x4d
,
0x61
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x05
,
0x73
,
0x6b
,
0x52
,
0x0a
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x4d
,
0x61
,
0x73
,
0x6b
,
0x22
,
0x4c
,
0x52
,
0x02
,
0x69
,
0x64
,
0x22
,
0x18
,
0x0a
,
0x16
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x0a
,
0x16
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x32
,
0xa9
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x32
,
0x0a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x04
,
0x0a
,
0x0f
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x75
,
0x72
,
0x63
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x16
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x63
,
0x65
,
0x12
,
0x76
,
0x0a
,
0x0e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x22
,
0x27
,
0x0a
,
0x15
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x02
,
0x69
,
0x64
,
0x22
,
0x18
,
0x0a
,
0x16
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x32
,
0xa2
,
0x05
,
0x0a
,
0x0f
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x76
,
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
,
0x32
,
0x2e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x43
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x19
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x13
,
0x22
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
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
,
0x32
,
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
,
0x32
,
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
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x77
,
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
,
0x32
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x21
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x23
,
0xda
,
0x41
,
0x02
,
0x69
,
0x64
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x18
,
0x12
,
0x16
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x7b
,
0x69
,
0x64
,
0x7d
,
0x12
,
0xa5
,
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
,
0x32
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x48
,
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
,
0x2b
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x32
,
0x1f
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x7b
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2e
,
0x69
,
0x64
,
0x7d
,
0x12
,
0x80
,
0x01
,
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
,
0x75
,
0x72
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4
3
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4
4
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4
3
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x52
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4
4
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x19
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x13
,
0x22
,
0x11
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x23
,
0xda
,
0x41
,
0x02
,
0x69
,
0x64
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x18
,
0x2a
,
0x16
,
0x2f
,
0x61
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x73
,
0x0a
,
0x0d
,
0x4c
,
0x69
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x22
,
0x2e
,
0x6d
,
0x65
,
0x7b
,
0x69
,
0x64
,
0x7d
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x52
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x42
,
0x14
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x72
,
0x63
,
0x65
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x4c
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x69
,
0x73
,
0x74
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x19
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x13
,
0x12
,
0x11
,
0x2f
,
0x61
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x12
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0xa5
,
0x01
,
0x0a
,
0x0e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x32
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x63
,
0x65
,
0x12
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x32
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x3a
,
0x56
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x48
,
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
,
0x2b
,
0x3a
,
0x08
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x32
,
0x1f
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x7b
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x2e
,
0x69
,
0x64
,
0x7d
,
0x12
,
0x80
,
0x01
,
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
,
0x32
,
0x2e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x24
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x52
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x23
,
0xda
,
0x41
,
0x02
,
0x69
,
0x64
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x18
,
0x12
,
0x16
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x75
,
0x72
,
0x63
,
0x65
,
0x73
,
0x2f
,
0x7b
,
0x69
,
0x64
,
0x7d
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
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
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x32
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
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
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
}
var
(
var
(
...
@@ -636,40 +744,45 @@ func file_api_v2_resource_service_proto_rawDescGZIP() []byte {
...
@@ -636,40 +744,45 @@ func file_api_v2_resource_service_proto_rawDescGZIP() []byte {
return
file_api_v2_resource_service_proto_rawDescData
return
file_api_v2_resource_service_proto_rawDescData
}
}
var
file_api_v2_resource_service_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
9
)
var
file_api_v2_resource_service_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
11
)
var
file_api_v2_resource_service_proto_goTypes
=
[]
interface
{}{
var
file_api_v2_resource_service_proto_goTypes
=
[]
interface
{}{
(
*
Resource
)(
nil
),
// 0: memos.api.v2.Resource
(
*
Resource
)(
nil
),
// 0: memos.api.v2.Resource
(
*
CreateResourceRequest
)(
nil
),
// 1: memos.api.v2.CreateResourceRequest
(
*
CreateResourceRequest
)(
nil
),
// 1: memos.api.v2.CreateResourceRequest
(
*
CreateResourceResponse
)(
nil
),
// 2: memos.api.v2.CreateResourceResponse
(
*
CreateResourceResponse
)(
nil
),
// 2: memos.api.v2.CreateResourceResponse
(
*
ListResourcesRequest
)(
nil
),
// 3: memos.api.v2.ListResourcesRequest
(
*
ListResourcesRequest
)(
nil
),
// 3: memos.api.v2.ListResourcesRequest
(
*
ListResourcesResponse
)(
nil
),
// 4: memos.api.v2.ListResourcesResponse
(
*
ListResourcesResponse
)(
nil
),
// 4: memos.api.v2.ListResourcesResponse
(
*
UpdateResourceRequest
)(
nil
),
// 5: memos.api.v2.UpdateResourceRequest
(
*
GetResourceRequest
)(
nil
),
// 5: memos.api.v2.GetResourceRequest
(
*
UpdateResourceResponse
)(
nil
),
// 6: memos.api.v2.UpdateResourceResponse
(
*
GetResourceResponse
)(
nil
),
// 6: memos.api.v2.GetResourceResponse
(
*
DeleteResourceRequest
)(
nil
),
// 7: memos.api.v2.DeleteResourceRequest
(
*
UpdateResourceRequest
)(
nil
),
// 7: memos.api.v2.UpdateResourceRequest
(
*
DeleteResourceResponse
)(
nil
),
// 8: memos.api.v2.DeleteResourceResponse
(
*
UpdateResourceResponse
)(
nil
),
// 8: memos.api.v2.UpdateResourceResponse
(
*
timestamppb
.
Timestamp
)(
nil
),
// 9: google.protobuf.Timestamp
(
*
DeleteResourceRequest
)(
nil
),
// 9: memos.api.v2.DeleteResourceRequest
(
*
fieldmaskpb
.
FieldMask
)(
nil
),
// 10: google.protobuf.FieldMask
(
*
DeleteResourceResponse
)(
nil
),
// 10: memos.api.v2.DeleteResourceResponse
(
*
timestamppb
.
Timestamp
)(
nil
),
// 11: google.protobuf.Timestamp
(
*
fieldmaskpb
.
FieldMask
)(
nil
),
// 12: google.protobuf.FieldMask
}
}
var
file_api_v2_resource_service_proto_depIdxs
=
[]
int32
{
var
file_api_v2_resource_service_proto_depIdxs
=
[]
int32
{
9
,
// 0: memos.api.v2.Resource.create_time:type_name -> google.protobuf.Timestamp
11
,
// 0: memos.api.v2.Resource.create_time:type_name -> google.protobuf.Timestamp
0
,
// 1: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource
0
,
// 1: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource
0
,
// 2: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource
0
,
// 2: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource
0
,
// 3: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource
0
,
// 3: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource
10
,
// 4: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask
0
,
// 4: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource
0
,
// 5: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource
12
,
// 5: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask
1
,
// 6: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest
0
,
// 6: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource
3
,
// 7: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest
1
,
// 7: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest
5
,
// 8: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest
3
,
// 8: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest
7
,
// 9: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest
5
,
// 9: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest
2
,
// 10: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse
7
,
// 10: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest
4
,
// 11: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse
9
,
// 11: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest
6
,
// 12: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse
2
,
// 12: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse
8
,
// 13: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse
4
,
// 13: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse
10
,
// [10:14] is the sub-list for method output_type
6
,
// 14: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse
6
,
// [6:10] is the sub-list for method input_type
8
,
// 15: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse
6
,
// [6:6] is the sub-list for extension type_name
10
,
// 16: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse
6
,
// [6:6] is the sub-list for extension extendee
12
,
// [12:17] is the sub-list for method output_type
0
,
// [0:6] is the sub-list for field type_name
7
,
// [7:12] is the sub-list for method input_type
7
,
// [7:7] is the sub-list for extension type_name
7
,
// [7:7] is the sub-list for extension extendee
0
,
// [0:7] is the sub-list for field type_name
}
}
func
init
()
{
file_api_v2_resource_service_proto_init
()
}
func
init
()
{
file_api_v2_resource_service_proto_init
()
}
...
@@ -739,7 +852,7 @@ func file_api_v2_resource_service_proto_init() {
...
@@ -739,7 +852,7 @@ func file_api_v2_resource_service_proto_init() {
}
}
}
}
file_api_v2_resource_service_proto_msgTypes
[
5
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_api_v2_resource_service_proto_msgTypes
[
5
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
Update
ResourceRequest
);
i
{
switch
v
:=
v
.
(
*
Get
ResourceRequest
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -751,7 +864,7 @@ func file_api_v2_resource_service_proto_init() {
...
@@ -751,7 +864,7 @@ func file_api_v2_resource_service_proto_init() {
}
}
}
}
file_api_v2_resource_service_proto_msgTypes
[
6
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_api_v2_resource_service_proto_msgTypes
[
6
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
Update
ResourceResponse
);
i
{
switch
v
:=
v
.
(
*
Get
ResourceResponse
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -763,7 +876,7 @@ func file_api_v2_resource_service_proto_init() {
...
@@ -763,7 +876,7 @@ func file_api_v2_resource_service_proto_init() {
}
}
}
}
file_api_v2_resource_service_proto_msgTypes
[
7
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_api_v2_resource_service_proto_msgTypes
[
7
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
Dele
teResourceRequest
);
i
{
switch
v
:=
v
.
(
*
Upda
teResourceRequest
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -775,6 +888,30 @@ func file_api_v2_resource_service_proto_init() {
...
@@ -775,6 +888,30 @@ func file_api_v2_resource_service_proto_init() {
}
}
}
}
file_api_v2_resource_service_proto_msgTypes
[
8
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_api_v2_resource_service_proto_msgTypes
[
8
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
UpdateResourceResponse
);
i
{
case
0
:
return
&
v
.
state
case
1
:
return
&
v
.
sizeCache
case
2
:
return
&
v
.
unknownFields
default
:
return
nil
}
}
file_api_v2_resource_service_proto_msgTypes
[
9
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
DeleteResourceRequest
);
i
{
case
0
:
return
&
v
.
state
case
1
:
return
&
v
.
sizeCache
case
2
:
return
&
v
.
unknownFields
default
:
return
nil
}
}
file_api_v2_resource_service_proto_msgTypes
[
10
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
DeleteResourceResponse
);
i
{
switch
v
:=
v
.
(
*
DeleteResourceResponse
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
...
@@ -795,7 +932,7 @@ func file_api_v2_resource_service_proto_init() {
...
@@ -795,7 +932,7 @@ func file_api_v2_resource_service_proto_init() {
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
RawDescriptor
:
file_api_v2_resource_service_proto_rawDesc
,
RawDescriptor
:
file_api_v2_resource_service_proto_rawDesc
,
NumEnums
:
0
,
NumEnums
:
0
,
NumMessages
:
9
,
NumMessages
:
11
,
NumExtensions
:
0
,
NumExtensions
:
0
,
NumServices
:
1
,
NumServices
:
1
,
},
},
...
...
proto/gen/api/v2/resource_service.pb.gw.go
View file @
196facfa
...
@@ -85,6 +85,58 @@ func local_request_ResourceService_ListResources_0(ctx context.Context, marshale
...
@@ -85,6 +85,58 @@ func local_request_ResourceService_ListResources_0(ctx context.Context, marshale
}
}
func
request_ResourceService_GetResource_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
ResourceServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
protoReq
GetResourceRequest
var
metadata
runtime
.
ServerMetadata
var
(
val
string
ok
bool
err
error
_
=
err
)
val
,
ok
=
pathParams
[
"id"
]
if
!
ok
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"missing parameter %s"
,
"id"
)
}
protoReq
.
Id
,
err
=
runtime
.
Int32
(
val
)
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"id"
,
err
)
}
msg
,
err
:=
client
.
GetResource
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
func
local_request_ResourceService_GetResource_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
server
ResourceServiceServer
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
protoReq
GetResourceRequest
var
metadata
runtime
.
ServerMetadata
var
(
val
string
ok
bool
err
error
_
=
err
)
val
,
ok
=
pathParams
[
"id"
]
if
!
ok
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"missing parameter %s"
,
"id"
)
}
protoReq
.
Id
,
err
=
runtime
.
Int32
(
val
)
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"id"
,
err
)
}
msg
,
err
:=
server
.
GetResource
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
var
(
var
(
filter_ResourceService_UpdateResource_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"resource"
:
0
,
"id"
:
1
},
Base
:
[]
int
{
1
,
4
,
5
,
2
,
0
,
0
,
0
,
0
},
Check
:
[]
int
{
0
,
1
,
1
,
2
,
4
,
2
,
2
,
3
}}
filter_ResourceService_UpdateResource_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"resource"
:
0
,
"id"
:
1
},
Base
:
[]
int
{
1
,
4
,
5
,
2
,
0
,
0
,
0
,
0
},
Check
:
[]
int
{
0
,
1
,
1
,
2
,
4
,
2
,
2
,
3
}}
)
)
...
@@ -293,6 +345,31 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
...
@@ -293,6 +345,31 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResource_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.v2.ResourceService/GetResource"
,
runtime
.
WithHTTPPathPattern
(
"/api/v2/resources/{id}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
resp
,
md
,
err
:=
local_request_ResourceService_GetResource_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_GetResource_0
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
resp
,
mux
.
GetForwardResponseOptions
()
...
)
})
mux
.
Handle
(
"PATCH"
,
pattern_ResourceService_UpdateResource_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"PATCH"
,
pattern_ResourceService_UpdateResource_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
()
...
@@ -318,7 +395,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
...
@@ -318,7 +395,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"
GET
"
,
pattern_ResourceService_DeleteResource_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"
DELETE
"
,
pattern_ResourceService_DeleteResource_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
()
var
stream
runtime
.
ServerTransportStream
var
stream
runtime
.
ServerTransportStream
...
@@ -428,6 +505,28 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
...
@@ -428,6 +505,28 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"GET"
,
pattern_ResourceService_GetResource_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.v2.ResourceService/GetResource"
,
runtime
.
WithHTTPPathPattern
(
"/api/v2/resources/{id}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
}
resp
,
md
,
err
:=
request_ResourceService_GetResource_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_GetResource_0
(
annotatedContext
,
mux
,
outboundMarshaler
,
w
,
req
,
resp
,
mux
.
GetForwardResponseOptions
()
...
)
})
mux
.
Handle
(
"PATCH"
,
pattern_ResourceService_UpdateResource_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"PATCH"
,
pattern_ResourceService_UpdateResource_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
()
...
@@ -450,7 +549,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
...
@@ -450,7 +549,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
})
mux
.
Handle
(
"
GET
"
,
pattern_ResourceService_DeleteResource_0
,
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
{
mux
.
Handle
(
"
DELETE
"
,
pattern_ResourceService_DeleteResource_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
()
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
...
@@ -480,6 +579,8 @@ var (
...
@@ -480,6 +579,8 @@ var (
pattern_ResourceService_ListResources_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
},
[]
string
{
"api"
,
"v2"
,
"resources"
},
""
))
pattern_ResourceService_ListResources_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
},
[]
string
{
"api"
,
"v2"
,
"resources"
},
""
))
pattern_ResourceService_GetResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v2"
,
"resources"
,
"id"
},
""
))
pattern_ResourceService_UpdateResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v2"
,
"resources"
,
"resource.id"
},
""
))
pattern_ResourceService_UpdateResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v2"
,
"resources"
,
"resource.id"
},
""
))
pattern_ResourceService_DeleteResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v2"
,
"resources"
,
"id"
},
""
))
pattern_ResourceService_DeleteResource_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
1
,
5
,
3
},
[]
string
{
"api"
,
"v2"
,
"resources"
,
"id"
},
""
))
...
@@ -490,6 +591,8 @@ var (
...
@@ -490,6 +591,8 @@ var (
forward_ResourceService_ListResources_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_ListResources_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_GetResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_UpdateResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_UpdateResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_DeleteResource_0
=
runtime
.
ForwardResponseMessage
forward_ResourceService_DeleteResource_0
=
runtime
.
ForwardResponseMessage
...
...
proto/gen/api/v2/resource_service_grpc.pb.go
View file @
196facfa
...
@@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7
...
@@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7
const
(
const
(
ResourceService_CreateResource_FullMethodName
=
"/memos.api.v2.ResourceService/CreateResource"
ResourceService_CreateResource_FullMethodName
=
"/memos.api.v2.ResourceService/CreateResource"
ResourceService_ListResources_FullMethodName
=
"/memos.api.v2.ResourceService/ListResources"
ResourceService_ListResources_FullMethodName
=
"/memos.api.v2.ResourceService/ListResources"
ResourceService_GetResource_FullMethodName
=
"/memos.api.v2.ResourceService/GetResource"
ResourceService_UpdateResource_FullMethodName
=
"/memos.api.v2.ResourceService/UpdateResource"
ResourceService_UpdateResource_FullMethodName
=
"/memos.api.v2.ResourceService/UpdateResource"
ResourceService_DeleteResource_FullMethodName
=
"/memos.api.v2.ResourceService/DeleteResource"
ResourceService_DeleteResource_FullMethodName
=
"/memos.api.v2.ResourceService/DeleteResource"
)
)
...
@@ -31,6 +32,7 @@ const (
...
@@ -31,6 +32,7 @@ const (
type
ResourceServiceClient
interface
{
type
ResourceServiceClient
interface
{
CreateResource
(
ctx
context
.
Context
,
in
*
CreateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
CreateResourceResponse
,
error
)
CreateResource
(
ctx
context
.
Context
,
in
*
CreateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
CreateResourceResponse
,
error
)
ListResources
(
ctx
context
.
Context
,
in
*
ListResourcesRequest
,
opts
...
grpc
.
CallOption
)
(
*
ListResourcesResponse
,
error
)
ListResources
(
ctx
context
.
Context
,
in
*
ListResourcesRequest
,
opts
...
grpc
.
CallOption
)
(
*
ListResourcesResponse
,
error
)
GetResource
(
ctx
context
.
Context
,
in
*
GetResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
GetResourceResponse
,
error
)
UpdateResource
(
ctx
context
.
Context
,
in
*
UpdateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
UpdateResourceResponse
,
error
)
UpdateResource
(
ctx
context
.
Context
,
in
*
UpdateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
UpdateResourceResponse
,
error
)
DeleteResource
(
ctx
context
.
Context
,
in
*
DeleteResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
DeleteResourceResponse
,
error
)
DeleteResource
(
ctx
context
.
Context
,
in
*
DeleteResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
DeleteResourceResponse
,
error
)
}
}
...
@@ -61,6 +63,15 @@ func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResou
...
@@ -61,6 +63,15 @@ func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResou
return
out
,
nil
return
out
,
nil
}
}
func
(
c
*
resourceServiceClient
)
GetResource
(
ctx
context
.
Context
,
in
*
GetResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
GetResourceResponse
,
error
)
{
out
:=
new
(
GetResourceResponse
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
ResourceService_GetResource_FullMethodName
,
in
,
out
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
return
out
,
nil
}
func
(
c
*
resourceServiceClient
)
UpdateResource
(
ctx
context
.
Context
,
in
*
UpdateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
UpdateResourceResponse
,
error
)
{
func
(
c
*
resourceServiceClient
)
UpdateResource
(
ctx
context
.
Context
,
in
*
UpdateResourceRequest
,
opts
...
grpc
.
CallOption
)
(
*
UpdateResourceResponse
,
error
)
{
out
:=
new
(
UpdateResourceResponse
)
out
:=
new
(
UpdateResourceResponse
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
ResourceService_UpdateResource_FullMethodName
,
in
,
out
,
opts
...
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
ResourceService_UpdateResource_FullMethodName
,
in
,
out
,
opts
...
)
...
@@ -85,6 +96,7 @@ func (c *resourceServiceClient) DeleteResource(ctx context.Context, in *DeleteRe
...
@@ -85,6 +96,7 @@ func (c *resourceServiceClient) DeleteResource(ctx context.Context, in *DeleteRe
type
ResourceServiceServer
interface
{
type
ResourceServiceServer
interface
{
CreateResource
(
context
.
Context
,
*
CreateResourceRequest
)
(
*
CreateResourceResponse
,
error
)
CreateResource
(
context
.
Context
,
*
CreateResourceRequest
)
(
*
CreateResourceResponse
,
error
)
ListResources
(
context
.
Context
,
*
ListResourcesRequest
)
(
*
ListResourcesResponse
,
error
)
ListResources
(
context
.
Context
,
*
ListResourcesRequest
)
(
*
ListResourcesResponse
,
error
)
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
GetResourceResponse
,
error
)
UpdateResource
(
context
.
Context
,
*
UpdateResourceRequest
)
(
*
UpdateResourceResponse
,
error
)
UpdateResource
(
context
.
Context
,
*
UpdateResourceRequest
)
(
*
UpdateResourceResponse
,
error
)
DeleteResource
(
context
.
Context
,
*
DeleteResourceRequest
)
(
*
DeleteResourceResponse
,
error
)
DeleteResource
(
context
.
Context
,
*
DeleteResourceRequest
)
(
*
DeleteResourceResponse
,
error
)
mustEmbedUnimplementedResourceServiceServer
()
mustEmbedUnimplementedResourceServiceServer
()
...
@@ -100,6 +112,9 @@ func (UnimplementedResourceServiceServer) CreateResource(context.Context, *Creat
...
@@ -100,6 +112,9 @@ func (UnimplementedResourceServiceServer) CreateResource(context.Context, *Creat
func
(
UnimplementedResourceServiceServer
)
ListResources
(
context
.
Context
,
*
ListResourcesRequest
)
(
*
ListResourcesResponse
,
error
)
{
func
(
UnimplementedResourceServiceServer
)
ListResources
(
context
.
Context
,
*
ListResourcesRequest
)
(
*
ListResourcesResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method ListResources not implemented"
)
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method ListResources not implemented"
)
}
}
func
(
UnimplementedResourceServiceServer
)
GetResource
(
context
.
Context
,
*
GetResourceRequest
)
(
*
GetResourceResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method GetResource not implemented"
)
}
func
(
UnimplementedResourceServiceServer
)
UpdateResource
(
context
.
Context
,
*
UpdateResourceRequest
)
(
*
UpdateResourceResponse
,
error
)
{
func
(
UnimplementedResourceServiceServer
)
UpdateResource
(
context
.
Context
,
*
UpdateResourceRequest
)
(
*
UpdateResourceResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method UpdateResource not implemented"
)
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method UpdateResource not implemented"
)
}
}
...
@@ -155,6 +170,24 @@ func _ResourceService_ListResources_Handler(srv interface{}, ctx context.Context
...
@@ -155,6 +170,24 @@ func _ResourceService_ListResources_Handler(srv interface{}, ctx context.Context
return
interceptor
(
ctx
,
in
,
info
,
handler
)
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
}
func
_ResourceService_GetResource_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
GetResourceRequest
)
if
err
:=
dec
(
in
);
err
!=
nil
{
return
nil
,
err
}
if
interceptor
==
nil
{
return
srv
.
(
ResourceServiceServer
)
.
GetResource
(
ctx
,
in
)
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
ResourceService_GetResource_FullMethodName
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
ResourceServiceServer
)
.
GetResource
(
ctx
,
req
.
(
*
GetResourceRequest
))
}
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
func
_ResourceService_UpdateResource_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
func
_ResourceService_UpdateResource_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
UpdateResourceRequest
)
in
:=
new
(
UpdateResourceRequest
)
if
err
:=
dec
(
in
);
err
!=
nil
{
if
err
:=
dec
(
in
);
err
!=
nil
{
...
@@ -206,6 +239,10 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{
...
@@ -206,6 +239,10 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{
MethodName
:
"ListResources"
,
MethodName
:
"ListResources"
,
Handler
:
_ResourceService_ListResources_Handler
,
Handler
:
_ResourceService_ListResources_Handler
,
},
},
{
MethodName
:
"GetResource"
,
Handler
:
_ResourceService_GetResource_Handler
,
},
{
{
MethodName
:
"UpdateResource"
,
MethodName
:
"UpdateResource"
,
Handler
:
_ResourceService_UpdateResource_Handler
,
Handler
:
_ResourceService_UpdateResource_Handler
,
...
...
web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx
View file @
196facfa
...
@@ -2,6 +2,7 @@ import { useContext, useEffect } from "react";
...
@@ -2,6 +2,7 @@ import { useContext, useEffect } from "react";
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
MemoContent
from
".."
;
import
MemoContent
from
".."
;
import
{
RendererContext
}
from
"../types"
;
import
{
RendererContext
}
from
"../types"
;
import
Error
from
"./Error"
;
interface
Props
{
interface
Props
{
memoId
:
number
;
memoId
:
number
;
...
@@ -17,16 +18,16 @@ const EmbeddedMemo = ({ memoId }: Props) => {
...
@@ -17,16 +18,16 @@ const EmbeddedMemo = ({ memoId }: Props) => {
memoStore
.
getOrFetchMemoById
(
memoId
);
memoStore
.
getOrFetchMemoById
(
memoId
);
},
[
memoId
]);
},
[
memoId
]);
if
(
!
memo
)
{
return
null
;
}
if
(
memoId
===
context
.
memoId
||
context
.
embeddedMemos
.
has
(
resourceName
))
{
if
(
memoId
===
context
.
memoId
||
context
.
embeddedMemos
.
has
(
resourceName
))
{
return
<
p
>
Nested Rendering Error:
{
`![[${resourceName}]]`
}
</
p
>;
return
<
Error
message=
{
`Nested Rendering Error: ![[${resourceName}]]`
}
/
>;
}
}
context
.
embeddedMemos
.
add
(
resourceName
);
return
(
// Add the memo to the set of embedded memos. This is used to prevent infinite loops when a memo embeds itself.
<
div
className=
"embedded-memo"
>
context
.
embeddedMemos
.
add
(
resourceName
);
<
MemoContent
nodes=
{
memo
.
nodes
}
memoId=
{
memoId
}
embeddedMemos=
{
context
.
embeddedMemos
}
/>
return
<
MemoContent
nodes=
{
memo
.
nodes
}
memoId=
{
memoId
}
embeddedMemos=
{
context
.
embeddedMemos
}
/>;
</
div
>
);
};
};
export
default
EmbeddedMemo
;
export
default
EmbeddedMemo
;
web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx
0 → 100644
View file @
196facfa
import
{
useEffect
}
from
"react"
;
import
MemoResourceListView
from
"@/components/MemoResourceListView"
;
import
{
useResourceStore
}
from
"@/store/v1"
;
interface
Props
{
resourceId
:
number
;
}
const
EmbeddedResource
=
({
resourceId
}:
Props
)
=>
{
const
resourceStore
=
useResourceStore
();
const
resource
=
resourceStore
.
getResourceById
(
resourceId
);
useEffect
(()
=>
{
resourceStore
.
getOrFetchResourceById
(
resourceId
);
},
[
resourceId
]);
if
(
!
resource
)
{
return
null
;
}
return
<
MemoResourceListView
resources=
{
[
resource
]
}
/>;
};
export
default
EmbeddedResource
;
web/src/components/MemoContent/EmbeddedContent/Error.tsx
0 → 100644
View file @
196facfa
interface
Props
{
message
:
string
;
}
const
Error
=
({
message
}:
Props
)
=>
{
return
<
p
className=
"font-mono text-sm text-red-600 dark:text-red-700"
>
{
message
}
</
p
>;
};
export
default
Error
;
web/src/components/MemoContent/EmbeddedContent/index.tsx
View file @
196facfa
import
EmbeddedMemo
from
"./EmbeddedMemo"
;
import
EmbeddedMemo
from
"./EmbeddedMemo"
;
import
EmbeddedResource
from
"./EmbeddedResource"
;
import
Error
from
"./Error"
;
interface
Props
{
interface
Props
{
resourceName
:
string
;
resourceName
:
string
;
...
@@ -13,8 +15,10 @@ const EmbeddedContent = ({ resourceName }: Props) => {
...
@@ -13,8 +15,10 @@ const EmbeddedContent = ({ resourceName }: Props) => {
const
{
resourceType
,
resourceId
}
=
extractResourceTypeAndId
(
resourceName
);
const
{
resourceType
,
resourceId
}
=
extractResourceTypeAndId
(
resourceName
);
if
(
resourceType
===
"memos"
)
{
if
(
resourceType
===
"memos"
)
{
return
<
EmbeddedMemo
memoId=
{
Number
(
resourceId
)
}
/>;
return
<
EmbeddedMemo
memoId=
{
Number
(
resourceId
)
}
/>;
}
else
if
(
resourceType
===
"resources"
)
{
return
<
EmbeddedResource
resourceId=
{
Number
(
resourceId
)
}
/>;
}
}
return
<
p
>
Unknown resource:
{
resourceName
}
</
p
>;
return
<
Error
message=
{
`Unknown resource: ${resourceName}`
}
/
>;
};
};
export
default
EmbeddedContent
;
export
default
EmbeddedContent
;
web/src/components/MemoContent/index.tsx
View file @
196facfa
import
{
useRef
}
from
"react"
;
import
{
memo
,
useRef
}
from
"react"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
Node
,
NodeType
}
from
"@/types/proto/api/v2/markdown_service"
;
import
{
Node
,
NodeType
}
from
"@/types/proto/api/v2/markdown_service"
;
...
@@ -65,4 +65,4 @@ const MemoContent: React.FC<Props> = (props: Props) => {
...
@@ -65,4 +65,4 @@ const MemoContent: React.FC<Props> = (props: Props) => {
);
);
};
};
export
default
MemoContent
;
export
default
memo
(
MemoContent
)
;
web/src/components/MemoRelationListView.tsx
View file @
196facfa
import
{
Tooltip
}
from
"@mui/joy"
;
import
{
Tooltip
}
from
"@mui/joy"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
MemoRelation
}
from
"@/types/proto/api/v2/memo_relation_service"
;
import
{
MemoRelation
}
from
"@/types/proto/api/v2/memo_relation_service"
;
...
@@ -82,4 +82,4 @@ const MemoRelationListView = (props: Props) => {
...
@@ -82,4 +82,4 @@ const MemoRelationListView = (props: Props) => {
);
);
};
};
export
default
MemoRelationListView
;
export
default
memo
(
MemoRelationListView
)
;
web/src/components/MemoResourceListView.tsx
View file @
196facfa
...
@@ -6,11 +6,11 @@ import MemoResource from "./MemoResource";
...
@@ -6,11 +6,11 @@ import MemoResource from "./MemoResource";
import
showPreviewImageDialog
from
"./PreviewImageDialog"
;
import
showPreviewImageDialog
from
"./PreviewImageDialog"
;
import
SquareDiv
from
"./kit/SquareDiv"
;
import
SquareDiv
from
"./kit/SquareDiv"
;
const
MemoResourceListView
=
({
resource
List
=
[]
}:
{
resourceList
:
Resource
[]
})
=>
{
const
MemoResourceListView
=
({
resource
s
=
[]
}:
{
resources
:
Resource
[]
})
=>
{
const
mediaResources
:
Resource
[]
=
[];
const
mediaResources
:
Resource
[]
=
[];
const
otherResources
:
Resource
[]
=
[];
const
otherResources
:
Resource
[]
=
[];
resource
List
.
forEach
((
resource
)
=>
{
resource
s
.
forEach
((
resource
)
=>
{
const
type
=
getResourceType
(
resource
);
const
type
=
getResourceType
(
resource
);
if
(
type
===
"image/*"
||
type
===
"video/*"
)
{
if
(
type
===
"image/*"
||
type
===
"video/*"
)
{
mediaResources
.
push
(
resource
);
mediaResources
.
push
(
resource
);
...
...
web/src/components/MemoView.tsx
View file @
196facfa
import
{
Divider
,
Tooltip
}
from
"@mui/joy"
;
import
{
Divider
,
Tooltip
}
from
"@mui/joy"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
copy
from
"copy-to-clipboard"
;
import
copy
from
"copy-to-clipboard"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"react"
;
import
{
memo
,
use
Callback
,
use
Effect
,
useRef
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
;
...
@@ -153,7 +153,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -153,7 +153,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
toast
.
success
(
"Copied to clipboard!"
);
toast
.
success
(
"Copied to clipboard!"
);
};
};
const
handleMemoContentClick
=
async
(
e
:
React
.
MouseEvent
)
=>
{
const
handleMemoContentClick
=
useCallback
(
async
(
e
:
React
.
MouseEvent
)
=>
{
const
targetEl
=
e
.
target
as
HTMLElement
;
const
targetEl
=
e
.
target
as
HTMLElement
;
if
(
targetEl
.
tagName
===
"IMG"
)
{
if
(
targetEl
.
tagName
===
"IMG"
)
{
...
@@ -162,7 +162,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -162,7 +162,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
showPreviewImageDialog
([
imgUrl
],
0
);
showPreviewImageDialog
([
imgUrl
],
0
);
}
}
}
}
};
}
,
[])
;
return
(
return
(
<
div
<
div
...
@@ -257,7 +257,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -257,7 +257,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
</
div
>
</
div
>
</
div
>
</
div
>
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
readonly
}
onClick=
{
handleMemoContentClick
}
/>
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
readonly
}
onClick=
{
handleMemoContentClick
}
/>
<
MemoResourceListView
resource
List
=
{
memo
.
resources
}
/>
<
MemoResourceListView
resource
s
=
{
memo
.
resources
}
/>
<
MemoRelationListView
memo=
{
memo
}
relationList=
{
referenceRelations
}
/>
<
MemoRelationListView
memo=
{
memo
}
relationList=
{
referenceRelations
}
/>
</
div
>
</
div
>
);
);
...
...
web/src/components/ShareMemoDialog.tsx
View file @
196facfa
...
@@ -113,7 +113,7 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
...
@@ -113,7 +113,7 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
<
span
className=
"w-full px-6 pt-5 pb-2 text-sm text-gray-500"
>
{
getDateTimeString
(
memo
.
displayTime
)
}
</
span
>
<
span
className=
"w-full px-6 pt-5 pb-2 text-sm text-gray-500"
>
{
getDateTimeString
(
memo
.
displayTime
)
}
</
span
>
<
div
className=
"w-full px-6 text-base pb-4"
>
<
div
className=
"w-full px-6 text-base pb-4"
>
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
true
}
disableFilter
/>
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
true
}
disableFilter
/>
<
MemoResourceListView
resource
List
=
{
memo
.
resources
}
/>
<
MemoResourceListView
resource
s
=
{
memo
.
resources
}
/>
</
div
>
</
div
>
<
div
className=
"flex flex-row justify-between items-center w-full bg-gray-100 dark:bg-zinc-900 py-4 px-6"
>
<
div
className=
"flex flex-row justify-between items-center w-full bg-gray-100 dark:bg-zinc-900 py-4 px-6"
>
<
div
className=
"flex flex-row justify-start items-center"
>
<
div
className=
"flex flex-row justify-start items-center"
>
...
...
web/src/pages/MemoDetail.tsx
View file @
196facfa
...
@@ -137,7 +137,7 @@ const MemoDetail = () => {
...
@@ -137,7 +137,7 @@ const MemoDetail = () => {
</
div
>
</
div
>
)
}
)
}
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
readonly
}
/>
<
MemoContent
memoId=
{
memo
.
id
}
nodes=
{
memo
.
nodes
}
readonly=
{
readonly
}
/>
<
MemoResourceListView
resource
List
=
{
memo
.
resources
}
/>
<
MemoResourceListView
resource
s
=
{
memo
.
resources
}
/>
<
MemoRelationListView
memo=
{
memo
}
relationList=
{
referenceRelations
}
/>
<
MemoRelationListView
memo=
{
memo
}
relationList=
{
referenceRelations
}
/>
<
div
className=
"w-full mt-3 flex flex-row justify-between items-center gap-2"
>
<
div
className=
"w-full mt-3 flex flex-row justify-between items-center gap-2"
>
<
div
className=
"flex flex-row justify-start items-center"
>
<
div
className=
"flex flex-row justify-start items-center"
>
...
...
web/src/store/v1/index.ts
View file @
196facfa
...
@@ -2,3 +2,4 @@ export * from "./user";
...
@@ -2,3 +2,4 @@ export * from "./user";
export
*
from
"./memo"
;
export
*
from
"./memo"
;
export
*
from
"./inbox"
;
export
*
from
"./inbox"
;
export
*
from
"./resourceName"
;
export
*
from
"./resourceName"
;
export
*
from
"./resource"
;
web/src/store/v1/resource.ts
0 → 100644
View file @
196facfa
import
{
create
}
from
"zustand"
;
import
{
combine
}
from
"zustand/middleware"
;
import
{
resourceServiceClient
}
from
"@/grpcweb"
;
import
{
Resource
}
from
"@/types/proto/api/v2/resource_service"
;
interface
State
{
resourceMapById
:
Record
<
number
,
Resource
>
;
}
const
getDefaultState
=
():
State
=>
({
resourceMapById
:
{},
});
export
const
useResourceStore
=
create
(
combine
(
getDefaultState
(),
(
set
,
get
)
=>
({
setState
:
(
state
:
State
)
=>
set
(
state
),
getState
:
()
=>
get
(),
getOrFetchResourceById
:
async
(
id
:
number
,
options
?:
{
skipCache
?:
boolean
;
skipStore
?:
boolean
})
=>
{
const
resourceMap
=
get
().
resourceMapById
;
const
resource
=
resourceMap
[
id
];
if
(
resource
&&
!
options
?.
skipCache
)
{
return
resource
;
}
const
res
=
await
resourceServiceClient
.
getResource
({
id
,
});
if
(
!
res
.
resource
)
{
throw
new
Error
(
"Resource not found"
);
}
if
(
!
options
?.
skipStore
)
{
resourceMap
[
id
]
=
res
.
resource
;
set
({
resourceMapById
:
resourceMap
});
}
return
res
.
resource
;
},
getResourceById
:
(
id
:
number
)
=>
{
return
get
().
resourceMapById
[
id
];
},
}))
);
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