After building your project and after the prototype
We may want to find a way to find a connection of React front to the Java API back side. So here is an example of RESTful usage of Spring MVC and how we use it.
1. Java Spring MVC RESTful
It is not too complex to configure a Spring MVC controller.
@RestController
public class SearchController {
BasicInfoService basicInfoService = new BasicInfoService();
JiraInfoService jiraInfoService = new JiraInfoService();
CommitInfoService commitInfoService = new CommitInfoService();
GitBlameInfoService gitBlameInfoService = new GitBlameInfoService();
@RequestMapping(value="/api/BasicInfo",method = RequestMethod.GET)
public BasicInfoVO basicInfoSearch(@RequestParam String classPath){
System.out.println(classPath);
return basicInfoService.getBasicInfo(classPath);
}
@RequestMapping(value="/api/JiraInfo",method = RequestMethod.GET)
public JiraInfoVO jiraInfoSearch(@RequestParam String location){
System.out.println(location);
return jiraInfoService.getJiraInfo(location);
}
@RequestMapping(value="/api/CommitHistory",method = RequestMethod.GET)
public List<CommitHistoryVO> commitHistorySearch(@RequestParam String location){
return commitInfoService.getCommitHistory(location);
}
@RequestMapping(value="/api/GitBlameInfo",method = RequestMethod.GET)
public GitBlameInfoVO gitBlameInfoSearch(@RequestParam String location,@RequestParam String line){