activity_service.proto 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 name of the creator.
  20. // Format: users/{user}
  21. string creator = 2;
  22. // The type of the activity.
  23. string type = 3;
  24. // The level of the activity.
  25. string level = 4;
  26. // The create time of the activity.
  27. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  28. // The payload of the activity.
  29. ActivityPayload payload = 6;
  30. }
  31. message ActivityPayload {
  32. ActivityMemoCommentPayload memo_comment = 1;
  33. ActivityVersionUpdatePayload version_update = 2;
  34. }
  35. // ActivityMemoCommentPayload represents the payload of a memo comment activity.
  36. message ActivityMemoCommentPayload {
  37. // The memo name of comment.
  38. // Refer to `Memo.name`.
  39. string memo = 1;
  40. // The name of related memo.
  41. string related_memo = 2;
  42. }
  43. message ActivityVersionUpdatePayload {
  44. // The updated version of memos.
  45. string version = 1;
  46. }
  47. message GetActivityRequest {
  48. // The name of the activity.
  49. // Format: activities/{id}
  50. string name = 1;
  51. }