package com.green.rider.server;

import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class HelloController {
    @RequestMapping(value = "/api/user/create", method = RequestMethod.POST)
    public
    @ResponseBody
    String createUser(HttpServletRequest request) {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        JSONObject user = new JSONObject();
        return user.toString();
    }

    @RequestMapping(value = "/api/user/create", method = RequestMethod.POST)
    public
    @ResponseBody
    String printWelcome(HttpServletRequest request) {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        JSONObject user = new JSONObject();
        return user.toString();
    }

}
@@ -26,16 +26,74 @@
 erver;%0A%0A
+import org.json.JSONArray;%0Aimport org.json.JSONException;%0A
 import o
@@ -586,32 +586,53 @@
 Request request)
+ throws JSONException
  %7B%0A        Strin
@@ -774,32 +774,104 @@
 w JSONObject();%0A
+        user.put(%22uid%22, %22uid%22);%0A        user.put(%22app_key%22, %22app_key%22);%0A
         return u
@@ -923,35 +923,29 @@
 lue = %22/api/
-user/create
+plans
 %22, method = 
@@ -950,35 +950,34 @@
 = RequestMethod.
-POS
+GE
 T)%0A    public%0A  
@@ -1007,215 +1007,443 @@
 ing 
-printWelcome(HttpServletRequest request) %7B%0A        String username = request.getParameter(%22username%22);%0A        String password = request.getParameter(%22password%22);%0A        JSONObject user = new JSONObject(
+getAllPlans() throws JSONException %7B%0A        JSONArray plans = new JSONArray();%0A%0A        JSONObject plan = new JSONObject();%0A        plan.put(%22pid%22, %22pid%22);%0A        plan.put(%22name%22, %22name%22);%0A        plan.put(%22starter%22, %22starter%22);%0A        plan.put(%22start_place%22, %22start_place%22);%0A        plan.put(%22end_place%22, %22end_place%22);%0A        plan.put(%22start_time%22, %22start_time%22);%0A        plan.put(%22joiners%22, %22joiners%22);%0A        plans.put(plan
 );%0A
+%0A
     
@@ -1445,36 +1445,37 @@
 %0A        return 
-user
+plans
 .toString();%0A   

add get plans api