Commit d3235f75 authored by Steven's avatar Steven

chore: tweak memo definition

parent e0600388
...@@ -903,15 +903,9 @@ paths: ...@@ -903,15 +903,9 @@ paths:
type: string type: string
pinned: pinned:
type: boolean type: boolean
property: parentId:
$ref: '#/definitions/v1MemoProperty' type: integer
readOnly: true format: int32
parent:
type: string
description: |-
The name of the parent memo.
Format: memos/{id}
id is the system generated id.
readOnly: true readOnly: true
resources: resources:
type: array type: array
...@@ -931,6 +925,15 @@ paths: ...@@ -931,6 +925,15 @@ paths:
type: object type: object
$ref: '#/definitions/v1Reaction' $ref: '#/definitions/v1Reaction'
readOnly: true readOnly: true
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
title: |-
The name of the parent memo.
Format: memos/{id}
readOnly: true
tags: tags:
- MemoService - MemoService
/api/v1/{name_1}: /api/v1/{name_1}:
...@@ -2658,15 +2661,9 @@ definitions: ...@@ -2658,15 +2661,9 @@ definitions:
type: string type: string
pinned: pinned:
type: boolean type: boolean
property: parentId:
$ref: '#/definitions/v1MemoProperty' type: integer
readOnly: true format: int32
parent:
type: string
description: |-
The name of the parent memo.
Format: memos/{id}
id is the system generated id.
readOnly: true readOnly: true
resources: resources:
type: array type: array
...@@ -2686,6 +2683,15 @@ definitions: ...@@ -2686,6 +2683,15 @@ definitions:
type: object type: object
$ref: '#/definitions/v1Reaction' $ref: '#/definitions/v1Reaction'
readOnly: true readOnly: true
property:
$ref: '#/definitions/v1MemoProperty'
readOnly: true
parent:
type: string
title: |-
The name of the parent memo.
Format: memos/{id}
readOnly: true
v1MemoProperty: v1MemoProperty:
type: object type: object
properties: properties:
......
...@@ -185,18 +185,22 @@ message Memo { ...@@ -185,18 +185,22 @@ message Memo {
bool pinned = 12; bool pinned = 12;
MemoProperty property = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; optional int32 parent_id = 13 [
deprecated = true,
(google.api.field_behavior) = OUTPUT_ONLY
];
// The name of the parent memo. repeated Resource resources = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
// Format: memos/{id}
// id is the system generated id.
optional string parent = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Resource resources = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; repeated MemoRelation relations = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated MemoRelation relations = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated Reaction reactions = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; MemoProperty property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
// The name of the parent memo.
// Format: memos/{id}
optional string parent = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
} }
message MemoProperty { message MemoProperty {
......
This diff is collapsed.
...@@ -797,6 +797,7 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem ...@@ -797,6 +797,7 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem
memoMessage.Property = convertMemoPropertyFromStore(memo.Payload.Property) memoMessage.Property = convertMemoPropertyFromStore(memo.Payload.Property)
} }
if memo.ParentID != nil { if memo.ParentID != nil {
memoMessage.ParentId = memo.ParentID
parent := fmt.Sprintf("%s%d", MemoNamePrefix, *memo.ParentID) parent := fmt.Sprintf("%s%d", MemoNamePrefix, *memo.ParentID)
memoMessage.Parent = &parent memoMessage.Parent = &parent
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment