create web application
This commit is contained in:
34
pdb-ui/src/main/java/org/lucares/pdbui/PdbController.java
Normal file
34
pdb-ui/src/main/java/org/lucares/pdbui/PdbController.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package org.lucares.pdbui;
|
||||
|
||||
import org.lucares.pdbui.domain.PlotRequest;
|
||||
import org.lucares.pdbui.domain.PlotResponse;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.http.MediaType;
|
||||
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;
|
||||
|
||||
@Controller
|
||||
@EnableAutoConfiguration
|
||||
public class PdbController {
|
||||
|
||||
private final PdbRepository pdbRepository;
|
||||
|
||||
public PdbController(final PdbRepository pdbRepository) {
|
||||
this.pdbRepository = pdbRepository;
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/plots", //
|
||||
method = RequestMethod.POST, //
|
||||
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, //
|
||||
produces = MediaType.APPLICATION_JSON_UTF8_VALUE //
|
||||
)
|
||||
@ResponseBody
|
||||
PlotResponse createPlot(@RequestBody final PlotRequest request) {
|
||||
System.out.println(request.getQuery());
|
||||
return new PlotResponse("img/abc.png");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user