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:be.boyenvaesen.RestControllers.SampleRestController.java

@RequestMapping("/employees/{id}")
@ResponseBody//  w  w  w  . j av  a  2s . c o m
public ResponseEntity<Employee> getOne(@PathVariable("id") Long id) {
    return new ResponseEntity<>(service.findOne(id), HttpStatus.OK);
}

From source file:com.monitor.controller.MessageController.java

@ApiOperation(value = "index", notes = "Get all messages")
@RequestMapping(method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public @ResponseBody List<Message> index() {
    return service.findAll();
}

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

/**
 *
 * @param id//  ww  w.j a  v a  2 s  .  c  om
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Categorias> getCategoria(@PathVariable("id") Integer id) {
    Categorias u = se.getCategoriasById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:com.mycompany.gis2.resource.AdministratorzyResource.java

@RequestMapping(value = "/admin", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity isCorrect(@RequestBody Administratorzy admin) {
    Administratorzy adminRep = adminRepository.findOneByLogin(admin.getLogin());

    return (admin.getHaslo().equals(adminRep.getHaslo())) ? new ResponseEntity(HttpStatus.OK)
            : new ResponseEntity(HttpStatus.UNAUTHORIZED);
}

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

/**
 *
 * @param id/* w  ww  .  j  av a2  s .com*/
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Productos> getProducto(@PathVariable("id") Integer id) {
    Productos u = se.getProductosById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

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

/**
 *
 * @param id/*from   w ww.ja v a2s.  co m*/
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Sucursales> getSucursale(@PathVariable("id") Integer id) {
    Sucursales u = se.getSucursalesById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:com.xinferin.controller.ActivationController.java

@RequestMapping(value = "/{licenceId}", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public int count(@PathVariable int licenceId) {
    return daoActivation.getCount(licenceId);
}

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

/**
 *
 * @param id/* w  w  w  .  j a  v a2s  .  c o m*/
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Fabricantes> getFabricante(@PathVariable("id") Integer id) {
    Fabricantes u = se.getFabricantesById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:com.salatigacode.controller.ProductController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
@Transactional(readOnly = false)// w  w w  .j  av  a  2s  . c o m
public void delete(@PathVariable("id") String id) throws Exception {
    if (!productDao.exists(id)) {
        throw new Exception("No data with the specified id");
    }
    productDao.delete(id);
}

From source file:net.eusashead.hateoas.conditional.interceptor.SyncTestController.java

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<String> get() {
    HttpHeaders headers = new HttpHeaders();
    headers.setETag("\"123456\"");
    return new ResponseEntity<String>("hello", headers, HttpStatus.OK);
}