From 00101e5fdee99e0bde9805c52f9bcab67edd79d9 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Fri, 20 Dec 2019 17:25:58 +0100 Subject: [PATCH] feat(club): add service --- hpi/cloud/club/v1test/club.proto | 26 ++++++++++++++ hpi/cloud/club/v1test/club_service.proto | 44 ++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 hpi/cloud/club/v1test/club.proto create mode 100644 hpi/cloud/club/v1test/club_service.proto diff --git a/hpi/cloud/club/v1test/club.proto b/hpi/cloud/club/v1test/club.proto new file mode 100644 index 0000000..c3d995d --- /dev/null +++ b/hpi/cloud/club/v1test/club.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package hpi.cloud.club.v1test; + +option java_multiple_files = true; +option java_outer_classname = "ClubProto"; +option java_package = "de.hpi.cloud.club.v1test"; + + +// An HPI's student club, e.g. MobileDev. +message Club { + // Required, output only. The unique ID of this club. + string id = 1; + + // Required. The title of this club (e.g. "MobileDev"). + string title = 2; + + // Required. An abbreviation of the title (e.g. "MD"). + string abbreviation = 3; + + // Required. ID of the group of people representing this club's head/speakers. + string head_group_id = 4; + + // Required. ID of the group of people representing this club's members. + string member_group_id = 5; +} diff --git a/hpi/cloud/club/v1test/club_service.proto b/hpi/cloud/club/v1test/club_service.proto new file mode 100644 index 0000000..b9db426 --- /dev/null +++ b/hpi/cloud/club/v1test/club_service.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package hpi.cloud.club.v1test; + +import "hpi/cloud/club/v1test/club.proto"; + +option java_multiple_files = true; +option java_outer_classname = "ClubServiceProto"; +option java_package = "de.hpi.cloud.club.v1test"; + +// Provides access to all HPI student clubs. +service ClubService { + // Lists all clubs. + rpc ListClubs (ListClubsRequest) returns (ListClubsResponse); + + // Gets a club. + rpc GetClub (GetClubRequest) returns (Club); +} + +// Request message for listing clubs using [ListClubs][hpi.cloud.club.v1test.ClubService.ListClubs]. +message ListClubsRequest { + // The maximum number of clubs to return in the response. + int32 page_size = 1; + + // A pagination token returned from a previous call to `ListClubs` + // that indicates where this listing should continue from. + string page_token = 2; +} + +// Response message for listing clubs using [ListClubs][hpi.cloud.club.v1test.ClubService.ListClubs]. +message ListClubsResponse { + // A possibly paginated list of clubs. + repeated Club clubs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results. + string next_page_token = 2; +} + +// Request message for [GetClub][hpi.cloud.club.v1test.ClubService.GetClub]. +message GetClubRequest { + // Required. The club ID. + string id = 1; +}