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:com.tribuo.backend.controllers.SucursalesController.java

/**
 *
 * @param id/*from   w w  w  .ja va 2  s . c o  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:br.com.avelar.bac.controllers.CarController.java

@CrossOrigin
@RequestMapping("/description/{description}")
public ResponseEntity<List<Car>> findByDescription(@PathVariable String description) {
    List<Car> cars = service.findByDescription(description);
    return new ResponseEntity<List<Car>>(cars, HttpStatus.OK);
}

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

/**
 *
 * @param id/*w w w . j  a v a 2  s.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:md.ibanc.rm.controllers.request.RequestNewsController.java

@RequestMapping(value = "/find/newsCategory", method = RequestMethod.GET)
public ResponseEntity<List<NewsCategory>> getCardsByUser() {

    List<NewsCategory> list = new ArrayList<>();
    NewsCategory newsCategory = new NewsCategory();
    newsCategory.setNameCategory("Deposite");
    newsCategory.setNumberOfNews("10 News");
    newsCategory.setImagePath("album11");

    list.add(newsCategory);/*w  ww . j a va 2 s  . com*/
    newsCategory = new NewsCategory();
    newsCategory.setNameCategory("Service");
    newsCategory.setNumberOfNews("23 News");
    newsCategory.setImagePath("album10");

    list.add(newsCategory);

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

}

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

/**
 *
 * @param id//w  w  w.ja  va  2  s  .c  o  m
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Presentaciones> getPresentacion(@PathVariable("id") Integer id) {
    Presentaciones u = se.getPresentacionesById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:edu.eci.arsw.kalendan.controllers.TeamResourceController.java

@RequestMapping(path = "/equipos/{idT}", method = RequestMethod.GET)
public ResponseEntity<?> teamGetMembers(@PathVariable("idT") Integer teamid) {
    try {// w w w  .j  a  v  a  2  s.c  o m

        return new ResponseEntity<>(ts.getEquipo(teamid), HttpStatus.ACCEPTED);

    } catch (Exception ex) {
        Logger.getLogger(TeamResourceController.class.getName()).log(Level.SEVERE, null, ex);
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
}

From source file:com.opensearchserver.hadse.record.RecordController.java

@RequestMapping(method = RequestMethod.POST, value = "/{index_name}")
@ResponseBody//from  ww w  .j av  a 2s . com
public HttpEntity<String> postData(@RequestBody Map<String, Object> values) {
    return new ResponseEntity<String>("Not yet implemented", HttpStatus.NOT_IMPLEMENTED);
}

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

/**
 *
 * @param id//from w w w .j  ava 2s. c o m
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Subcategorias> getSubcategoria(@PathVariable("id") Integer id) {
    Subcategorias u = se.getSubcategoriaById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}

From source file:edu.eci.arsw.blindway.controller.SalasController.java

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<?> manejadorGetRecursoSalas() {
    ArrayList<Sala> data = salas.obtenerSalas();
    return new ResponseEntity<>(data, HttpStatus.ACCEPTED);
}

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

/**
 *
 * @param id//from   ww w . java 2s .  co  m
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<User> getUsuario(@PathVariable("id") Integer id) {
    User u = se.getUsuariosById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}