memos/proto/api/v1/activity_service.proto

59 lines
1.5 KiB
Protocol Buffer
Raw Permalink Normal View History

2023-10-27 19:21:53 +03:00
syntax = "proto3";
2024-04-27 19:44:29 +03:00
package memos.api.v1;
2023-10-27 19:21:53 +03:00
import "google/api/annotations.proto";
2024-02-06 15:55:27 +03:00
import "google/api/client.proto";
2024-04-16 17:33:25 +03:00
import "google/api/field_behavior.proto";
2023-10-27 19:21:53 +03:00
import "google/protobuf/timestamp.proto";
2024-04-27 19:44:29 +03:00
option go_package = "gen/api/v1";
2023-10-27 19:21:53 +03:00
service ActivityService {
2024-02-01 16:26:09 +03:00
// GetActivity returns the activity with the given id.
2024-04-27 17:02:15 +03:00
rpc GetActivity(GetActivityRequest) returns (Activity) {
option (google.api.http) = {get: "/api/v1/{name=activities/*}"};
option (google.api.method_signature) = "name";
2023-10-27 19:21:53 +03:00
}
}
message Activity {
// The name of the activity.
// Format: activities/{id}
string name = 1;
// The uid of the user who created the activity.
2023-10-27 19:21:53 +03:00
int32 creator_id = 2;
2024-04-16 17:33:25 +03:00
// The type of the activity.
2023-10-27 19:21:53 +03:00
string type = 3;
2024-04-16 17:33:25 +03:00
// The level of the activity.
2023-10-27 19:21:53 +03:00
string level = 4;
2024-04-16 17:33:25 +03:00
// The create time of the activity.
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// The payload of the activity.
2023-10-27 19:21:53 +03:00
ActivityPayload payload = 6;
}
message ActivityPayload {
ActivityMemoCommentPayload memo_comment = 1;
ActivityVersionUpdatePayload version_update = 2;
}
2024-04-16 17:33:25 +03:00
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
2023-10-27 19:21:53 +03:00
message ActivityMemoCommentPayload {
2024-04-16 17:33:25 +03:00
// The memo id of comment.
2023-10-27 19:21:53 +03:00
int32 memo_id = 1;
2024-04-16 17:33:25 +03:00
// The memo id of related memo.
2023-10-27 19:21:53 +03:00
int32 related_memo_id = 2;
}
2023-11-06 17:53:55 +03:00
message ActivityVersionUpdatePayload {
2024-04-16 17:33:25 +03:00
// The updated version of memos.
2023-11-06 17:53:55 +03:00
string version = 1;
}
2023-10-27 19:21:53 +03:00
message GetActivityRequest {
// The name of the activity.
// Format: activities/{id}
string name = 1;
2023-10-27 19:21:53 +03:00
}