Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Student councils #451

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
672 changes: 434 additions & 238 deletions server/api/tumdev/campus_backend.pb.go

Large diffs are not rendered by default.

91 changes: 89 additions & 2 deletions server/api/tumdev/campus_backend.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 32 additions & 5 deletions server/api/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,14 @@ service Campus {
}

// List all avaliable student clubs
rpc ListStudentClub(ListStudentClubRequest) returns (ListStudentClubReply) {
rpc ListStudentClub(ListStudentGroupRequest) returns (ListStudentGroupReply) {
option (google.api.http) = {get: "/student_clubs"};
option deprecated = true;
}

// List student groups information necessary for the "Campus" tab
rpc ListStudentGroup(ListStudentGroupRequest) returns (ListStudentGroupReply) {
option (google.api.http) = {get: "/student_groups"};
}
}

Expand Down Expand Up @@ -532,13 +538,14 @@ enum Language {
English = 1;
}

message ListStudentClubRequest {
message ListStudentGroupRequest {
// Language of the student clubs and categories
// Defaults to german
optional Language language = 1;
}
message ListStudentClubReply {
repeated StudentClubCollection collections = 1;
message ListStudentGroupReply {
repeated StudentClubCollection student_clubs = 1;
repeated StudentCouncilCollection student_councils = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what, we want to represent each of the councils separately? Why? It seems like a lot of additional complexity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the best API is for this.
My rationale was that a student has >=1 student council (f.ex. ASTA, MPIC), some also have

1 if they are studying more than one Program.

Since I don't quite know how this matching should work, I have pushed the matching part off to another PR.

}
message StudentClub {
// The name of the club
Expand All @@ -554,7 +561,27 @@ message StudentClubCollection {
string title = 1;
string description = 2;
repeated StudentClub clubs = 3;
// id of the collection.
// ID of the collection.
// Might not be stable over time because of scraping
// May not be disjunct not unique in relation to student councils
uint64 unstable_collection_id = 4;
}
message StudentCouncil {
// The name of the council
string name = 1;
// How the council describes itsself
optional string description = 2;
// Where the council main internet presence is
optional string link_url = 3;
// Where to find a image for this council
optional string cover_url = 4;
}
message StudentCouncilCollection {
string title = 1;
string description = 2;
repeated StudentCouncil councils = 3;
// ID of the collection.
// Might not be stable over time because of scraping
// May not be disjunct not unique in relation to student clubs
uint64 unstable_collection_id = 4;
}
96 changes: 92 additions & 4 deletions server/api/tumdev/campus_backend.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,44 @@
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiListStudentClubReply"
"$ref": "#/definitions/apiListStudentGroupReply"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "language",
"description": "Language of the student clubs and categories\nDefaults to german",
"in": "query",
"required": false,
"type": "string",
"enum": [
"German",
"English"
],
"default": "German"
}
],
"tags": [
"Campus"
]
}
},
"/student_groups": {
"get": {
"summary": "List all student groups information",
"operationId": "Campus_ListStudentGroup",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiListStudentGroupReply"
}
},
"default": {
Expand Down Expand Up @@ -1173,15 +1210,22 @@
}
}
},
"apiListStudentClubReply": {
"apiListStudentGroupReply": {
"type": "object",
"properties": {
"collections": {
"studentClubs": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/apiStudentClubCollection"
}
},
"studentCouncils": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/apiStudentCouncilCollection"
}
}
}
},
Expand Down Expand Up @@ -1461,7 +1505,51 @@
"unstableCollectionId": {
"type": "string",
"format": "uint64",
"title": "id of the collection.\nMight not be stable over time because of scraping"
"title": "ID of the collection.\nMight not be stable over time because of scraping\nMay not be disjunct not unique in relation to student councils"
}
}
},
"apiStudentCouncil": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "The name of the council"
},
"description": {
"type": "string",
"title": "How the council describes itsself"
},
"linkUrl": {
"type": "string",
"title": "Where the council main internet presence is"
},
"coverUrl": {
"type": "string",
"title": "Where to find a image for this council"
}
}
},
"apiStudentCouncilCollection": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"councils": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/apiStudentCouncil"
}
},
"unstableCollectionId": {
"type": "string",
"format": "uint64",
"title": "ID of the collection.\nMight not be stable over time because of scraping\nMay not be disjunct not unique in relation to student clubs"
}
}
},
Expand Down
Loading
Loading