当前位置: 首页>>代码示例>>Java>>正文


Java ResponseUtil.wrapOrNotFound方法代码示例

本文整理汇总了Java中io.github.jhipster.web.util.ResponseUtil.wrapOrNotFound方法的典型用法代码示例。如果您正苦于以下问题:Java ResponseUtil.wrapOrNotFound方法的具体用法?Java ResponseUtil.wrapOrNotFound怎么用?Java ResponseUtil.wrapOrNotFound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.github.jhipster.web.util.ResponseUtil的用法示例。


在下文中一共展示了ResponseUtil.wrapOrNotFound方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProgram

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /programs/:id : get the "id" program.
 *
 * @param id the id of the programDTO to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the programDTO, or with status 404 (Not Found)
 */
@GetMapping("/programs/{id}")
@Timed
public ResponseEntity<ProgramDTO> getProgram(@PathVariable Long id) {
    log.debug("REST request to get Program : {}", id);
    ProgramDTO programDTO = programService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(programDTO));
}
 
开发者ID:ElectronicArmory,项目名称:Armory,代码行数:14,代码来源:ProgramResource.java

示例2: getUser

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET /users/:login : get the "login" user.
 *
 * @param login the login of the user to find
 * @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found)
 */
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@Timed
public ResponseEntity<UserDTO> getUser(@PathVariable String login) {
    log.debug("REST request to get User : {}", login);
    return ResponseUtil.wrapOrNotFound(
        userService.getUserWithAuthoritiesByLogin(login)
            .map(UserDTO::new));
}
 
开发者ID:torgcrm,项目名称:TorgCRM-Server,代码行数:15,代码来源:UserResource.java

示例3: getUser

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /users/:login : get the "login" user.
 *
 * @param login the login of the user to find
 * @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found)
 */
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@Timed
public ResponseEntity<UserDTO> getUser(@PathVariable String login) {
    log.debug("REST request to get User : {}", login);
    return ResponseUtil.wrapOrNotFound(
        userService.getUserWithAuthoritiesByLogin(login)
            .map(UserDTO::new));
}
 
开发者ID:AppertaFoundation,项目名称:Code4Health-Platform,代码行数:15,代码来源:UserResource.java

示例4: updateUser

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * PUT  /users : Updates an existing User.
 *
 * @param user the user to update
 * @return the ResponseEntity with status 200 (OK) and with body the updated user
 */
@PutMapping("/users")
@Timed
@Secured(AuthoritiesConstants.ADMIN)
public ResponseEntity<UserDTO> updateUser(@Valid @RequestBody UserDTO user) {
    Optional<UserDTO> updatedUser = userService.updateUser(user);
    updatedUser.ifPresent(userDTO -> produceEvent(userDTO, Constants.UPDATE_PROFILE_EVENT_TYPE));
    return ResponseUtil.wrapOrNotFound(updatedUser,
        HeaderUtil.createAlert("userManagement.updated", user.getUserKey()));
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:16,代码来源:UserResource.java

示例5: getWidget

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /widgets/:id : get the "id" widget.
 *
 * @param id the id of the widget to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the widget, or with status 404 (Not Found)
 */
@GetMapping("/widgets/{id}")
@Timed
public ResponseEntity<Widget> getWidget(@PathVariable Long id) {
    log.debug("REST request to get Widget : {}", id);
    Widget widget = widgetService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(widget));
}
 
开发者ID:xm-online,项目名称:xm-ms-dashboard,代码行数:14,代码来源:WidgetResource.java

示例6: getUser

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /users/:userKey : get the "userKey" user.
 *
 * @param userKey the userKey of the user to find
 * @return the ResponseEntity with status 200 (OK) and with body the "userKey" user, or with status 404 (Not Found)
 */
@GetMapping("/users/{userKey}")
@Timed
public ResponseEntity<UserDTO> getUser(@PathVariable String userKey) {
    return ResponseUtil.wrapOrNotFound(
        userService.findOneWithAuthoritiesAndLoginsByUserKey(userKey)
            .map(UserDTO::new));
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:14,代码来源:UserResource.java

示例7: getTask

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /tasks/:id : get the "id" task.
 *
 * @param id the id of the taskDTO to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the taskDTO, or with status 404 (Not Found)
 */
@GetMapping("/tasks/{id}")
@Timed
public ResponseEntity<TaskDTO> getTask(@PathVariable Long id) {
    log.debug("REST request to get Task : {}", id);
    TaskDTO taskDTO = taskService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(taskDTO));
}
 
开发者ID:torgcrm,项目名称:TorgCRM-Server,代码行数:14,代码来源:TaskResource.java

示例8: getResource

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /resources/:id : get the "id" resource.
 *
 * @param id the id of the resourceDTO to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the resourceDTO, or with status 404 (Not Found)
 */
@GetMapping("/resources/{id}")
@Timed
public ResponseEntity<ResourceDTO> getResource(@PathVariable Long id) {
    log.debug("REST request to get Resource : {}", id);
    ResourceDTO resourceDTO = resourceService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(resourceDTO));
}
 
开发者ID:ElectronicArmory,项目名称:Armory,代码行数:14,代码来源:ResourceResource.java

示例9: getLesson

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /lessons/:id : get the "id" lesson.
 *
 * @param id the id of the lessonDTO to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the lessonDTO, or with status 404 (Not Found)
 */
@GetMapping("/lessons/{id}")
@Timed
public ResponseEntity<LessonDTO> getLesson(@PathVariable Long id) {
    log.debug("REST request to get Lesson : {}", id);
    LessonDTO lessonDTO = lessonService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(lessonDTO));
}
 
开发者ID:ElectronicArmory,项目名称:Armory,代码行数:14,代码来源:LessonResource.java

示例10: getCatalog

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /catalogs/:id : get the "id" catalog.
 *
 * @param id the id of the catalog to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the catalog, or with status 404 (Not Found)
 */
@GetMapping("/catalogs/{id}")
@Timed
public ResponseEntity<Catalog> getCatalog(@PathVariable String id) {
    log.debug("REST request to get Catalog : {}", id);
    Catalog catalog = catalogService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(catalog));
}
 
开发者ID:deepu105,项目名称:spring-io,代码行数:14,代码来源:CatalogResource.java

示例11: getBlog

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /blogs/:id : get the "id" blog.
 *
 * @param id the id of the blog to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the blog, or with status 404 (Not Found)
 */
@GetMapping("/blogs/{id}")
@Timed
public ResponseEntity<Blog> getBlog(@PathVariable Long id) {
    log.debug("REST request to get Blog : {}", id);
    Blog blog = blogRepository.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(blog));
}
 
开发者ID:mraible,项目名称:devoxxus-jhipster-microservices-demo,代码行数:14,代码来源:BlogResource.java

示例12: getLease

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /leases/:id : get the "id" lease.
 *
 * @param id the id of the leaseDTO to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the leaseDTO, or with status 404 (Not Found)
 */
@GetMapping("/leases/{id}")
@Timed
public ResponseEntity<LeaseDTO> getLease(@PathVariable Long id) {
    log.debug("REST request to get Lease : {}", id);
    Lease lease = leaseRepository.findOne(id);
    LeaseDTO leaseDTO = leaseMapper.toDto(lease);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(leaseDTO));
}
 
开发者ID:Microsoft,项目名称:MTC_Labrat,代码行数:15,代码来源:LeaseResource.java

示例13: getCategory

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /categories/:id : get the "id" category.
 *
 * @param id the id of the category to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the category, or with status 404 (Not Found)
 */
@GetMapping("/categories/{id}")
@Timed
public ResponseEntity<Category> getCategory(@PathVariable Long id) {
    log.debug("REST request to get Category : {}", id);
    Category category = categoryService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(category));
}
 
开发者ID:deepu105,项目名称:spring-io,代码行数:14,代码来源:CategoryResource.java

示例14: getPocket

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /pockets/:id : get the "id" pocket.
 *
 * @param id the id of the pocket to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the pocket, or with status 404 (Not Found)
 */
@GetMapping("/pockets/{id}")
@Timed
public ResponseEntity<Pocket> getPocket(@PathVariable Long id) {
    log.debug("REST request to get Pocket : {}", id);
    Pocket pocket = pocketService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(pocket));
}
 
开发者ID:xm-online,项目名称:xm-ms-balance,代码行数:14,代码来源:PocketResource.java

示例15: getResultat

import io.github.jhipster.web.util.ResponseUtil; //导入方法依赖的package包/类
/**
 * GET  /resultats/:id : get the "id" resultat.
 *
 * @param id the id of the resultat to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the resultat, or with status 404 (Not Found)
 */
@GetMapping("/resultats/{id}")
@Timed
public ResponseEntity<Resultat> getResultat(@PathVariable Long id) {
    log.debug("REST request to get Resultat : {}", id);
    Resultat resultat = resultatService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(resultat));
}
 
开发者ID:pascalgrimaud,项目名称:qualitoast,代码行数:14,代码来源:ResultatResource.java


注:本文中的io.github.jhipster.web.util.ResponseUtil.wrapOrNotFound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。