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:com.baidu.stqa.signet.web.action.SubmitAction.java

/**
 * ???/*from  w ww.j a v a 2  s.co m*/
 * 
 * @param projectId
 * @param storyId
 * @return
 */
@RequestMapping(value = "/project/{projectId}/story/{storyId}/submission", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Boolean> isSubmit(@PathVariable long projectId, @PathVariable long storyId) {

    doLog(projectId);
    Submit submit = submitService.querySubmit(projectId, storyId);
    if (submit == null) {
        return new ResponseEntity<Boolean>(false, HttpStatus.OK);
    } else {
        return new ResponseEntity<Boolean>(true, HttpStatus.OK);
    }
}

From source file:com.melayer.camzia.controller.MeControllerAdmin.java

@RequestMapping(path = "/securityLess", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
public Callable<ResponseEntity<Map<String, Object>>> checkWithoutSecurity() {

    return () -> {

        entityMap.clear();/* w  w w  . j a  va  2s  . c  o m*/
        entityMap.put("status", "It is securityless");

        ResponseEntity<Map<String, Object>> entity = new ResponseEntity<>(entityMap, HttpStatus.OK);

        return entity;
    };
}

From source file:io.pivotal.ecosystem.service.client.HelloClientController.java

@RequestMapping(value = "/greeting", method = RequestMethod.GET, produces = "application/json; charset=UTF-8")
ResponseEntity<String> greeting(@RequestParam(value = "username") String username) {
    try {/*  ww  w  . ja  va 2s.  c  o m*/
        return new ResponseEntity<>(helloRepository.greeting(username), HttpStatus.OK);
    } catch (HelloException e) {
        return new ResponseEntity<>(e.getMessage(), e.getStatus());
    }
}

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

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

From source file:edu.infsci2560.services.FriendService.java

@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<Friend> list(@PathVariable("id") Long id) {
    HttpHeaders headers = new HttpHeaders();
    return new ResponseEntity<>(repository.findOne(id), headers, HttpStatus.OK);
}

From source file:com.sms.server.controller.MediaController.java

@RequestMapping(value = "/folder", method = RequestMethod.GET)
public ResponseEntity<List<MediaFolder>> getMediaFolders() {
    List<MediaFolder> mediaFolders = settingsDao.getMediaFolders();

    if (mediaFolders == null) {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }/*from  w w  w  . j  ava  2 s. c  o  m*/

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

From source file:sample.jsp.SampleWebJspApplicationTests.java

@Test
public void testJspWithEl() throws Exception {
    ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).contains("/resources/text.txt");
}

From source file:com.srinathavan.mwbng.rest.mvc.BlogEntryController.java

/**
 * Method to blog entry data by its id//from  www  . ja  v a  2s  . c o  m
 * 
 * @param blogEntryId
 * @return
 */
@RequestMapping(value = "/{blogEntryId}")
public @ResponseBody ResponseEntity<Object> getBlogEntry(@PathVariable Long blogEntryId) {
    BlogEntry blogEntry = blogEntryService.findBlogEntry(blogEntryId);
    if (null != blogEntry) {
        return new ResponseEntity<Object>(blogEntry, HttpStatus.OK);
    } else {
        return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
    }
}

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

@Override
public ResponseEntity<DocumentType> findAll(int idUsuario, String token) throws EntidadNoEncontradaException {
    return new ResponseEntity(repoDocumentType.findAll(), HttpStatus.OK);
}

From source file:com.digitgroup.fullstackroad.web.controller.EShopController.java

@RequestMapping(value = "/contacts", produces = {
        MediaType.APPLICATION_JSON_VALUE }, method = RequestMethod.GET)
public @ResponseBody ResponseEntity<List<Customer>> getCustomers() {
    List<Customer> customers = customerService.findAll();
    return new ResponseEntity<List<Customer>>(customers, HttpStatus.OK);
}