activity_service.proto 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. syntax = "proto3";
  2. package memos.api.v1;
  3. import "google/api/annotations.proto";
  4. import "google/api/client.proto";
  5. import "google/api/field_behavior.proto";
  6. import "google/protobuf/timestamp.proto";
  7. option go_package = "gen/api/v1";
  8. service ActivityService {
  9. // GetActivity returns the activity with the given id.
  10. rpc GetActivity(GetActivityRequest) returns (Activity) {
  11. option (google.api.http) = {get: "/api/v1/{name=activities/*}"};
  12. option (google.api.method_signature) = "name";
  13. }
  14. }
  15. message Activity {
  16. // The name of the activity.
  17. // Format: activities/{id}
  18. string name = 1;
  19. // The uid of the user who created the activity.
  20. int32 creator_id = 2;
  21. // The type of the activity.
  22. string type = 3;
  23. // The level of the activity.
  24. string level = 4;
  25. // The create time of the activity.
  26. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  27. // The payload of the activity.
  28. ActivityPayload payload = 6;
  29. }
  30. message ActivityPayload {
  31. ActivityMemoCommentPayload memo_comment = 1;
  32. ActivityVersionUpdatePayload version_update = 2;
  33. }
  34. // ActivityMemoCommentPayload represents the payload of a memo comment activity.
  35. message ActivityMemoCommentPayload {
  36. // The memo id of comment.
  37. int32 memo_id = 1;
  38. // The memo id of related memo.
  39. int32 related_memo_id = 2;
  40. }
  41. message ActivityVersionUpdatePayload {
  42. // The updated version of memos.
  43. string version = 1;
  44. }
  45. message GetActivityRequest {
  46. // The name of the activity.
  47. // Format: activities/{id}
  48. string name = 1;
  49. }