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:org.jtwig.acceptance.CheckTestingFrameworkTest.java

@RequestMapping("/")
public ResponseEntity<String> ok() {
    return new ResponseEntity<>("ok", HttpStatus.OK);
}

From source file:com.ar.dev.tierra.api.controller.ChartController.java

@RequestMapping(value = "/vendedor/cantidad", method = RequestMethod.GET)
public ResponseEntity<?> getRowCountVendedor(@RequestParam("idVendedor") int idVendedor) {
    List<Chart> chart = impl.getVentaVendedores(idVendedor);
    if (!chart.isEmpty()) {
        return new ResponseEntity<>(chart, HttpStatus.OK);
    } else {/*  www.  j  a v  a  2  s . c o  m*/
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
}

From source file:com.folion.api.rest.controller.HomePageRestController.java

@RequestMapping(value = "/test/test", method = RequestMethod.GET)
public ResponseEntity<Feature> getFeature() {
    Feature feature = new Feature();
    feature.setId(UUID.randomUUID().toString());
    return new ResponseEntity<>(feature, HttpStatus.OK);
}

From source file:com.gong.illidan.rest.controller.UserController.java

/**
 * GET /users -> get all the users/*  ww  w  . ja  va 2  s.  c  o  m*/
 */
@RequestMapping(value = "/test", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<User> test() {
    log.info("REST request to test");
    return new ResponseEntity<>(userService.getUser(1), HttpStatus.OK);
}

From source file:com.baidu.terminator.manager.action.LogAction.java

@RequestMapping(value = "/{linkId}/{offset}", method = RequestMethod.GET)
public ResponseEntity<Log> getLog(@PathVariable int linkId, @PathVariable long offset) throws IOException {
    Log log = logService.readLog(linkId, offset);
    return new ResponseEntity<Log>(log, HttpStatus.OK);
}

From source file:demo.SecurityController.java

@RequestMapping("/authenticate")
public ResponseEntity<Resource<?>> login(PersistentEntityResourceAssembler assembler) {
    User currentUser = new User();
    currentUser.setId(1L);/* w  ww .  jav  a  2  s  .  c om*/
    currentUser.setUsername("username");

    return new ResponseEntity<Resource<?>>(assembler.toResource(currentUser), HttpStatus.OK);
}

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

/**
 * //ww w. jav a  2s.  com
 * 
 * @return
 */
@RequestMapping(value = "/user", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Map<String, String>> queryUser() {

    String user = getUser();
    Map<String, String> result = new HashMap<String, String>();
    result.put("user", user);
    return new ResponseEntity<Map<String, String>>(result, HttpStatus.OK);
}

From source file:com.ar.dev.tierra.api.controller.TemporadaController.java

@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAll() {
    List<Temporada> temporadas = facadeService.getTemporadaDAO().getAll();
    if (!temporadas.isEmpty()) {
        return new ResponseEntity<>(temporadas, HttpStatus.OK);
    } else {/*from w w w.  java  2  s .  c  o  m*/
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
    }
}

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

/**
 *
 * @return/* w w w .j a v a  2  s  .c o  m*/
 */
@RequestMapping(value = "/all", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<List<ProductosTiendas>> getProductosTiendas() {
    List<ProductosTiendas> u = se.getProductosTiendas();
    return new ResponseEntity<>(u, HttpStatus.OK);
}

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

/**
 *
 * @param id/*from   www.  ja va  2 s.c  om*/
 * @return
 */
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Ventas> getVenta(@PathVariable("id") Integer id) {
    Ventas u = se.getVentasById(id);
    return new ResponseEntity<>(u, HttpStatus.OK);
}