Example usage for org.springframework.http ResponseEntity ResponseEntity

List of usage examples for org.springframework.http ResponseEntity ResponseEntity

Introduction

In this page you can find the example usage for org.springframework.http ResponseEntity ResponseEntity.

Prototype

public ResponseEntity(MultiValueMap<String, String> headers, HttpStatus status) 

Source Link

Document

Create a new HttpEntity with the given headers and status code, and no body.

Usage

From source file:br.com.hyperclass.snackbar.restapi.OrderController.java

@RequestMapping(value = "/order", method = RequestMethod.GET)
public ResponseEntity<ProductsWrapper> menuItemProducts() {
    return new ResponseEntity<ProductsWrapper>(new ProductsWrapper(order.productsMenu()), HttpStatus.OK);
}

From source file:gt.dakaik.rest.impl.UserProfileImpl.java

@Override
public ResponseEntity<UserProfile> findAll(int idUsuario, String token) throws EntidadNoEncontradaException {
    return new ResponseEntity(repoUserProfile.findAll(), HttpStatus.OK);
}

From source file:edu.sjsu.cmpe275.project.controller.OrderController.java

@RequestMapping(value = "/{id}", method = RequestMethod.POST)
public ResponseEntity<?> checkIn(@PathVariable(value = "id") Long id) {
    return new ResponseEntity<Object>(orderService.checkIn(id), HttpStatus.OK);
}

From source file:org.osiam.addons.self_administration.util.SelfAdministrationHelper.java

public static ResponseEntity<String> createErrorResponseEntity(String message, HttpStatus httpStatus) {
    return new ResponseEntity<>("{\"error\":\"" + message + "\"}", httpStatus);
}

From source file:be.boyenvaesen.RestControllers.SampleRestController.java

@RequestMapping(path = "/employees", method = RequestMethod.POST)
public ResponseEntity<Employee> postNew(@RequestBody Employee emp) {
    return new ResponseEntity<>(service.addNew(emp), HttpStatus.CREATED);
}

From source file:cr.ac.siua.tec.controllers.ExportController.java

/**
 * Method for incoming RT export requests.
 * It takes ticket Id as a parameter and returns JSON with a base64 encoded PDF.
 *//*from   w w  w . j a  va 2  s. c om*/
@CrossOrigin(origins = "http://rt.tec.siua.ac.cr")
@RequestMapping(value = "/export", method = RequestMethod.GET)
public ResponseEntity<HashMap<String, String>> export(@RequestParam("ticketId") String ticketId) {
    HashMap<String, String> ticketContent = rtService.getTicket(ticketId); //Fills hashmap with ticket customFields.
    HashMap<String, String> responseMap = new HashMap<>();
    if (ticketContent != null) {
        String pdfContent = exportService.getPDF(ticketContent);
        responseMap.put("content", pdfContent);
    } else {
        responseMap.put("content", "RT Server is down.");
    }
    return new ResponseEntity<>(responseMap, HttpStatus.OK);
}

From source file:fi.helsinki.opintoni.web.rest.publicapi.SystemResource.java

@RequestMapping(value = "/health-check", method = RequestMethod.GET, produces = WebConstants.APPLICATION_JSON_UTF8)
public ResponseEntity<HealthStatus> getHealthStatus() {
    return new ResponseEntity<>(new HealthStatus(), HttpStatus.OK);
}

From source file:br.com.oauth.resources.PublicoRestController.java

@ApiOperation(value = "Exibe que usuario no precisa estar logado")
@ResponseStatus(HttpStatus.OK)//from  w  ww  .  j av  a 2 s  .co  m
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Resposta<String>> getHome() {
    Resposta<String> resposta = RespostaBuilder.getBuilder()
            //                .setErros(Arrays.asList("Erro 1", "Erro 2"))
            //                .setMensagens(Arrays.asList("Mensagem 1", "Mensagem 2"))
            .setResultado("Voc no precisa estar logado").build();
    return new ResponseEntity<>(resposta, HttpStatus.OK);
}

From source file:com.phoenixnap.oss.sample.server.controllers.HealthCheckControllerImpl.java

@Override
public ResponseEntity<GetHealthCheckResponse> getHealthCheck() {
    GetHealthCheckResponse hcResponse = new GetHealthCheckResponse();
    hcResponse.setTimestamp(new DateTime().toString());
    hcResponse.setStatus(HealthStatusEnum.OK.name());
    return new ResponseEntity<GetHealthCheckResponse>(hcResponse, HttpStatus.OK);
}

From source file:com.baidu.stqa.signet.web.action.CountAction.java

/**
 * ?/*from ww w  .  jav  a  2 s .  c  o  m*/
 * 
 * @param date
 * @param line
 * @return
 */
@RequestMapping(value = "/count", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<List<Count>> count(String date, String line) {
    if (date == null) {
        if (line == null) {
            List<Count> result = countService.countAllVisit();
            return new ResponseEntity<List<Count>>(result, HttpStatus.OK);
        } else {
            List<Count> result = countService.countAllLine();
            return new ResponseEntity<List<Count>>(result, HttpStatus.OK);
        }

    } else {
        List<Count> result = countService.countNewlyVisit(date);
        return new ResponseEntity<List<Count>>(result, HttpStatus.OK);
    }
}