package com.google.graphgeckos.dashboard.fetchers.github;

import com.google.graphgeckos.dashboard.fetchers.github.CommitData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GitHubController {

  /**
   * Handles POST requests from the GitHub API. Setting GitHub Webhooks is required.
   * Extracts required data from the json {@see CommitData} and adds it to the Storage.
   * @param commitData json from the GitHub API.
   */
  @PostMapping("/github-info")
  public CommitData postGitHubInfo(@RequestBody CommitData commitData) {
    System.out.println(commitData);
    // TODO(issue #64): implement described functionality.
    assert false;
    return commitData;
  }

}

@@ -63,250 +63,49 @@
 ort 
-com.google.graphgeckos.dashboard.fetchers.github.CommitData;%0Aimport org.springframework.web.bind.annotation.PostMapping;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RestController
+org.springframework.web.bind.annotation.*
 ;%0A%0A@
@@ -393,10 +393,13 @@
 %0A  @
-Po
+Reque
 stMa
@@ -404,16 +404,24 @@
 Mapping(
+value = 
 %22/github
@@ -426,16 +426,90 @@
 ub-info%22
+, method = RequestMethod.POST, headers = %7B%22content-type=application/json%22%7D
 )%0A  publ
@@ -579,44 +579,8 @@
 ) %7B%0A
-    System.out.println(commitData);%0A
     
@@ -638,26 +638,8 @@
 ty.%0A
-    assert false;%0A
     

change @PostMapping to @RequestMapping and specify content type