mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: add batch upsert tags
This commit is contained in:
@ -585,6 +585,16 @@ ExportMemos exports memos.
|
|||||||
| 200 | A successful response. | [v2GetTagSuggestionsResponse](#v2gettagsuggestionsresponse) |
|
| 200 | A successful response. | [v2GetTagSuggestionsResponse](#v2gettagsuggestionsresponse) |
|
||||||
| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) |
|
| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) |
|
||||||
|
|
||||||
|
### /api/v2/tags:batchUpsert
|
||||||
|
|
||||||
|
#### POST
|
||||||
|
##### Responses
|
||||||
|
|
||||||
|
| Code | Description | Schema |
|
||||||
|
| ---- | ----------- | ------ |
|
||||||
|
| 200 | A successful response. | [v2BatchUpsertTagResponse](#v2batchupserttagresponse) |
|
||||||
|
| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) |
|
||||||
|
|
||||||
### /api/v2/tags:rename
|
### /api/v2/tags:rename
|
||||||
|
|
||||||
#### PATCH
|
#### PATCH
|
||||||
@ -1033,6 +1043,12 @@ CreateUser creates a new user.
|
|||||||
| createTime | dateTime | | No |
|
| createTime | dateTime | | No |
|
||||||
| payload | [apiv2ActivityPayload](#apiv2activitypayload) | | No |
|
| payload | [apiv2ActivityPayload](#apiv2activitypayload) | | No |
|
||||||
|
|
||||||
|
#### v2BatchUpsertTagResponse
|
||||||
|
|
||||||
|
| Name | Type | Description | Required |
|
||||||
|
| ---- | ---- | ----------- | -------- |
|
||||||
|
| v2BatchUpsertTagResponse | object | | |
|
||||||
|
|
||||||
#### v2CreateMemoCommentResponse
|
#### v2CreateMemoCommentResponse
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
@ -1425,6 +1441,12 @@ CreateUser creates a new user.
|
|||||||
| ---- | ---- | ----------- | -------- |
|
| ---- | ---- | ----------- | -------- |
|
||||||
| workspaceProfile | [v2WorkspaceProfile](#v2workspaceprofile) | | No |
|
| workspaceProfile | [v2WorkspaceProfile](#v2workspaceprofile) | | No |
|
||||||
|
|
||||||
|
#### v2UpsertTagRequest
|
||||||
|
|
||||||
|
| Name | Type | Description | Required |
|
||||||
|
| ---- | ---- | ----------- | -------- |
|
||||||
|
| name | string | | No |
|
||||||
|
|
||||||
#### v2UpsertTagResponse
|
#### v2UpsertTagResponse
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|
@ -736,6 +736,20 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
tags:
|
tags:
|
||||||
- TagService
|
- TagService
|
||||||
|
/api/v2/tags:batchUpsert:
|
||||||
|
post:
|
||||||
|
operationId: TagService_BatchUpsertTag
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: A successful response.
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/v2BatchUpsertTagResponse'
|
||||||
|
default:
|
||||||
|
description: An unexpected error response.
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/googlerpcStatus'
|
||||||
|
tags:
|
||||||
|
- TagService
|
||||||
/api/v2/tags:rename:
|
/api/v2/tags:rename:
|
||||||
patch:
|
patch:
|
||||||
operationId: TagService_RenameTag
|
operationId: TagService_RenameTag
|
||||||
@ -1416,6 +1430,8 @@ definitions:
|
|||||||
format: date-time
|
format: date-time
|
||||||
payload:
|
payload:
|
||||||
$ref: '#/definitions/apiv2ActivityPayload'
|
$ref: '#/definitions/apiv2ActivityPayload'
|
||||||
|
v2BatchUpsertTagResponse:
|
||||||
|
type: object
|
||||||
v2CreateMemoCommentResponse:
|
v2CreateMemoCommentResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@ -1836,6 +1852,11 @@ definitions:
|
|||||||
properties:
|
properties:
|
||||||
workspaceProfile:
|
workspaceProfile:
|
||||||
$ref: '#/definitions/v2WorkspaceProfile'
|
$ref: '#/definitions/v2WorkspaceProfile'
|
||||||
|
v2UpsertTagRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
v2UpsertTagResponse:
|
v2UpsertTagResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -11,9 +11,6 @@ import (
|
|||||||
"github.com/google/cel-go/cel"
|
"github.com/google/cel-go/cel"
|
||||||
"github.com/lithammer/shortuuid/v4"
|
"github.com/lithammer/shortuuid/v4"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/yourselfhosted/gomark/ast"
|
|
||||||
"github.com/yourselfhosted/gomark/parser"
|
|
||||||
"github.com/yourselfhosted/gomark/parser/tokenizer"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
|
expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
@ -48,11 +45,6 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe
|
|||||||
return nil, status.Errorf(codes.InvalidArgument, "content too long")
|
return nil, status.Errorf(codes.InvalidArgument, "content too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes, err := parser.Parse(tokenizer.Tokenize(request.Content))
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to parse memo content")
|
|
||||||
}
|
|
||||||
|
|
||||||
create := &store.Memo{
|
create := &store.Memo{
|
||||||
ResourceName: shortuuid.New(),
|
ResourceName: shortuuid.New(),
|
||||||
CreatorID: user.ID,
|
CreatorID: user.ID,
|
||||||
@ -74,18 +66,6 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe
|
|||||||
}
|
}
|
||||||
metric.Enqueue("memo create")
|
metric.Enqueue("memo create")
|
||||||
|
|
||||||
// Dynamically upsert tags from memo content.
|
|
||||||
traverseASTNodes(nodes, func(node ast.Node) {
|
|
||||||
if tag, ok := node.(*ast.Tag); ok {
|
|
||||||
if _, err := s.Store.UpsertTag(ctx, &store.Tag{
|
|
||||||
Name: tag.Content,
|
|
||||||
CreatorID: user.ID,
|
|
||||||
}); err != nil {
|
|
||||||
log.Warn("Failed to create tag", zap.Error(err))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
memoMessage, err := s.convertMemoFromStore(ctx, memo)
|
memoMessage, err := s.convertMemoFromStore(ctx, memo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to convert memo")
|
return nil, errors.Wrap(err, "failed to convert memo")
|
||||||
@ -250,22 +230,6 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe
|
|||||||
for _, path := range request.UpdateMask.Paths {
|
for _, path := range request.UpdateMask.Paths {
|
||||||
if path == "content" {
|
if path == "content" {
|
||||||
update.Content = &request.Memo.Content
|
update.Content = &request.Memo.Content
|
||||||
nodes, err := parser.Parse(tokenizer.Tokenize(*update.Content))
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to parse memo content")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dynamically upsert tags from memo content.
|
|
||||||
traverseASTNodes(nodes, func(node ast.Node) {
|
|
||||||
if tag, ok := node.(*ast.Tag); ok {
|
|
||||||
if _, err := s.Store.UpsertTag(ctx, &store.Tag{
|
|
||||||
Name: tag.Content,
|
|
||||||
CreatorID: user.ID,
|
|
||||||
}); err != nil {
|
|
||||||
log.Warn("Failed to create tag", zap.Error(err))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else if path == "resource_name" {
|
} else if path == "resource_name" {
|
||||||
update.ResourceName = &request.Memo.Name
|
update.ResourceName = &request.Memo.Name
|
||||||
if !util.ResourceNameMatcher.MatchString(*update.ResourceName) {
|
if !util.ResourceNameMatcher.MatchString(*update.ResourceName) {
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package v2
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/yourselfhosted/gomark/ast"
|
|
||||||
)
|
|
||||||
|
|
||||||
func traverseASTNodes(nodes []ast.Node, fn func(ast.Node)) {
|
|
||||||
for _, node := range nodes {
|
|
||||||
fn(node)
|
|
||||||
switch n := node.(type) {
|
|
||||||
case *ast.Paragraph:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.Heading:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.Blockquote:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.OrderedList:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.UnorderedList:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.TaskList:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
case *ast.Bold:
|
|
||||||
traverseASTNodes(n.Children, fn)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,7 @@ package v2
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -11,7 +11,6 @@ import (
|
|||||||
"github.com/yourselfhosted/gomark/parser"
|
"github.com/yourselfhosted/gomark/parser"
|
||||||
"github.com/yourselfhosted/gomark/parser/tokenizer"
|
"github.com/yourselfhosted/gomark/parser/tokenizer"
|
||||||
"github.com/yourselfhosted/gomark/restore"
|
"github.com/yourselfhosted/gomark/restore"
|
||||||
"golang.org/x/exp/slices"
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
@ -42,6 +41,15 @@ func (s *APIV2Service) UpsertTag(ctx context.Context, request *apiv2pb.UpsertTag
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *APIV2Service) BatchUpsertTag(ctx context.Context, request *apiv2pb.BatchUpsertTagRequest) (*apiv2pb.BatchUpsertTagResponse, error) {
|
||||||
|
for _, r := range request.Requests {
|
||||||
|
if _, err := s.UpsertTag(ctx, r); err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to batch upsert tags: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return &apiv2pb.BatchUpsertTagResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRequest) (*apiv2pb.ListTagsResponse, error) {
|
func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRequest) (*apiv2pb.ListTagsResponse, error) {
|
||||||
username, err := ExtractUsernameFromName(request.User)
|
username, err := ExtractUsernameFromName(request.User)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -183,7 +191,7 @@ func (s *APIV2Service) GetTagSuggestions(ctx context.Context, request *apiv2pb.G
|
|||||||
ContentSearch: []string{"#"},
|
ContentSearch: []string{"#"},
|
||||||
RowStatus: &normalRowStatus,
|
RowStatus: &normalRowStatus,
|
||||||
}
|
}
|
||||||
memoList, err := s.Store.ListMemos(ctx, memoFind)
|
memos, err := s.Store.ListMemos(ctx, memoFind)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)
|
return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)
|
||||||
}
|
}
|
||||||
@ -200,12 +208,21 @@ func (s *APIV2Service) GetTagSuggestions(ctx context.Context, request *apiv2pb.G
|
|||||||
tagNameList = append(tagNameList, tag.Name)
|
tagNameList = append(tagNameList, tag.Name)
|
||||||
}
|
}
|
||||||
tagMapSet := make(map[string]bool)
|
tagMapSet := make(map[string]bool)
|
||||||
for _, memo := range memoList {
|
for _, memo := range memos {
|
||||||
for _, tag := range findTagListFromMemoContent(memo.Content) {
|
nodes, err := parser.Parse(tokenizer.Tokenize(memo.Content))
|
||||||
if !slices.Contains(tagNameList, tag) {
|
if err != nil {
|
||||||
tagMapSet[tag] = true
|
return nil, errors.Wrap(err, "failed to parse memo content")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dynamically upsert tags from memo content.
|
||||||
|
traverseASTNodes(nodes, func(node ast.Node) {
|
||||||
|
if tagNode, ok := node.(*ast.Tag); ok {
|
||||||
|
tag := tagNode.Content
|
||||||
|
if !slices.Contains(tagNameList, tag) {
|
||||||
|
tagMapSet[tag] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
suggestions := []string{}
|
suggestions := []string{}
|
||||||
for tag := range tagMapSet {
|
for tag := range tagMapSet {
|
||||||
@ -231,20 +248,24 @@ func (s *APIV2Service) convertTagFromStore(ctx context.Context, tag *store.Tag)
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var tagRegexp = regexp.MustCompile(`#([^\s#,]+)`)
|
func traverseASTNodes(nodes []ast.Node, fn func(ast.Node)) {
|
||||||
|
for _, node := range nodes {
|
||||||
func findTagListFromMemoContent(memoContent string) []string {
|
fn(node)
|
||||||
tagMapSet := make(map[string]bool)
|
switch n := node.(type) {
|
||||||
matches := tagRegexp.FindAllStringSubmatch(memoContent, -1)
|
case *ast.Paragraph:
|
||||||
for _, v := range matches {
|
traverseASTNodes(n.Children, fn)
|
||||||
tagName := v[1]
|
case *ast.Heading:
|
||||||
tagMapSet[tagName] = true
|
traverseASTNodes(n.Children, fn)
|
||||||
|
case *ast.Blockquote:
|
||||||
|
traverseASTNodes(n.Children, fn)
|
||||||
|
case *ast.OrderedList:
|
||||||
|
traverseASTNodes(n.Children, fn)
|
||||||
|
case *ast.UnorderedList:
|
||||||
|
traverseASTNodes(n.Children, fn)
|
||||||
|
case *ast.TaskList:
|
||||||
|
traverseASTNodes(n.Children, fn)
|
||||||
|
case *ast.Bold:
|
||||||
|
traverseASTNodes(n.Children, fn)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tagList := []string{}
|
|
||||||
for tag := range tagMapSet {
|
|
||||||
tagList = append(tagList, tag)
|
|
||||||
}
|
|
||||||
sort.Strings(tagList)
|
|
||||||
return tagList
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@ service TagService {
|
|||||||
rpc UpsertTag(UpsertTagRequest) returns (UpsertTagResponse) {
|
rpc UpsertTag(UpsertTagRequest) returns (UpsertTagResponse) {
|
||||||
option (google.api.http) = {post: "/api/v2/tags"};
|
option (google.api.http) = {post: "/api/v2/tags"};
|
||||||
}
|
}
|
||||||
|
rpc BatchUpsertTag(BatchUpsertTagRequest) returns (BatchUpsertTagResponse) {
|
||||||
|
option (google.api.http) = {post: "/api/v2/tags:batchUpsert"};
|
||||||
|
}
|
||||||
rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
|
rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
|
||||||
option (google.api.http) = {get: "/api/v2/tags"};
|
option (google.api.http) = {get: "/api/v2/tags"};
|
||||||
}
|
}
|
||||||
@ -39,6 +42,13 @@ message UpsertTagResponse {
|
|||||||
Tag tag = 1;
|
Tag tag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message BatchUpsertTagRequest {
|
||||||
|
repeated UpsertTagRequest requests = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BatchUpsertTagResponse {
|
||||||
|
}
|
||||||
|
|
||||||
message ListTagsRequest {
|
message ListTagsRequest {
|
||||||
// The creator of tags.
|
// The creator of tags.
|
||||||
// Format: users/{username}
|
// Format: users/{username}
|
||||||
|
@ -134,6 +134,8 @@
|
|||||||
- [MemoService](#memos-api-v2-MemoService)
|
- [MemoService](#memos-api-v2-MemoService)
|
||||||
|
|
||||||
- [api/v2/tag_service.proto](#api_v2_tag_service-proto)
|
- [api/v2/tag_service.proto](#api_v2_tag_service-proto)
|
||||||
|
- [BatchUpsertTagRequest](#memos-api-v2-BatchUpsertTagRequest)
|
||||||
|
- [BatchUpsertTagResponse](#memos-api-v2-BatchUpsertTagResponse)
|
||||||
- [DeleteTagRequest](#memos-api-v2-DeleteTagRequest)
|
- [DeleteTagRequest](#memos-api-v2-DeleteTagRequest)
|
||||||
- [DeleteTagResponse](#memos-api-v2-DeleteTagResponse)
|
- [DeleteTagResponse](#memos-api-v2-DeleteTagResponse)
|
||||||
- [GetTagSuggestionsRequest](#memos-api-v2-GetTagSuggestionsRequest)
|
- [GetTagSuggestionsRequest](#memos-api-v2-GetTagSuggestionsRequest)
|
||||||
@ -1869,6 +1871,31 @@ Used internally for obfuscating the page token.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="memos-api-v2-BatchUpsertTagRequest"></a>
|
||||||
|
|
||||||
|
### BatchUpsertTagRequest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Field | Type | Label | Description |
|
||||||
|
| ----- | ---- | ----- | ----------- |
|
||||||
|
| requests | [UpsertTagRequest](#memos-api-v2-UpsertTagRequest) | repeated | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="memos-api-v2-BatchUpsertTagResponse"></a>
|
||||||
|
|
||||||
|
### BatchUpsertTagResponse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="memos-api-v2-DeleteTagRequest"></a>
|
<a name="memos-api-v2-DeleteTagRequest"></a>
|
||||||
|
|
||||||
### DeleteTagRequest
|
### DeleteTagRequest
|
||||||
@ -2046,6 +2073,7 @@ Used internally for obfuscating the page token.
|
|||||||
| Method Name | Request Type | Response Type | Description |
|
| Method Name | Request Type | Response Type | Description |
|
||||||
| ----------- | ------------ | ------------- | ------------|
|
| ----------- | ------------ | ------------- | ------------|
|
||||||
| UpsertTag | [UpsertTagRequest](#memos-api-v2-UpsertTagRequest) | [UpsertTagResponse](#memos-api-v2-UpsertTagResponse) | |
|
| UpsertTag | [UpsertTagRequest](#memos-api-v2-UpsertTagRequest) | [UpsertTagResponse](#memos-api-v2-UpsertTagResponse) | |
|
||||||
|
| BatchUpsertTag | [BatchUpsertTagRequest](#memos-api-v2-BatchUpsertTagRequest) | [BatchUpsertTagResponse](#memos-api-v2-BatchUpsertTagResponse) | |
|
||||||
| ListTags | [ListTagsRequest](#memos-api-v2-ListTagsRequest) | [ListTagsResponse](#memos-api-v2-ListTagsResponse) | |
|
| ListTags | [ListTagsRequest](#memos-api-v2-ListTagsRequest) | [ListTagsResponse](#memos-api-v2-ListTagsResponse) | |
|
||||||
| RenameTag | [RenameTagRequest](#memos-api-v2-RenameTagRequest) | [RenameTagResponse](#memos-api-v2-RenameTagResponse) | |
|
| RenameTag | [RenameTagRequest](#memos-api-v2-RenameTagRequest) | [RenameTagResponse](#memos-api-v2-RenameTagResponse) | |
|
||||||
| DeleteTag | [DeleteTagRequest](#memos-api-v2-DeleteTagRequest) | [DeleteTagResponse](#memos-api-v2-DeleteTagResponse) | |
|
| DeleteTag | [DeleteTagRequest](#memos-api-v2-DeleteTagRequest) | [DeleteTagResponse](#memos-api-v2-DeleteTagResponse) | |
|
||||||
|
@ -172,6 +172,91 @@ func (x *UpsertTagResponse) GetTag() *Tag {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BatchUpsertTagRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Requests []*UpsertTagRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagRequest) Reset() {
|
||||||
|
*x = BatchUpsertTagRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v2_tag_service_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*BatchUpsertTagRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v2_tag_service_proto_msgTypes[3]
|
||||||
|
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 BatchUpsertTagRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*BatchUpsertTagRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagRequest) GetRequests() []*UpsertTagRequest {
|
||||||
|
if x != nil {
|
||||||
|
return x.Requests
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type BatchUpsertTagResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagResponse) Reset() {
|
||||||
|
*x = BatchUpsertTagResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v2_tag_service_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*BatchUpsertTagResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *BatchUpsertTagResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v2_tag_service_proto_msgTypes[4]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use BatchUpsertTagResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*BatchUpsertTagResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
type ListTagsRequest struct {
|
type ListTagsRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -185,7 +270,7 @@ type ListTagsRequest struct {
|
|||||||
func (x *ListTagsRequest) Reset() {
|
func (x *ListTagsRequest) Reset() {
|
||||||
*x = ListTagsRequest{}
|
*x = ListTagsRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[3]
|
mi := &file_api_v2_tag_service_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -198,7 +283,7 @@ func (x *ListTagsRequest) String() string {
|
|||||||
func (*ListTagsRequest) ProtoMessage() {}
|
func (*ListTagsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListTagsRequest) ProtoReflect() protoreflect.Message {
|
func (x *ListTagsRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[3]
|
mi := &file_api_v2_tag_service_proto_msgTypes[5]
|
||||||
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 {
|
||||||
@ -211,7 +296,7 @@ func (x *ListTagsRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListTagsRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListTagsRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ListTagsRequest) Descriptor() ([]byte, []int) {
|
func (*ListTagsRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{3}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListTagsRequest) GetUser() string {
|
func (x *ListTagsRequest) GetUser() string {
|
||||||
@ -232,7 +317,7 @@ type ListTagsResponse struct {
|
|||||||
func (x *ListTagsResponse) Reset() {
|
func (x *ListTagsResponse) Reset() {
|
||||||
*x = ListTagsResponse{}
|
*x = ListTagsResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[4]
|
mi := &file_api_v2_tag_service_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -245,7 +330,7 @@ func (x *ListTagsResponse) String() string {
|
|||||||
func (*ListTagsResponse) ProtoMessage() {}
|
func (*ListTagsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListTagsResponse) ProtoReflect() protoreflect.Message {
|
func (x *ListTagsResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[4]
|
mi := &file_api_v2_tag_service_proto_msgTypes[6]
|
||||||
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 {
|
||||||
@ -258,7 +343,7 @@ func (x *ListTagsResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListTagsResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListTagsResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ListTagsResponse) Descriptor() ([]byte, []int) {
|
func (*ListTagsResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{4}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListTagsResponse) GetTags() []*Tag {
|
func (x *ListTagsResponse) GetTags() []*Tag {
|
||||||
@ -283,7 +368,7 @@ type RenameTagRequest struct {
|
|||||||
func (x *RenameTagRequest) Reset() {
|
func (x *RenameTagRequest) Reset() {
|
||||||
*x = RenameTagRequest{}
|
*x = RenameTagRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[5]
|
mi := &file_api_v2_tag_service_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -296,7 +381,7 @@ func (x *RenameTagRequest) String() string {
|
|||||||
func (*RenameTagRequest) ProtoMessage() {}
|
func (*RenameTagRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RenameTagRequest) ProtoReflect() protoreflect.Message {
|
func (x *RenameTagRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[5]
|
mi := &file_api_v2_tag_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 {
|
||||||
@ -309,7 +394,7 @@ func (x *RenameTagRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RenameTagRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RenameTagRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*RenameTagRequest) Descriptor() ([]byte, []int) {
|
func (*RenameTagRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{5}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RenameTagRequest) GetUser() string {
|
func (x *RenameTagRequest) GetUser() string {
|
||||||
@ -344,7 +429,7 @@ type RenameTagResponse struct {
|
|||||||
func (x *RenameTagResponse) Reset() {
|
func (x *RenameTagResponse) Reset() {
|
||||||
*x = RenameTagResponse{}
|
*x = RenameTagResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[6]
|
mi := &file_api_v2_tag_service_proto_msgTypes[8]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -357,7 +442,7 @@ func (x *RenameTagResponse) String() string {
|
|||||||
func (*RenameTagResponse) ProtoMessage() {}
|
func (*RenameTagResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RenameTagResponse) ProtoReflect() protoreflect.Message {
|
func (x *RenameTagResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[6]
|
mi := &file_api_v2_tag_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 {
|
||||||
@ -370,7 +455,7 @@ func (x *RenameTagResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RenameTagResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RenameTagResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*RenameTagResponse) Descriptor() ([]byte, []int) {
|
func (*RenameTagResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{6}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RenameTagResponse) GetTag() *Tag {
|
func (x *RenameTagResponse) GetTag() *Tag {
|
||||||
@ -391,7 +476,7 @@ type DeleteTagRequest struct {
|
|||||||
func (x *DeleteTagRequest) Reset() {
|
func (x *DeleteTagRequest) Reset() {
|
||||||
*x = DeleteTagRequest{}
|
*x = DeleteTagRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[7]
|
mi := &file_api_v2_tag_service_proto_msgTypes[9]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -404,7 +489,7 @@ func (x *DeleteTagRequest) String() string {
|
|||||||
func (*DeleteTagRequest) ProtoMessage() {}
|
func (*DeleteTagRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteTagRequest) ProtoReflect() protoreflect.Message {
|
func (x *DeleteTagRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[7]
|
mi := &file_api_v2_tag_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 {
|
||||||
@ -417,7 +502,7 @@ func (x *DeleteTagRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteTagRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteTagRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteTagRequest) Descriptor() ([]byte, []int) {
|
func (*DeleteTagRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{7}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{9}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteTagRequest) GetTag() *Tag {
|
func (x *DeleteTagRequest) GetTag() *Tag {
|
||||||
@ -436,7 +521,7 @@ type DeleteTagResponse struct {
|
|||||||
func (x *DeleteTagResponse) Reset() {
|
func (x *DeleteTagResponse) Reset() {
|
||||||
*x = DeleteTagResponse{}
|
*x = DeleteTagResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[8]
|
mi := &file_api_v2_tag_service_proto_msgTypes[10]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -449,7 +534,7 @@ func (x *DeleteTagResponse) String() string {
|
|||||||
func (*DeleteTagResponse) ProtoMessage() {}
|
func (*DeleteTagResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteTagResponse) ProtoReflect() protoreflect.Message {
|
func (x *DeleteTagResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[8]
|
mi := &file_api_v2_tag_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 {
|
||||||
@ -462,7 +547,7 @@ func (x *DeleteTagResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteTagResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteTagResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteTagResponse) Descriptor() ([]byte, []int) {
|
func (*DeleteTagResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{8}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetTagSuggestionsRequest struct {
|
type GetTagSuggestionsRequest struct {
|
||||||
@ -478,7 +563,7 @@ type GetTagSuggestionsRequest struct {
|
|||||||
func (x *GetTagSuggestionsRequest) Reset() {
|
func (x *GetTagSuggestionsRequest) Reset() {
|
||||||
*x = GetTagSuggestionsRequest{}
|
*x = GetTagSuggestionsRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[9]
|
mi := &file_api_v2_tag_service_proto_msgTypes[11]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -491,7 +576,7 @@ func (x *GetTagSuggestionsRequest) String() string {
|
|||||||
func (*GetTagSuggestionsRequest) ProtoMessage() {}
|
func (*GetTagSuggestionsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetTagSuggestionsRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetTagSuggestionsRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[9]
|
mi := &file_api_v2_tag_service_proto_msgTypes[11]
|
||||||
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 {
|
||||||
@ -504,7 +589,7 @@ func (x *GetTagSuggestionsRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetTagSuggestionsRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetTagSuggestionsRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetTagSuggestionsRequest) Descriptor() ([]byte, []int) {
|
func (*GetTagSuggestionsRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{9}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{11}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetTagSuggestionsRequest) GetUser() string {
|
func (x *GetTagSuggestionsRequest) GetUser() string {
|
||||||
@ -525,7 +610,7 @@ type GetTagSuggestionsResponse struct {
|
|||||||
func (x *GetTagSuggestionsResponse) Reset() {
|
func (x *GetTagSuggestionsResponse) Reset() {
|
||||||
*x = GetTagSuggestionsResponse{}
|
*x = GetTagSuggestionsResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[10]
|
mi := &file_api_v2_tag_service_proto_msgTypes[12]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -538,7 +623,7 @@ func (x *GetTagSuggestionsResponse) String() string {
|
|||||||
func (*GetTagSuggestionsResponse) ProtoMessage() {}
|
func (*GetTagSuggestionsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetTagSuggestionsResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetTagSuggestionsResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_tag_service_proto_msgTypes[10]
|
mi := &file_api_v2_tag_service_proto_msgTypes[12]
|
||||||
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 {
|
||||||
@ -551,7 +636,7 @@ func (x *GetTagSuggestionsResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetTagSuggestionsResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetTagSuggestionsResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetTagSuggestionsResponse) Descriptor() ([]byte, []int) {
|
func (*GetTagSuggestionsResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{10}
|
return file_api_v2_tag_service_proto_rawDescGZIP(), []int{12}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetTagSuggestionsResponse) GetTags() []string {
|
func (x *GetTagSuggestionsResponse) GetTags() []string {
|
||||||
@ -577,80 +662,95 @@ var file_api_v2_tag_service_proto_rawDesc = []byte{
|
|||||||
0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x11, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67,
|
0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x11, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x25, 0x0a,
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x53, 0x0a,
|
||||||
0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x15, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||||
|
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61,
|
||||||
|
0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72,
|
||||||
|
0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x0a, 0x0f,
|
||||||
|
0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
|
0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75,
|
||||||
|
0x73, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18,
|
||||||
|
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0x5c,
|
||||||
|
0x0a, 0x10, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, 0x61,
|
||||||
|
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x4e, 0x61, 0x6d,
|
||||||
|
0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x11,
|
||||||
|
0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x12, 0x23, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11,
|
||||||
|
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61,
|
||||||
|
0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x37, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
||||||
|
0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x03, 0x74, 0x61,
|
||||||
|
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||||
|
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22,
|
||||||
|
0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53, 0x75,
|
||||||
|
0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||||
0x75, 0x73, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73,
|
0x75, 0x73, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53, 0x75,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73,
|
0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
|
0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
|
||||||
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22,
|
0x04, 0x74, 0x61, 0x67, 0x73, 0x32, 0xa7, 0x05, 0x0a, 0x0a, 0x54, 0x61, 0x67, 0x53, 0x65, 0x72,
|
||||||
0x5c, 0x0a, 0x10, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75,
|
0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x09, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61,
|
||||||
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x67, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
||||||
0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x6e,
|
0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x4e, 0x61,
|
0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
||||||
0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03,
|
0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a,
|
0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x0c, 0x2f, 0x61, 0x70, 0x69,
|
||||||
0x11, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x7d, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63,
|
||||||
0x73, 0x65, 0x12, 0x23, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d,
|
||||||
0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54,
|
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55,
|
||||||
0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x37, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x03, 0x74,
|
0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42,
|
||||||
0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73,
|
||||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x18, 0x2f,
|
||||||
0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73,
|
0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53,
|
0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x12, 0x5f, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54,
|
||||||
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x61, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||||
0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53,
|
0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||||
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69,
|
||||||
0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x32, 0xa8, 0x04, 0x0a, 0x0a, 0x54, 0x61, 0x67, 0x53, 0x65,
|
0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x69, 0x0a, 0x09, 0x52, 0x65, 0x6e, 0x61,
|
||||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x09, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54,
|
0x6d, 0x65, 0x54, 0x61, 0x67, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x61, 0x67, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65,
|
||||||
0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65,
|
||||||
0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x32, 0x13,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x0c, 0x2f, 0x61, 0x70,
|
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x72, 0x65, 0x6e,
|
||||||
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x5f, 0x0a, 0x08, 0x4c, 0x69, 0x73,
|
0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67,
|
||||||
0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71,
|
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70,
|
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61,
|
0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x2a, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||||
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x69, 0x0a, 0x09, 0x52, 0x65,
|
0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
0x61, 0x67, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e,
|
||||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67,
|
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
0x54, 0x61, 0x67, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
|
||||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x67,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15,
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53, 0x75, 0x67, 0x67, 0x65,
|
||||||
0x32, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x72,
|
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f,
|
||||||
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54,
|
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f,
|
||||||
0x61, 0x67, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
0x74, 0x61, 0x67, 0x73, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x42,
|
||||||
0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0xa7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
0x69, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x54, 0x61, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x2a, 0x0c, 0x2f, 0x61, 0x70,
|
0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d,
|
||||||
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x11, 0x47, 0x65,
|
0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69,
|
||||||
0x74, 0x54, 0x61, 0x67, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa,
|
||||||
0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47,
|
0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02,
|
||||||
0x65, 0x74, 0x54, 0x61, 0x67, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42,
|
||||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x67, 0x53, 0x75, 0x67,
|
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73,
|
||||||
0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
0x33,
|
||||||
0x32, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x42, 0xa7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
|
||||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x54, 0x61, 0x67, 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 (
|
||||||
@ -665,40 +765,45 @@ func file_api_v2_tag_service_proto_rawDescGZIP() []byte {
|
|||||||
return file_api_v2_tag_service_proto_rawDescData
|
return file_api_v2_tag_service_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_api_v2_tag_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
var file_api_v2_tag_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||||
var file_api_v2_tag_service_proto_goTypes = []interface{}{
|
var file_api_v2_tag_service_proto_goTypes = []interface{}{
|
||||||
(*Tag)(nil), // 0: memos.api.v2.Tag
|
(*Tag)(nil), // 0: memos.api.v2.Tag
|
||||||
(*UpsertTagRequest)(nil), // 1: memos.api.v2.UpsertTagRequest
|
(*UpsertTagRequest)(nil), // 1: memos.api.v2.UpsertTagRequest
|
||||||
(*UpsertTagResponse)(nil), // 2: memos.api.v2.UpsertTagResponse
|
(*UpsertTagResponse)(nil), // 2: memos.api.v2.UpsertTagResponse
|
||||||
(*ListTagsRequest)(nil), // 3: memos.api.v2.ListTagsRequest
|
(*BatchUpsertTagRequest)(nil), // 3: memos.api.v2.BatchUpsertTagRequest
|
||||||
(*ListTagsResponse)(nil), // 4: memos.api.v2.ListTagsResponse
|
(*BatchUpsertTagResponse)(nil), // 4: memos.api.v2.BatchUpsertTagResponse
|
||||||
(*RenameTagRequest)(nil), // 5: memos.api.v2.RenameTagRequest
|
(*ListTagsRequest)(nil), // 5: memos.api.v2.ListTagsRequest
|
||||||
(*RenameTagResponse)(nil), // 6: memos.api.v2.RenameTagResponse
|
(*ListTagsResponse)(nil), // 6: memos.api.v2.ListTagsResponse
|
||||||
(*DeleteTagRequest)(nil), // 7: memos.api.v2.DeleteTagRequest
|
(*RenameTagRequest)(nil), // 7: memos.api.v2.RenameTagRequest
|
||||||
(*DeleteTagResponse)(nil), // 8: memos.api.v2.DeleteTagResponse
|
(*RenameTagResponse)(nil), // 8: memos.api.v2.RenameTagResponse
|
||||||
(*GetTagSuggestionsRequest)(nil), // 9: memos.api.v2.GetTagSuggestionsRequest
|
(*DeleteTagRequest)(nil), // 9: memos.api.v2.DeleteTagRequest
|
||||||
(*GetTagSuggestionsResponse)(nil), // 10: memos.api.v2.GetTagSuggestionsResponse
|
(*DeleteTagResponse)(nil), // 10: memos.api.v2.DeleteTagResponse
|
||||||
|
(*GetTagSuggestionsRequest)(nil), // 11: memos.api.v2.GetTagSuggestionsRequest
|
||||||
|
(*GetTagSuggestionsResponse)(nil), // 12: memos.api.v2.GetTagSuggestionsResponse
|
||||||
}
|
}
|
||||||
var file_api_v2_tag_service_proto_depIdxs = []int32{
|
var file_api_v2_tag_service_proto_depIdxs = []int32{
|
||||||
0, // 0: memos.api.v2.UpsertTagResponse.tag:type_name -> memos.api.v2.Tag
|
0, // 0: memos.api.v2.UpsertTagResponse.tag:type_name -> memos.api.v2.Tag
|
||||||
0, // 1: memos.api.v2.ListTagsResponse.tags:type_name -> memos.api.v2.Tag
|
1, // 1: memos.api.v2.BatchUpsertTagRequest.requests:type_name -> memos.api.v2.UpsertTagRequest
|
||||||
0, // 2: memos.api.v2.RenameTagResponse.tag:type_name -> memos.api.v2.Tag
|
0, // 2: memos.api.v2.ListTagsResponse.tags:type_name -> memos.api.v2.Tag
|
||||||
0, // 3: memos.api.v2.DeleteTagRequest.tag:type_name -> memos.api.v2.Tag
|
0, // 3: memos.api.v2.RenameTagResponse.tag:type_name -> memos.api.v2.Tag
|
||||||
1, // 4: memos.api.v2.TagService.UpsertTag:input_type -> memos.api.v2.UpsertTagRequest
|
0, // 4: memos.api.v2.DeleteTagRequest.tag:type_name -> memos.api.v2.Tag
|
||||||
3, // 5: memos.api.v2.TagService.ListTags:input_type -> memos.api.v2.ListTagsRequest
|
1, // 5: memos.api.v2.TagService.UpsertTag:input_type -> memos.api.v2.UpsertTagRequest
|
||||||
5, // 6: memos.api.v2.TagService.RenameTag:input_type -> memos.api.v2.RenameTagRequest
|
3, // 6: memos.api.v2.TagService.BatchUpsertTag:input_type -> memos.api.v2.BatchUpsertTagRequest
|
||||||
7, // 7: memos.api.v2.TagService.DeleteTag:input_type -> memos.api.v2.DeleteTagRequest
|
5, // 7: memos.api.v2.TagService.ListTags:input_type -> memos.api.v2.ListTagsRequest
|
||||||
9, // 8: memos.api.v2.TagService.GetTagSuggestions:input_type -> memos.api.v2.GetTagSuggestionsRequest
|
7, // 8: memos.api.v2.TagService.RenameTag:input_type -> memos.api.v2.RenameTagRequest
|
||||||
2, // 9: memos.api.v2.TagService.UpsertTag:output_type -> memos.api.v2.UpsertTagResponse
|
9, // 9: memos.api.v2.TagService.DeleteTag:input_type -> memos.api.v2.DeleteTagRequest
|
||||||
4, // 10: memos.api.v2.TagService.ListTags:output_type -> memos.api.v2.ListTagsResponse
|
11, // 10: memos.api.v2.TagService.GetTagSuggestions:input_type -> memos.api.v2.GetTagSuggestionsRequest
|
||||||
6, // 11: memos.api.v2.TagService.RenameTag:output_type -> memos.api.v2.RenameTagResponse
|
2, // 11: memos.api.v2.TagService.UpsertTag:output_type -> memos.api.v2.UpsertTagResponse
|
||||||
8, // 12: memos.api.v2.TagService.DeleteTag:output_type -> memos.api.v2.DeleteTagResponse
|
4, // 12: memos.api.v2.TagService.BatchUpsertTag:output_type -> memos.api.v2.BatchUpsertTagResponse
|
||||||
10, // 13: memos.api.v2.TagService.GetTagSuggestions:output_type -> memos.api.v2.GetTagSuggestionsResponse
|
6, // 13: memos.api.v2.TagService.ListTags:output_type -> memos.api.v2.ListTagsResponse
|
||||||
9, // [9:14] is the sub-list for method output_type
|
8, // 14: memos.api.v2.TagService.RenameTag:output_type -> memos.api.v2.RenameTagResponse
|
||||||
4, // [4:9] is the sub-list for method input_type
|
10, // 15: memos.api.v2.TagService.DeleteTag:output_type -> memos.api.v2.DeleteTagResponse
|
||||||
4, // [4:4] is the sub-list for extension type_name
|
12, // 16: memos.api.v2.TagService.GetTagSuggestions:output_type -> memos.api.v2.GetTagSuggestionsResponse
|
||||||
4, // [4:4] is the sub-list for extension extendee
|
11, // [11:17] is the sub-list for method output_type
|
||||||
0, // [0:4] is the sub-list for field type_name
|
5, // [5:11] is the sub-list for method input_type
|
||||||
|
5, // [5:5] is the sub-list for extension type_name
|
||||||
|
5, // [5:5] is the sub-list for extension extendee
|
||||||
|
0, // [0:5] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_api_v2_tag_service_proto_init() }
|
func init() { file_api_v2_tag_service_proto_init() }
|
||||||
@ -744,7 +849,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ListTagsRequest); i {
|
switch v := v.(*BatchUpsertTagRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -756,7 +861,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ListTagsResponse); i {
|
switch v := v.(*BatchUpsertTagResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -768,7 +873,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*RenameTagRequest); i {
|
switch v := v.(*ListTagsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -780,7 +885,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*RenameTagResponse); i {
|
switch v := v.(*ListTagsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -792,7 +897,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*DeleteTagRequest); i {
|
switch v := v.(*RenameTagRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -804,7 +909,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*DeleteTagResponse); i {
|
switch v := v.(*RenameTagResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -816,7 +921,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetTagSuggestionsRequest); i {
|
switch v := v.(*DeleteTagRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -828,6 +933,30 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_tag_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_tag_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DeleteTagResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v2_tag_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*GetTagSuggestionsRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v2_tag_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetTagSuggestionsResponse); i {
|
switch v := v.(*GetTagSuggestionsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -846,7 +975,7 @@ func file_api_v2_tag_service_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_api_v2_tag_service_proto_rawDesc,
|
RawDescriptor: file_api_v2_tag_service_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 11,
|
NumMessages: 13,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -67,6 +67,42 @@ func local_request_TagService_UpsertTag_0(ctx context.Context, marshaler runtime
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_TagService_BatchUpsertTag_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_TagService_BatchUpsertTag_0(ctx context.Context, marshaler runtime.Marshaler, client TagServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq BatchUpsertTagRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_TagService_BatchUpsertTag_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.BatchUpsertTag(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_TagService_BatchUpsertTag_0(ctx context.Context, marshaler runtime.Marshaler, server TagServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq BatchUpsertTagRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_TagService_BatchUpsertTag_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.BatchUpsertTag(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
filter_TagService_ListTags_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
filter_TagService_ListTags_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
)
|
)
|
||||||
@ -242,6 +278,31 @@ func RegisterTagServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_TagService_BatchUpsertTag_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.TagService/BatchUpsertTag", runtime.WithHTTPPathPattern("/api/v2/tags:batchUpsert"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_TagService_BatchUpsertTag_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_TagService_BatchUpsertTag_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_TagService_ListTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_TagService_ListTags_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()
|
||||||
@ -405,6 +466,28 @@ func RegisterTagServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_TagService_BatchUpsertTag_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.TagService/BatchUpsertTag", runtime.WithHTTPPathPattern("/api/v2/tags:batchUpsert"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_TagService_BatchUpsertTag_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_TagService_BatchUpsertTag_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_TagService_ListTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_TagService_ListTags_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()
|
||||||
@ -499,6 +582,8 @@ func RegisterTagServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
|
|||||||
var (
|
var (
|
||||||
pattern_TagService_UpsertTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, ""))
|
pattern_TagService_UpsertTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, ""))
|
||||||
|
|
||||||
|
pattern_TagService_BatchUpsertTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, "batchUpsert"))
|
||||||
|
|
||||||
pattern_TagService_ListTags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, ""))
|
pattern_TagService_ListTags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, ""))
|
||||||
|
|
||||||
pattern_TagService_RenameTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, "rename"))
|
pattern_TagService_RenameTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "tags"}, "rename"))
|
||||||
@ -511,6 +596,8 @@ var (
|
|||||||
var (
|
var (
|
||||||
forward_TagService_UpsertTag_0 = runtime.ForwardResponseMessage
|
forward_TagService_UpsertTag_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_TagService_BatchUpsertTag_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_TagService_ListTags_0 = runtime.ForwardResponseMessage
|
forward_TagService_ListTags_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_TagService_RenameTag_0 = runtime.ForwardResponseMessage
|
forward_TagService_RenameTag_0 = runtime.ForwardResponseMessage
|
||||||
|
@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
TagService_UpsertTag_FullMethodName = "/memos.api.v2.TagService/UpsertTag"
|
TagService_UpsertTag_FullMethodName = "/memos.api.v2.TagService/UpsertTag"
|
||||||
|
TagService_BatchUpsertTag_FullMethodName = "/memos.api.v2.TagService/BatchUpsertTag"
|
||||||
TagService_ListTags_FullMethodName = "/memos.api.v2.TagService/ListTags"
|
TagService_ListTags_FullMethodName = "/memos.api.v2.TagService/ListTags"
|
||||||
TagService_RenameTag_FullMethodName = "/memos.api.v2.TagService/RenameTag"
|
TagService_RenameTag_FullMethodName = "/memos.api.v2.TagService/RenameTag"
|
||||||
TagService_DeleteTag_FullMethodName = "/memos.api.v2.TagService/DeleteTag"
|
TagService_DeleteTag_FullMethodName = "/memos.api.v2.TagService/DeleteTag"
|
||||||
@ -31,6 +32,7 @@ const (
|
|||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type TagServiceClient interface {
|
type TagServiceClient interface {
|
||||||
UpsertTag(ctx context.Context, in *UpsertTagRequest, opts ...grpc.CallOption) (*UpsertTagResponse, error)
|
UpsertTag(ctx context.Context, in *UpsertTagRequest, opts ...grpc.CallOption) (*UpsertTagResponse, error)
|
||||||
|
BatchUpsertTag(ctx context.Context, in *BatchUpsertTagRequest, opts ...grpc.CallOption) (*BatchUpsertTagResponse, error)
|
||||||
ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error)
|
ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error)
|
||||||
RenameTag(ctx context.Context, in *RenameTagRequest, opts ...grpc.CallOption) (*RenameTagResponse, error)
|
RenameTag(ctx context.Context, in *RenameTagRequest, opts ...grpc.CallOption) (*RenameTagResponse, error)
|
||||||
DeleteTag(ctx context.Context, in *DeleteTagRequest, opts ...grpc.CallOption) (*DeleteTagResponse, error)
|
DeleteTag(ctx context.Context, in *DeleteTagRequest, opts ...grpc.CallOption) (*DeleteTagResponse, error)
|
||||||
@ -54,6 +56,15 @@ func (c *tagServiceClient) UpsertTag(ctx context.Context, in *UpsertTagRequest,
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *tagServiceClient) BatchUpsertTag(ctx context.Context, in *BatchUpsertTagRequest, opts ...grpc.CallOption) (*BatchUpsertTagResponse, error) {
|
||||||
|
out := new(BatchUpsertTagResponse)
|
||||||
|
err := c.cc.Invoke(ctx, TagService_BatchUpsertTag_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *tagServiceClient) ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error) {
|
func (c *tagServiceClient) ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error) {
|
||||||
out := new(ListTagsResponse)
|
out := new(ListTagsResponse)
|
||||||
err := c.cc.Invoke(ctx, TagService_ListTags_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, TagService_ListTags_FullMethodName, in, out, opts...)
|
||||||
@ -95,6 +106,7 @@ func (c *tagServiceClient) GetTagSuggestions(ctx context.Context, in *GetTagSugg
|
|||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type TagServiceServer interface {
|
type TagServiceServer interface {
|
||||||
UpsertTag(context.Context, *UpsertTagRequest) (*UpsertTagResponse, error)
|
UpsertTag(context.Context, *UpsertTagRequest) (*UpsertTagResponse, error)
|
||||||
|
BatchUpsertTag(context.Context, *BatchUpsertTagRequest) (*BatchUpsertTagResponse, error)
|
||||||
ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error)
|
ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error)
|
||||||
RenameTag(context.Context, *RenameTagRequest) (*RenameTagResponse, error)
|
RenameTag(context.Context, *RenameTagRequest) (*RenameTagResponse, error)
|
||||||
DeleteTag(context.Context, *DeleteTagRequest) (*DeleteTagResponse, error)
|
DeleteTag(context.Context, *DeleteTagRequest) (*DeleteTagResponse, error)
|
||||||
@ -109,6 +121,9 @@ type UnimplementedTagServiceServer struct {
|
|||||||
func (UnimplementedTagServiceServer) UpsertTag(context.Context, *UpsertTagRequest) (*UpsertTagResponse, error) {
|
func (UnimplementedTagServiceServer) UpsertTag(context.Context, *UpsertTagRequest) (*UpsertTagResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpsertTag not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpsertTag not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedTagServiceServer) BatchUpsertTag(context.Context, *BatchUpsertTagRequest) (*BatchUpsertTagResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method BatchUpsertTag not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedTagServiceServer) ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error) {
|
func (UnimplementedTagServiceServer) ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ListTags not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ListTags not implemented")
|
||||||
}
|
}
|
||||||
@ -152,6 +167,24 @@ func _TagService_UpsertTag_Handler(srv interface{}, ctx context.Context, dec fun
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _TagService_BatchUpsertTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(BatchUpsertTagRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TagServiceServer).BatchUpsertTag(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: TagService_BatchUpsertTag_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TagServiceServer).BatchUpsertTag(ctx, req.(*BatchUpsertTagRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _TagService_ListTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TagService_ListTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(ListTagsRequest)
|
in := new(ListTagsRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -235,6 +268,10 @@ var TagService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "UpsertTag",
|
MethodName: "UpsertTag",
|
||||||
Handler: _TagService_UpsertTag_Handler,
|
Handler: _TagService_UpsertTag_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "BatchUpsertTag",
|
||||||
|
Handler: _TagService_BatchUpsertTag_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "ListTags",
|
MethodName: "ListTags",
|
||||||
Handler: _TagService_ListTags_Handler,
|
Handler: _TagService_ListTags_Handler,
|
||||||
|
@ -6,7 +6,7 @@ import useLocalStorage from "react-use/lib/useLocalStorage";
|
|||||||
import { memoServiceClient } from "@/grpcweb";
|
import { memoServiceClient } from "@/grpcweb";
|
||||||
import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts";
|
import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts";
|
||||||
import { isValidUrl } from "@/helpers/utils";
|
import { isValidUrl } from "@/helpers/utils";
|
||||||
import { useGlobalStore, useResourceStore } from "@/store/module";
|
import { useGlobalStore, useResourceStore, useTagStore } from "@/store/module";
|
||||||
import { useMemoStore, useUserStore } from "@/store/v1";
|
import { useMemoStore, useUserStore } from "@/store/v1";
|
||||||
import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service";
|
import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service";
|
||||||
import { Memo, Visibility } from "@/types/proto/api/v2/memo_service";
|
import { Memo, Visibility } from "@/types/proto/api/v2/memo_service";
|
||||||
@ -14,6 +14,7 @@ import { Resource } from "@/types/proto/api/v2/resource_service";
|
|||||||
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { convertVisibilityFromString, convertVisibilityToString } from "@/utils/memo";
|
import { convertVisibilityFromString, convertVisibilityToString } from "@/utils/memo";
|
||||||
|
import { extractTagsFromContent } from "@/utils/tag";
|
||||||
import showCreateResourceDialog from "../CreateResourceDialog";
|
import showCreateResourceDialog from "../CreateResourceDialog";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import VisibilityIcon from "../VisibilityIcon";
|
import VisibilityIcon from "../VisibilityIcon";
|
||||||
@ -57,6 +58,7 @@ const MemoEditor = (props: Props) => {
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const memoStore = useMemoStore();
|
const memoStore = useMemoStore();
|
||||||
const resourceStore = useResourceStore();
|
const resourceStore = useResourceStore();
|
||||||
|
const tagStore = useTagStore();
|
||||||
const [state, setState] = useState<State>({
|
const [state, setState] = useState<State>({
|
||||||
memoVisibility: Visibility.PRIVATE,
|
memoVisibility: Visibility.PRIVATE,
|
||||||
resourceList: [],
|
resourceList: [],
|
||||||
@ -326,6 +328,10 @@ const MemoEditor = (props: Props) => {
|
|||||||
toast.error(error.details);
|
toast.error(error.details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Batch upsert tags.
|
||||||
|
const tags = extractTagsFromContent(content);
|
||||||
|
await tagStore.batchUpsertTag(tags);
|
||||||
|
|
||||||
setState((state) => {
|
setState((state) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
@ -25,6 +25,17 @@ export const useTagStore = () => {
|
|||||||
store.dispatch(upsertTagAction(tagName));
|
store.dispatch(upsertTagAction(tagName));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const batchUpsertTag = async (tagNames: string[]) => {
|
||||||
|
await tagServiceClient.batchUpsertTag({
|
||||||
|
requests: tagNames.map((name) => ({
|
||||||
|
name,
|
||||||
|
})),
|
||||||
|
});
|
||||||
|
for (const tagName of tagNames) {
|
||||||
|
store.dispatch(upsertTagAction(tagName));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const deleteTag = async (tagName: string) => {
|
const deleteTag = async (tagName: string) => {
|
||||||
await tagServiceClient.deleteTag({
|
await tagServiceClient.deleteTag({
|
||||||
tag: {
|
tag: {
|
||||||
@ -40,6 +51,7 @@ export const useTagStore = () => {
|
|||||||
getState,
|
getState,
|
||||||
fetchTags,
|
fetchTags,
|
||||||
upsertTag,
|
upsertTag,
|
||||||
|
batchUpsertTag,
|
||||||
deleteTag,
|
deleteTag,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1 +1,33 @@
|
|||||||
|
import { Node } from "@/types/node";
|
||||||
|
|
||||||
export const TAG_REG = /#([^\s#,]+)/;
|
export const TAG_REG = /#([^\s#,]+)/;
|
||||||
|
|
||||||
|
// extractTagsFromContent extracts tags from content.
|
||||||
|
export const extractTagsFromContent = (content: string) => {
|
||||||
|
const nodes = window.parse(content);
|
||||||
|
const tags = new Set<string>();
|
||||||
|
|
||||||
|
const traverse = (nodes: Node[], handle: (node: Node) => void) => {
|
||||||
|
for (const node of nodes) {
|
||||||
|
if (!node) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
handle(node);
|
||||||
|
if (node.paragraphNode || node.unorderedListNode || node.orderedListNode) {
|
||||||
|
const children = ((node.paragraphNode || node.unorderedListNode || node.orderedListNode) as any).children;
|
||||||
|
if (Array.isArray(children)) {
|
||||||
|
traverse(children, handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
traverse(nodes, (node) => {
|
||||||
|
if (node.tagNode?.content) {
|
||||||
|
tags.add(node.tagNode.content);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return Array.from(tags);
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user