package com.google.sps.servlets;

import com.google.appengine.api.users.UserServiceFactory;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/user-events")
public class UserProfileEventsServlet extends HttpServlet {
  private static final String email =
      UserServiceFactory.getUserService().getCurrentUser().getEmail();

  /** Gets the current user's corresponding events in DB */
  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    
  }

  /** Updates the current user's corresponding events in DB */
  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {

  }
}

@@ -96,27 +96,186 @@
 ort 
-java.io.IOException
+com.google.sps.data.EventVolunteering;%0Aimport com.google.sps.utilities.CommonUtils;%0Aimport com.google.sps.utilities.SpannerTasks;%0Aimport java.io.IOException;%0Aimport java.util.Set
 ;%0Aim
@@ -537,16 +537,134 @@
 rvlet %7B%0A
+  private static final String EVENT_TYPE = %22event-type%22;%0A  private static final String VOLUNTEERING = %22volunteering%22;%0A
   privat
@@ -936,20 +936,307 @@
 ption %7B%0A
-
     
+String eventType = request.getParameter(EVENT_TYPE);%0A    if (eventType.equals(VOLUNTEERING)) %7B%0A        Set%3CEventVolunteering%3E eventsVolunteering = SpannerTasks.getEventsVolunteeringByEmail(email);%0A        response.getWriter().println(CommonUtils.convertToJson(eventsVolunteering));%0A    %7D
 %0A  %7D%0A%0A  

Add servlet functionality to retrieve events volunteering.