Example usage for org.springframework.http HttpStatus OK

List of usage examples for org.springframework.http HttpStatus OK

Introduction

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

Prototype

HttpStatus OK

To view the source code for org.springframework.http HttpStatus OK.

Click Source Link

Document

200 OK .

Usage

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

@RequestMapping(value = "/cashier/sale-by-date", method = RequestMethod.POST)
public ResponseEntity<SalesReportWrapper> saleForDate(@RequestBody final SalesDateWrapper salesDateWrapper) {
    return new ResponseEntity<>(
            new SalesReportWrapper(
                    cashier.saleByPeriod(salesDateWrapper.getDateInitial(), salesDateWrapper.getDateInitial())),
            HttpStatus.OK);
}

From source file:com.tribuo.backend.controllers.ProductosTiendasController.java

/**
 *
 * @param idTienda/*  w ww . j a va 2  s.  c om*/
 * @param idProducto
 * @return
 */
@RequestMapping(value = "/{idTienda}-{idProducto}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<ProductosTiendas> getProductoTiendaById(@PathVariable("idTienda") Integer idTienda,
        @PathVariable("idProducto") Integer idProducto) {
    ProductosTiendas u = se.getProductoTiendaById(idTienda, idProducto);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:com.digitaslbi.helios.controllers.FileController.java

@RequestMapping(value = "/deleteFolder", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public void deleteObject(@RequestParam("fileName") String fileName) {
    delegate = new S3Delegate();
    delegate.deleteS3Object(fileName);
}

From source file:org.n52.restfulwpsproxy.webapp.rest.CapabilitiesController.java

/**
 *
 * @return/*from   www.  j a  v  a2  s .  c o  m*/
 */
@RequestMapping(method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public ResponseEntity<CapabilitiesDocument> getCapabilities() {
    return ResponseEntity.ok(client.get());
}

From source file:info.losd.galenweb.api.GalenWebApiController.java

@RequestMapping(value = "/healthchecks/{healthcheck}", method = RequestMethod.GET)
@ResponseBody/*from  ww w  .ja v  a 2s .  c  om*/
public HttpEntity<String> healthCheck(@PathVariable String healthcheck) {
    return new ResponseEntity<>("hello", HttpStatus.OK);
}

From source file:Controllers.myAppointmentController.java

@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public String AddApp(@ModelAttribute("appointments") Appointment appoint, BindingResult result,
        ModelMap modelMap) {/*from  ww  w  .jav a  2s  .  c  om*/

    Date fulldate = appoint.getDate();
    if (fulldate == null) {
        fulldate = new Date();
    }
    java.sql.Date date = new java.sql.Date(fulldate.getTime());

    //add validation of is it a doctor or not
    String content = "";
    Appointment[] appoints = fetchAppointments(date);
    if (appoints.length != 0) {
        content += "<table class=\"table\">"
                + "<thead><tr><th>First Name</th><th>Last Name</th><th>Claim</th></tr></thead><tbody>";
        for (Appointment appointment : appoints) {
            content += "<tr>\n" + "<td>" + appointment.getAppointmentId() + "</td><td>"
                    + appointment.getMessage() + "</td><td>" + appointment.getDepartmentId() + "</td>";
        }
        content += "</tbody></table>";
    }

    else {
        content += "There is no appointments for " + date;
    }

    modelMap.addAttribute("appoints", appoints);
    modelMap.addAttribute("content", content);

    return "myAppointment";
}

From source file:sparklr.common.AbstractProtectedResourceTests.java

@Test
public void testHealthResourceIsOpen() throws Exception {
    assertEquals(HttpStatus.OK, http.getStatusCode("/admin/health"));
}

From source file:com.joseph.california.test.restapi.ClubRestControllerTest.java

public void tesCreate() {
    Club club = new Club.Builder("Hackers").build();
    HttpEntity<Club> requestEntity = new HttpEntity<>(club, getContentType());
    //        Make the HTTP POST request, marshaling the request to JSON, and the response to a String
    ResponseEntity<String> responseEntity = restTemplate.exchange(URL + "api/club/create", HttpMethod.POST,
            requestEntity, String.class);
    System.out.println(" THE RESPONSE BODY " + responseEntity.getBody());
    System.out.println(" THE RESPONSE STATUS CODE " + responseEntity.getStatusCode());
    System.out.println(" THE RESPONSE IS HEADERS " + responseEntity.getHeaders());
    Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);

}

From source file:com.company.eleave.leave.rest.HolidayController.java

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List<HolidayDTO>> getAll() {
    List<HolidayDTO> holidays = holidayService.getAll().stream().map(holiday -> mapper.toDto(holiday))
            .collect(Collectors.toList());

    return new ResponseEntity<>(holidays, HttpStatus.OK);
}

From source file:com.otz.plugin.transport.funnel.controller.StreamsController.java

@CrossOrigin
@RequestMapping(path = "/definitions")
@ResponseBody//from   ww w .  j a  va  2s  .  c o  m
public ResponseEntity<StreamDefinitionNames> getStreams() {

    return new ResponseEntity(funnelService.getStreamDefinitionNames(), HttpStatus.OK);
}