memos/proto/api/v1/activity_service.proto

57 lines
1.5 KiB
Protocol Buffer
Raw Normal View History

2023-10-28 00:21:53 +08:00
syntax = "proto3";
2024-04-28 00:44:29 +08:00
package memos.api.v1;
2023-10-28 00:21:53 +08:00
import "google/api/annotations.proto";
2024-02-06 20:55:27 +08:00
import "google/api/client.proto";
2024-04-16 22:33:25 +08:00
import "google/api/field_behavior.proto";
2023-10-28 00:21:53 +08:00
import "google/protobuf/timestamp.proto";
2024-04-28 00:44:29 +08:00
option go_package = "gen/api/v1";
2023-10-28 00:21:53 +08:00
service ActivityService {
2024-02-01 21:26:09 +08:00
// GetActivity returns the activity with the given id.
2024-04-27 22:02:15 +08:00
rpc GetActivity(GetActivityRequest) returns (Activity) {
2024-04-28 00:44:29 +08:00
option (google.api.http) = {get: "/api/v1/activities/{id}"};
2024-02-06 20:55:27 +08:00
option (google.api.method_signature) = "id";
2023-10-28 00:21:53 +08:00
}
}
message Activity {
2024-04-16 22:33:25 +08:00
// The system-generated unique identifier for the activity.
2023-10-28 00:21:53 +08:00
int32 id = 1;
2024-04-16 22:33:25 +08:00
// The system-generated unique identifier for the user who created the activity.
2023-10-28 00:21:53 +08:00
int32 creator_id = 2;
2024-04-16 22:33:25 +08:00
// The type of the activity.
2023-10-28 00:21:53 +08:00
string type = 3;
2024-04-16 22:33:25 +08:00
// The level of the activity.
2023-10-28 00:21:53 +08:00
string level = 4;
2024-04-16 22:33:25 +08: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-28 00:21:53 +08:00
ActivityPayload payload = 6;
}
2024-04-16 22:33:25 +08:00
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
2023-10-28 00:21:53 +08:00
message ActivityMemoCommentPayload {
2024-04-16 22:33:25 +08:00
// The memo id of comment.
2023-10-28 00:21:53 +08:00
int32 memo_id = 1;
2024-04-16 22:33:25 +08:00
// The memo id of related memo.
2023-10-28 00:21:53 +08:00
int32 related_memo_id = 2;
}
2023-11-06 22:53:55 +08:00
message ActivityVersionUpdatePayload {
2024-04-16 22:33:25 +08:00
// The updated version of memos.
2023-11-06 22:53:55 +08:00
string version = 1;
}
2023-10-28 00:21:53 +08:00
message ActivityPayload {
ActivityMemoCommentPayload memo_comment = 1;
2023-11-06 22:53:55 +08:00
ActivityVersionUpdatePayload version_update = 2;
2023-10-28 00:21:53 +08:00
}
message GetActivityRequest {
2024-04-16 22:33:25 +08:00
// The system-generated unique identifier for the activity.
2023-10-28 00:21:53 +08:00
int32 id = 1;
}