Skip to content

Commit

Permalink
chore: tweak memo property
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed May 27, 2024
1 parent 2b4c2b2 commit a423dac
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 367 deletions.
2 changes: 2 additions & 0 deletions docs/apidocs.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,8 @@ definitions:
type: boolean
hasTaskList:
type: boolean
hasCode:
type: boolean
v1MemoRelation:
type: object
properties:
Expand Down
1 change: 1 addition & 0 deletions proto/api/v1/memo_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ message MemoProperty {
repeated string tags = 1;
bool has_link = 2;
bool has_task_list = 3;
bool has_code = 4;
}

message CreateMemoRequest {
Expand Down
718 changes: 364 additions & 354 deletions proto/gen/api/v1/memo_service.pb.go

Large diffs are not rendered by default.

36 changes: 23 additions & 13 deletions proto/gen/store/memo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/store/memo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ message MemoPayload {
repeated string tags = 1;
bool has_link = 2;
bool has_task_list = 3;
bool has_code = 4;
}
}
3 changes: 3 additions & 0 deletions server/router/api/v1/memo_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ func convertMemoPropertyFromStore(property *storepb.MemoPayload_Property) *v1pb.
Tags: property.Tags,
HasLink: property.HasLink,
HasTaskList: property.HasTaskList,
HasCode: property.HasCode,
}
}

Expand Down Expand Up @@ -1081,6 +1082,8 @@ func getMemoPropertyFromContent(content string) (*storepb.MemoPayload_Property,
property.HasLink = true
case *ast.TaskList:
property.HasTaskList = true
case *ast.Code, *ast.CodeBlock:
property.HasCode = true
}
})
return property, nil
Expand Down

0 comments on commit a423dac

Please sign in to comment.