Skip to content

Commit

Permalink
refactor: memo name
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyjoygh committed Feb 1, 2025
1 parent 2f4c5d7 commit 5e770dd
Show file tree
Hide file tree
Showing 37 changed files with 970 additions and 1,311 deletions.
2 changes: 1 addition & 1 deletion proto/api/v1/activity_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ message ActivityVersionUpdatePayload {

message GetActivityRequest {
// The name of the activity.
// Format: activities/{id}
// Format: activities/{id}, id is the system generated auto-incremented id.
string name = 1;
}
4 changes: 1 addition & 3 deletions proto/api/v1/idp_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ service IdentityProviderService {

message IdentityProvider {
// The name of the identityProvider.
// Format: identityProviders/{id}
// Format: identityProviders/{id}, id is the system generated auto-incremented id.
string name = 1;

enum Type {
Expand Down Expand Up @@ -89,7 +89,6 @@ message ListIdentityProvidersResponse {

message GetIdentityProviderRequest {
// The name of the identityProvider to get.
// Format: identityProviders/{id}
string name = 1;
}

Expand All @@ -109,6 +108,5 @@ message UpdateIdentityProviderRequest {

message DeleteIdentityProviderRequest {
// The name of the identityProvider to delete.
// Format: identityProviders/{id}
string name = 1;
}
3 changes: 1 addition & 2 deletions proto/api/v1/inbox_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ service InboxService {

message Inbox {
// The name of the inbox.
// Format: inboxes/{id}
// Format: inboxes/{id}, id is the system generated auto-incremented id.
string name = 1;
// Format: users/{user}
string sender = 2;
Expand Down Expand Up @@ -85,6 +85,5 @@ message UpdateInboxRequest {

message DeleteInboxRequest {
// The name of the inbox to delete.
// Format: inboxes/{id}
string name = 1;
}
4 changes: 2 additions & 2 deletions proto/api/v1/memo_relation_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ option go_package = "gen/api/v1";

message MemoRelation {
// The name of memo.
// Format: "memos/{id}"
// Format: memos/{id}
Memo memo = 1;

// The name of related memo.
// Format: "memos/{id}"
// Format: memos/{id}
Memo related_memo = 2;

enum Type {
Expand Down
27 changes: 3 additions & 24 deletions proto/api/v1/memo_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ service MemoService {
option (google.api.http) = {get: "/api/v1/{name=memos/*}"};
option (google.api.method_signature) = "name";
}
// GetMemoByUid gets a memo by uid
rpc GetMemoByUid(GetMemoByUidRequest) returns (Memo) {
option (google.api.http) = {get: "/api/v1/memos:by-uid/{uid}"};
option (google.api.method_signature) = "uid";
}
// UpdateMemo updates a memo.
rpc UpdateMemo(UpdateMemoRequest) returns (Memo) {
option (google.api.http) = {
Expand Down Expand Up @@ -130,12 +125,11 @@ enum Visibility {

message Memo {
// The name of the memo.
// Format: memos/{id}
// id is the system generated id.
// Format: memos/{memo}, memo is the user defined id or uuid.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// The user defined id of the memo.
string uid = 2;
// The system generated unique id. Auto-incremented.
int32 uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

State state = 3;

Expand Down Expand Up @@ -226,15 +220,9 @@ message ListMemosResponse {

message GetMemoRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

message GetMemoByUidRequest {
// The uid of the memo.
string uid = 1;
}

message UpdateMemoRequest {
Memo memo = 1;

Expand All @@ -243,7 +231,6 @@ message UpdateMemoRequest {

message DeleteMemoRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

Expand All @@ -265,15 +252,13 @@ message DeleteMemoTagRequest {

message SetMemoResourcesRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;

repeated Resource resources = 2;
}

message ListMemoResourcesRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

Expand All @@ -283,15 +268,13 @@ message ListMemoResourcesResponse {

message SetMemoRelationsRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;

repeated MemoRelation relations = 2;
}

message ListMemoRelationsRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

Expand All @@ -301,15 +284,13 @@ message ListMemoRelationsResponse {

message CreateMemoCommentRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;

CreateMemoRequest comment = 2;
}

message ListMemoCommentsRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

Expand All @@ -319,7 +300,6 @@ message ListMemoCommentsResponse {

message ListMemoReactionsRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;
}

Expand All @@ -329,7 +309,6 @@ message ListMemoReactionsResponse {

message UpsertMemoReactionRequest {
// The name of the memo.
// Format: memos/{id}
string name = 1;

Reaction reaction = 2;
Expand Down
12 changes: 2 additions & 10 deletions proto/api/v1/resource_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ service ResourceService {

message Resource {
// The name of the resource.
// Format: resources/{id}
// id is the system generated unique identifier.
// Format: resources/{id}, id is the system generated auto-incremented id.
string name = 1;

// The user defined id of the resource.
Expand All @@ -75,8 +74,7 @@ message Resource {

int64 size = 8;

// The related memo.
// Format: memos/{id}
// The related memo. Refer to `Memo.name`.
optional string memo = 9;
}

Expand All @@ -92,8 +90,6 @@ message ListResourcesResponse {

message GetResourceRequest {
// The name of the resource.
// Format: resources/{id}
// id is the system generated unique identifier.
string name = 1;
}

Expand All @@ -104,8 +100,6 @@ message GetResourceByUidRequest {

message GetResourceBinaryRequest {
// The name of the resource.
// Format: resources/{id}
// id is the system generated unique identifier.
string name = 1;

// The filename of the resource. Mainly used for downloading.
Expand All @@ -123,7 +117,5 @@ message UpdateResourceRequest {

message DeleteResourceRequest {
// The name of the resource.
// Format: resources/{id}
// id is the system generated unique identifier.
string name = 1;
}
16 changes: 3 additions & 13 deletions proto/api/v1/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ service UserService {

message User {
// The name of the user.
// Format: users/{user}. {user} is a system-generated auto-increment id.
// Format: users/{id}, id is the system generated auto-incremented id.
string name = 1;

enum Role {
Expand All @@ -122,9 +122,9 @@ message User {

State state = 10;

google.protobuf.Timestamp create_time = 11;
google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];

google.protobuf.Timestamp update_time = 12;
google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
}

message ListUsersRequest {}
Expand All @@ -145,13 +145,11 @@ message SearchUsersResponse {

message GetUserRequest {
// The name of the user.
// Format: users/{user}
string name = 1;
}

message GetUserAvatarBinaryRequest {
// The name of the user.
// Format: users/{user}
string name = 1;

// The raw HTTP body is bound to this field.
Expand All @@ -170,13 +168,11 @@ message UpdateUserRequest {

message DeleteUserRequest {
// The name of the user.
// Format: users/{user}
string name = 1;
}

message UserStats {
// The name of the user.
// Format: users/{user}
string name = 1;

// The timestamps when the memos were displayed.
Expand Down Expand Up @@ -206,13 +202,11 @@ message ListAllUserStatsResponse {

message GetUserStatsRequest {
// The name of the user.
// Format: users/{user}.
string name = 1;
}

message UserSetting {
// The name of the user.
// Format: users/{user}
string name = 1;
// The preferred locale of the user.
string locale = 2;
Expand All @@ -224,7 +218,6 @@ message UserSetting {

message GetUserSettingRequest {
// The name of the user.
// Format: users/{user}
string name = 1;
}

Expand All @@ -243,7 +236,6 @@ message UserAccessToken {

message ListUserAccessTokensRequest {
// The name of the user.
// Format: users/{user}
string name = 1;
}

Expand All @@ -253,7 +245,6 @@ message ListUserAccessTokensResponse {

message CreateUserAccessTokenRequest {
// The name of the user.
// Format: users/{user}
string name = 1;

string description = 2;
Expand All @@ -263,7 +254,6 @@ message CreateUserAccessTokenRequest {

message DeleteUserAccessTokenRequest {
// The name of the user.
// Format: users/{user}
string name = 1;
// access_token is the access token to delete.
string access_token = 2;
Expand Down
2 changes: 0 additions & 2 deletions proto/api/v1/webhook_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ message Webhook {
int32 id = 1;

// The name of the creator.
// Format: users/{user}
string creator = 2;

google.protobuf.Timestamp create_time = 3;
Expand All @@ -71,7 +70,6 @@ message GetWebhookRequest {

message ListWebhooksRequest {
// The name of the creator.
// Format: users/{user}
string creator = 2;
}

Expand Down
2 changes: 1 addition & 1 deletion proto/gen/api/v1/activity_service.pb.go

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

4 changes: 1 addition & 3 deletions proto/gen/api/v1/idp_service.pb.go

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

3 changes: 1 addition & 2 deletions proto/gen/api/v1/inbox_service.pb.go

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

4 changes: 2 additions & 2 deletions proto/gen/api/v1/memo_relation_service.pb.go

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

Loading

0 comments on commit 5e770dd

Please sign in to comment.