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

feat(feedback-api): implementation of the grpc api #228

Merged
merged 22 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dcbeaf2
added a feedback cronjob
CommanderStorm Sep 16, 2023
a740c95
added a testcase
CommanderStorm Sep 16, 2023
dcf7403
linting fixes
CommanderStorm Sep 23, 2023
2d2826f
fixed naming issues
CommanderStorm Sep 23, 2023
6b49b50
changed the feedback api
CommanderStorm Sep 16, 2023
b75c12c
renamed `SendFeedback` -> `NewFeedback`
CommanderStorm Oct 1, 2023
18e426a
simplified the feedback stream to ensure that any feedbaykrequest is …
CommanderStorm Oct 1, 2023
c6f6b51
Merge branch 'main' into feature/feedback-api-changes
CommanderStorm Oct 2, 2023
d05f798
regen
CommanderStorm Oct 2, 2023
0a1b421
flattened the metadata
CommanderStorm Oct 3, 2023
3437e93
Merge branch 'main' into feature/feedback-api-changes
CommanderStorm Oct 3, 2023
f883432
fixed rebasing error
CommanderStorm Oct 3, 2023
82ec9cc
bumped the client version
CommanderStorm Oct 3, 2023
4df2bce
rebase
CommanderStorm Oct 3, 2023
296bffc
fixed the rollback of one migration accidentally using the wrong enum…
CommanderStorm Oct 3, 2023
c120209
Merge branch 'main' into feature/feedback-api-changes
CommanderStorm Oct 4, 2023
6f9027c
refactored the feedback upload to concentrate db-transactions in one …
CommanderStorm Oct 10, 2023
cdcbedc
added an allowlist of filetypes
CommanderStorm Oct 10, 2023
e9ad7fc
Merge branch 'main' into feature/feedback-api-changes
CommanderStorm Oct 10, 2023
d823932
formatting
CommanderStorm Oct 11, 2023
eb1ceb7
fixed the testcase
CommanderStorm Oct 11, 2023
1557954
Merge branch 'main' into feature/feedback-api-changes
CommanderStorm Oct 11, 2023
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
1,291 changes: 706 additions & 585 deletions server/api/tumdev/campus_backend.pb.go

Large diffs are not rendered by default.

82 changes: 36 additions & 46 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.

46 changes: 34 additions & 12 deletions server/api/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ service Campus {
option (google.api.http) = {get: "/movies/{last_id}"};
}

rpc CreateFeedback(CreateFeedbackRequest) returns (CreateFeedbackReply) {
option (google.api.http) = {post: "/feedback"};
rpc CreateFeedback(stream CreateFeedbackRequest) returns (CreateFeedbackReply) {
option (google.api.http) = {
post: "/feedback",
body: "attachment",
};
}

rpc GetUploadStatus(GetUploadStatusRequest) returns (GetUploadStatusReply) {
Expand Down Expand Up @@ -549,19 +552,38 @@ message Movie {
string link = 16;
}

message CreateFeedbackReply {}
message CreateFeedbackRequest {
string topic = 1;
string email = 2;
string email_id = 3;
string message = 4;
int32 image_count = 5;
double latitude = 6;
double longitude = 7;
string os_version = 8;
string app_version = 9;
enum Recipient {
// Feedback for the TUM Dev Team
TUM_DEV = 0;
// Feedback for the general TUM Contact Form
TUM_CONTACT = 1;
}

// who is the feedback for
Recipient recipient = 1;
// the email address of the user
string from_email = 2;
// The actual message
string message = 3;
// Optional location which the user can choose (data protection) to attach or not
Coordinate location = 4;
// Optional os information which the user can choose (data protection) to attach or not
string os_version = 5;
// Optional app information which the user can choose (data protection) to attach or not
string app_version = 6;
// Optional file in Base64.
// Accepted file formats: jpeg, jpg, png, webp, md, txt, pdf
// Maximum file size 4MB as by Protobuf maximum per request message size
bytes attachment = 7;
}
message Coordinate {
double latitude = 1;
double longitude = 2;
}

message CreateFeedbackReply {}

message CreateFeedbackImageReply {
string status = 1;
}
Expand Down
61 changes: 45 additions & 16 deletions server/api/tumdev/campus_backend.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,58 +507,65 @@
},
"parameters": [
{
"name": "topic",
"in": "query",
"required": false,
"type": "string"
"name": "attachment",
"description": "Optional file in Base64.\nAccepted file formats: jpeg, jpg, png, webp, md, txt, pdf\nMaximum file size 4MB as by Protobuf maximum per request message size (streaming inputs)",
"in": "body",
"required": true,
"schema": {
"type": "string",
"format": "byte"
}
},
{
"name": "email",
"name": "recipient",
"description": "who is the feedback for\n\n - TUM_DEV: Feedback for the TUM Dev Team\n - TUM_CONTACT: Feedback for the general TUM Contact Form",
"in": "query",
"required": false,
"type": "string"
"type": "string",
"enum": [
"TUM_DEV",
"TUM_CONTACT"
],
"default": "TUM_DEV"
},
{
"name": "emailId",
"name": "fromEmail",
"description": "the email address of the user",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "message",
"description": "The actual message",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "imageCount",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "latitude",
"name": "location.latitude",
"in": "query",
"required": false,
"type": "number",
"format": "double"
},
{
"name": "longitude",
"name": "location.longitude",
"in": "query",
"required": false,
"type": "number",
"format": "double"
},
{
"name": "osVersion",
"description": "Optional os information which the user can choose (data protection) to attach or not",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "appVersion",
"description": "Optional app information which the user can choose (data protection) to attach or not",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -970,6 +977,15 @@
}
},
"definitions": {
"CreateFeedbackRequestRecipient": {
"type": "string",
"enum": [
"TUM_DEV",
"TUM_CONTACT"
],
"default": "TUM_DEV",
"title": "- TUM_DEV: Feedback for the TUM Dev Team\n - TUM_CONTACT: Feedback for the general TUM Contact Form"
},
"ListMoreInformationReplyMoreInformation": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1003,6 +1019,19 @@
}
}
},
"apiCoordinate": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
}
},
"apiCreateCanteenRatingReply": {
"type": "object"
},
Expand Down
Loading
Loading