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

Don't merge this, I'm just testing out some stuff #11

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignore build artifacts in target/ directory
target/
# ignore IDE config file
.idea/
166 changes: 0 additions & 166 deletions client/client.js

This file was deleted.

35 changes: 0 additions & 35 deletions client/index.html

This file was deleted.

Binary file removed client/loading.gif
Binary file not shown.
23 changes: 0 additions & 23 deletions client/styles.css

This file was deleted.

37 changes: 37 additions & 0 deletions src/main/java/com/googlesps/feedon/data/Donation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Class for donation offer made by restaurant
package com.googlesps.data;

import java.util.Date;
import javax.annotation.Nullable;

public final class Donation {
private final long id;
private final String restaurantName;
private final String location;
private final String category;
private final String pickUpTime;
private final String quantity;
private final String specialInstructions;
private final String imageURL;
private final Date timestamp;

public Donation(long id,
String restaurantName,
String location,
String category,
String pickUpTime,
String quantity,
String specialInstructions,
String imageURL,
Date timestamp) {
this.id = id;
this.restaurantName = restaurantName;
this.location = location;
this.category = category;
this.pickUpTime = pickUpTime;
this.quantity = quantity;
this.specialInstructions = specialInstructions;
this.imageURL = imageURL;
this.timestamp = timestamp;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.googlesps.feedon.servlets;

import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* When the fetch() function requests the /blobstore-upload-url URL, the content of the response is
* the URL that allows a user to upload a file to Blobstore.
*/
@WebServlet("/blobstore-upload-url")
public class BlobstoreUploadURLServlet extends HttpServlet {

private static final String JSON_CONTENT_TYPE = "application/json";

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
String uploadUrl = blobstoreService.createUploadUrl("/donation-offer");

response.setContentType(JSON_CONTENT_TYPE);
response.getWriter().println(uploadUrl);
}
}
Loading