Skip to content

Commit

Permalink
mirrored the comments from the RPC to the protofile
Browse files Browse the repository at this point in the history
This way, we make sure that they are actually displayed to the users
  • Loading branch information
CommanderStorm committed Mar 11, 2024
1 parent 2b3a542 commit bcb5b4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions server/api/tumdev/campus_backend.pb.go

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

7 changes: 5 additions & 2 deletions server/api/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ service Campus {
};
}

// Returns all dishes for a specific cafeteria, year, week and day
rpc ListDishes(ListDishesRequest) returns (ListDishesReply) {
option (google.api.http) = {
get: "/dishes",
Expand Down Expand Up @@ -389,9 +390,11 @@ message ListDishesRequest {
string canteen_id = 1;
// >=2022 until the current year
int32 year = 2;
// range 1 - 53
// Week of the dish.
// Must be in the range 1 - 52
int32 week = 3;
// range 0 (Monday) - 4 (Friday)
// Day of the week
// Days must be in the range 0 (Monday) - 4 (Friday)
int32 day = 4;
}

Expand Down
5 changes: 3 additions & 2 deletions server/api/tumdev/campus_backend.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@
},
"/dishes": {
"get": {
"summary": "Returns all dishes for a specific cafeteria, year, week and day",
"operationId": "Campus_ListDishes",
"responses": {
"200": {
Expand Down Expand Up @@ -469,15 +470,15 @@
},
{
"name": "week",
"description": "range 1 - 53",
"description": "Week of the dish.\nMust be in the range 1 - 52",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "day",
"description": "range 0 (Monday) - 4 (Friday)",
"description": "Day of the week\nDays must be in the range 0 (Monday) - 4 (Friday)",
"in": "query",
"required": false,
"type": "integer",
Expand Down
2 changes: 2 additions & 0 deletions server/api/tumdev/campus_backend_grpc.pb.go

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

2 changes: 0 additions & 2 deletions server/backend/cafeteria.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,6 @@ func (s *CampusServer) GetCafeterias(ctx context.Context, _ *pb.ListCanteensRequ
}, requestStatus
}

// ListDishes gRPC Endpoint
// Returns all dishes for a specific cafeteria, year, week and day
func (s *CampusServer) ListDishes(ctx context.Context, req *pb.ListDishesRequest) (*pb.ListDishesReply, error) {
if req.Year < 2022 {
return &pb.ListDishesReply{}, status.Error(codes.Internal, "Years must be larger or equal to 2022 ") // currently, no previous values have been added
Expand Down

0 comments on commit bcb5b4c

Please sign in to comment.