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: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: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:nu.yona.server.batch.rest.BatchTaskController.java

@RequestMapping(value = "/sendPinResetConfirmationCode/", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
public void requestPinResetConfirmationCode(
        @RequestBody PinResetConfirmationCodeSendRequestDto pinResetConfirmationCodeSendRequest) {
    batchTaskService.requestPinResetConfirmationCode(pinResetConfirmationCodeSendRequest);
}

From source file:com.codekul.simpleboot.controller.ControllerRestServices.java

@RequestMapping(value = "/user", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public /*@ResponseBody*/ ResponseEntity<User> userInfo() {

    User userBody = new User();
    userBody.setUserName("Android");
    userBody.setPassword("android");

    HttpHeaders headers = new HttpHeaders();

    ResponseEntity<User> entity = new ResponseEntity<>(userBody, headers, HttpStatus.OK);
    return entity;
}

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

@Override
public ResponseEntity<School> findById(int idUsuario, String token, Long id)
        throws EntidadNoEncontradaException {
    School p = repoSchool.findOne(id);//ww w  .  j ava 2  s.com

    if (p != null) {
        return new ResponseEntity(p, HttpStatus.OK);
    } else {
        throw new EntidadNoEncontradaException("Entity School");
    }
}

From source file:com.budiana.irpan.belajar.controller.PesertaController.java

@RequestMapping(value = "/peserta/{id}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)
public void updatePeserta(@PathVariable("id") String id, @RequestBody @Valid Peserta p) {
    p.setId(id);/*from w  w  w  .j  a  v a2s .c o  m*/
    pd.save(p);
}

From source file:springfox.documentation.spring.web.dummy.controllers.PetGroomingService.java

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Boolean> canGroom(@RequestParam String type) {
    return new ResponseEntity<Boolean>(HttpStatus.OK);
}

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

/** get all users
 * @return         void//from   w w  w.j av a  2  s.  co  m
 */

@RequestMapping(value = "", method = RequestMethod.GET)
public ResponseEntity<?> getUsers() {

    List<User> users = userDao.getAllUsers();

    if (users == null) {
        return new ResponseEntity<Object>(HttpStatus.BAD_REQUEST);
    } else {
        return new ResponseEntity<Object>(users, HttpStatus.OK);
    }
}

From source file:org.cloudfoundry.community.servicebroker.vrealize.service.TokenService.java

public String getToken() {
    try {/* w ww .j  ava 2 s  .com*/
        ResponseEntity<Map<String, String>> m = vraRepository.getToken(creds);
        if (!m.getStatusCode().equals(HttpStatus.OK)) {
            throw new ServiceBrokerException(m.getStatusCode().toString());
        }

        if (m.getBody().containsKey("id")) {
            return m.getBody().get("id");
        } else {
            throw new ServiceBrokerException("unable to get token from response.");
        }
    } catch (FeignException e) {
        LOG.error(e);
        throw new ServiceBrokerException("Unable to retrieve token.", e);
    }
}

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

/**
 * ?//w  w  w. ja  v a  2  s  .c  om
 * 
 * @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);
    }
}