29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
|
package rest.entities;
|
||
|
|
||
|
import org.springframework.http.HttpStatus;
|
||
|
import org.springframework.http.ResponseEntity;
|
||
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||
|
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.RequestParam;
|
||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import models.composite.DatasetProfile;
|
||
|
|
||
|
@RestController
|
||
|
@CrossOrigin
|
||
|
public class Admin {
|
||
|
|
||
|
@RequestMapping(method = RequestMethod.POST, value = { "/admin/addDmp" },consumes = "application/json", produces="application/json")
|
||
|
public ResponseEntity<Object> addDmp(@RequestBody DatasetProfile profile){
|
||
|
try{
|
||
|
return ResponseEntity.status(HttpStatus.OK).body(profile);
|
||
|
}catch(Exception ex){
|
||
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"reason\":\""+ex.getMessage()+"\"}");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|