package bot;

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

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


@Controller
@RequestMapping("/webhook")
public class BotController {

    @RequestMapping(method = RequestMethod.POST)
    public @ResponseBody WebhookResponse webhook(@RequestBody String obj){
  System.out.println(obj);
        String indate = obj.substring(obj.indexOf("inDate"),obj.indexOf("inDate")+20);
        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        String d = "2017-07-23";
        Date date1 = new Date();
        try {
            date = f.parse(indate);
           date1 = f.parse(d);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        
        if (date.after(date1))
            return new WebhookResponse(date1.toString(), "https://www.google.com");
        else
           return new WebhookResponse(date1.toString() + date.toString(),"hey");
    }
}

@@ -787,29 +787,16 @@
 ate date
- = new Date()
 ;%0A      
@@ -844,21 +844,8 @@
 ate1
- = new Date()
 ;%0A  
@@ -935,89 +935,17 @@
     
-%7D catch (ParseException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    
     %0A
+    
     
@@ -971,16 +971,20 @@
 date1))%0A
+    
         
@@ -1071,12 +1071,110 @@
     
-else
+    %0A        %7D catch (ParseException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        %0A        
 %0A   
@@ -1212,42 +1212,11 @@
 nse(
-date1.toString() + date.toString()
+obj
 ,%22he

Update BotController.java