Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #80 from HPI-de/issue/78-food-counter-and-offer-title
Browse files Browse the repository at this point in the history
feat(food): add counter entity & offer_title to MenuItem
  • Loading branch information
JonasWanke authored Feb 13, 2020
2 parents f3b27fd + 0292b8b commit f87ea49
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ script:
- docker run --rm
-v $(pwd):$(pwd)
-w $(pwd)
thethingsindustries/protoc
thethingsindustries/protoc:3.1.18
--plugin=protoc-gen-grpc=/usr/bin/protoc-gen-grpc-java
--java_out=./hpi-cloud-apis/src/main/java
--grpc_out=./hpi-cloud-apis/src/main/java
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ repositories {
dependencies {
api("com.google.protobuf:protobuf-java:3.8.0")
// implementation as Android clients will replace this with grpc-protobuf-lite
implementation("io.grpc:grpc-protobuf:1.21.0")
api("io.grpc:grpc-stub:1.21.0")
implementation("io.grpc:grpc-protobuf:1.26.0")
api("io.grpc:grpc-stub:1.26.0")
// implementation as Android clients will replace this with grpc-okhttp
implementation("io.grpc:grpc-netty:1.21.0")
implementation("io.grpc:grpc-netty:1.26.0")
}

// Publishing config
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 21 additions & 3 deletions hpi/cloud/food/v1test/food.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ message MenuItem {
// Required. The date of when this menu was/will be served.
google.type.Date date = 3;

// The counter where this item is served.
string counter = 4;
// ID of the counter (location) where this item is served.
string counter_id = 4;

// Required. The price to pay for this item, depending on the customer (e.g. student, guest, default ...).
map<string, google.type.Money> prices = 5;

// Required. The title.
// Required. The title of the offer, e.g. "Offer 4", "Tagesessen".
string offer_title = 8;

// Required. The title of the MenuItem (specific food name), e.g. "Hamburger".
string title = 6;

// IDs of the labels of the item.
Expand All @@ -53,3 +56,18 @@ message Label {
// The URL pointing to an icon.
string icon = 3;
}

// A counter for a menu item.
message Counter {
// Required, output only. The unique ID (across restaurants).
string id = 1;

// Required. ID of the restaurant this counter belongs to.
string restaurant_id = 4;

// Required. The title, e.g. "1", "Außengrill".
string title = 2;

// The URL pointing to an icon.
string icon = 3;
}
37 changes: 37 additions & 0 deletions hpi/cloud/food/v1test/food_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ service FoodService {

// Gets a label.
rpc GetLabel (GetLabelRequest) returns (Label);


// Lists counters for a restaurant.
rpc ListCounters (ListCountersRequest) returns (ListCountersResponse);

// Gets a counter.
rpc GetCounter (GetCounterRequest) returns (Counter);
}

// Request message for listing restaurants using [ListRestaurants][hpi.cloud.food.v1test.FoodService.ListRestaurants].
Expand Down Expand Up @@ -117,3 +124,33 @@ message GetLabelRequest {
// Required. The label ID.
string id = 1;
}


// Request message for listing counters for a given restaurant using [ListCounters][hpi.cloud.food.v1test.FoodService.ListCounters].
message ListCountersRequest {
// The maximum number of labels to return in the response.
int32 page_size = 1;

// A pagination token returned from a previous call to `ListLabels`
// that indicates where this listing should continue from.
string page_token = 2;

// Required. ID of the restaurant the counters should be listed for.
string restaurant_id = 3;
}

// Response message for listing Counters using [ListCounters][hpi.cloud.food.v1test.FoodService.ListCounters].
message ListCountersResponse {
// A possibly paginated list of counters.
repeated Counter Counters = 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 [GetCounter][hpi.cloud.food.v1test.FoodService.GetCounter].
message GetCounterRequest {
// Required. The label ID.
string id = 1;
}

0 comments on commit f87ea49

Please sign in to comment.