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


Java ApiParam类代码示例

本文整理汇总了Java中com.wordnik.swagger.annotations.ApiParam的典型用法代码示例。如果您正苦于以下问题:Java ApiParam类的具体用法?Java ApiParam怎么用?Java ApiParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getSeveral

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@RequestMapping(method=GET)
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "Get overviews of stocks", notes = "Return a page of stock-overviews")
public PagedResources<StockProductResource> getSeveral(
		@Or({
               @Spec(params="cn", path="id", spec=LikeIgnoreCase.class),
               @Spec(params="cn", path="name", spec=LikeIgnoreCase.class)}	
		) @ApiIgnore Specification<StockProduct> spec,
		@ApiParam(value="Exchange ID") @RequestParam(value="exchange", required=false) String exchangeId,
		@ApiParam(value="Index ID") @RequestParam(value="index", required=false) String indexId, 
		@ApiParam(value="Market ID") @RequestParam(value="market", required=false) MarketId marketId, 
           @ApiParam(value="Starts with filter") @RequestParam(value="sw", defaultValue="", required=false) String startWith, 
           @ApiParam(value="Contains filter") @RequestParam(value="cn", defaultValue="", required=false) String contain, 
           @ApiIgnore @PageableDefault(size=10, page=0, sort={"name"}, direction=Direction.ASC) Pageable pageable){
	return pagedAssembler.toResource(stockProductService.gather(indexId, exchangeId, marketId, startWith, spec, pageable), assembler);
}
 
开发者ID:alex-bretet,项目名称:cloudstreetmarket.com,代码行数:17,代码来源:StockProductController.java

示例2: getS3LogsForTask

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/task/{taskId}")
@ApiOperation("Retrieve the list of logs stored in S3 for a specific task.")
public List<SingularityS3Log> getS3LogsForTask(
    @ApiParam("The task ID to search for") @PathParam("taskId") String taskId,
    @ApiParam("Start timestamp (millis, 13 digit)") @QueryParam("start") Optional<Long> start,
    @ApiParam("End timestamp (mills, 13 digit)") @QueryParam("end") Optional<Long> end) throws Exception {
  checkS3();

  SingularityTaskId taskIdObject = getTaskIdObject(taskId);

  try {
    return getS3Logs(configuration.get(), getRequest(taskIdObject.getRequestId()).getRequest().getGroup(), getS3PrefixesForTask(configuration.get(), taskIdObject, start, end));
  } catch (TimeoutException te) {
    throw timeout("Timed out waiting for response from S3 for %s", taskId);
  } catch (Throwable t) {
    throw Throwables.propagate(t);
  }
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:20,代码来源:S3LogResource.java

示例3: getS3LogsForRequest

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/request/{requestId}")
@ApiOperation("Retrieve the list of logs stored in S3 for a specific request.")
public List<SingularityS3Log> getS3LogsForRequest(
    @ApiParam("The request ID to search for") @PathParam("requestId") String requestId,
    @ApiParam("Start timestamp (millis, 13 digit)") @QueryParam("start") Optional<Long> start,
    @ApiParam("End timestamp (mills, 13 digit)") @QueryParam("end") Optional<Long> end) throws Exception {
  checkS3();

  try {
    return getS3Logs(configuration.get(), getRequest(requestId).getRequest().getGroup(), getS3PrefixesForRequest(configuration.get(), requestId, start, end));
  } catch (TimeoutException te) {
    throw timeout("Timed out waiting for response from S3 for %s", requestId);
  } catch (Throwable t) {
    throw Throwables.propagate(t);
  }
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:18,代码来源:S3LogResource.java

示例4: getS3LogsForDeploy

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/request/{requestId}/deploy/{deployId}")
@ApiOperation("Retrieve the list of logs stored in S3 for a specific deploy.")
public List<SingularityS3Log> getS3LogsForDeploy(
    @ApiParam("The request ID to search for") @PathParam("requestId") String requestId,
    @ApiParam("The deploy ID to search for") @PathParam("deployId") String deployId,
    @ApiParam("Start timestamp (millis, 13 digit)") @QueryParam("start") Optional<Long> start,
    @ApiParam("End timestamp (mills, 13 digit)") @QueryParam("end") Optional<Long> end) throws Exception {
  checkS3();

  try {
    return getS3Logs(configuration.get(), getRequest(requestId).getRequest().getGroup(), getS3PrefixesForDeploy(configuration.get(), requestId, deployId, start, end));
  } catch (TimeoutException te) {
    throw timeout("Timed out waiting for response from S3 for %s-%s", requestId, deployId);
  } catch (Throwable t) {
    throw Throwables.propagate(t);
  }
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:19,代码来源:S3LogResource.java

示例5: deployment

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@DELETE
@Path("/deploy/{deployId}/request/{requestId}")
@ApiOperation(value="Cancel a pending deployment (best effort - the deploy may still succeed or fail)", response=SingularityRequestParent.class)
@ApiResponses({
  @ApiResponse(code=400, message="Deploy is not in the pending state pending or is not not present"),
})
public SingularityRequestParent cancelDeploy(
    @ApiParam(required=true, value="The Singularity Request Id from which the deployment is removed.") @PathParam("requestId") String requestId,
    @ApiParam(required=true, value="The Singularity Deploy Id that should be removed.") @PathParam("deployId") String deployId) {
  SingularityRequestWithState requestWithState = fetchRequestWithState(requestId);

  authorizationHelper.checkForAuthorization(requestWithState.getRequest(), user, SingularityAuthorizationScope.WRITE);

  Optional<SingularityRequestDeployState> deployState = deployManager.getRequestDeployState(requestWithState.getRequest().getId());

  checkBadRequest(deployState.isPresent() && deployState.get().getPendingDeploy().isPresent() && deployState.get().getPendingDeploy().get().getDeployId().equals(deployId),
    "Request %s does not have a pending deploy %s", requestId, deployId);

  deployManager.createCancelDeployRequest(new SingularityDeployMarker(requestId, deployId, System.currentTimeMillis(), JavaUtils.getUserEmail(user), Optional.<String> absent()));

  return fillEntireRequest(requestWithState);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:23,代码来源:DeployResource.java

示例6: updatePendingDeploy

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@POST
@Path("/update")
@ApiOperation(value="Update the target active instance count for a pending deploy", response=SingularityRequestParent.class)
@ApiResponses({
  @ApiResponse(code=400, message="Deploy is not in the pending state pending or is not not present")
})
public SingularityRequestParent updatePendingDeploy(@ApiParam(required=true) SingularityUpdatePendingDeployRequest updateRequest) {
  SingularityRequestWithState requestWithState = fetchRequestWithState(updateRequest.getRequestId());

  authorizationHelper.checkForAuthorization(requestWithState.getRequest(), user, SingularityAuthorizationScope.WRITE);

  Optional<SingularityRequestDeployState> deployState = deployManager.getRequestDeployState(requestWithState.getRequest().getId());

  checkBadRequest(deployState.isPresent() && deployState.get().getPendingDeploy().isPresent() && deployState.get().getPendingDeploy().get().getDeployId().equals(updateRequest.getDeployId()),
    "Request %s does not have a pending deploy %s", updateRequest.getRequestId(), updateRequest.getDeployId());

  checkBadRequest(updateRequest.getTargetActiveInstances() > 0 && updateRequest.getTargetActiveInstances() <= requestWithState.getRequest().getInstancesSafe(),
    "Cannot update pending deploy to have more instances (%s) than instances set for request (%s), or less than 1 instance", updateRequest.getTargetActiveInstances(), requestWithState.getRequest().getInstancesSafe());

  deployManager.createUpdatePendingDeployRequest(updateRequest);

  return fillEntireRequest(requestWithState);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:24,代码来源:DeployResource.java

示例7: getInactiveDeployTasks

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/request/{requestId}/deploy/{deployId}/tasks/inactive")
@ApiOperation("Retrieve the task history for a specific deploy.")
public List<SingularityTaskIdHistory> getInactiveDeployTasks(
    @ApiParam("Request ID for deploy") @PathParam("requestId") String requestId,
    @ApiParam("Deploy ID") @PathParam("deployId") String deployId,
    @ApiParam("Maximum number of items to return") @QueryParam("count") Integer count,
    @ApiParam("Which page of items to view") @QueryParam("page") Integer page) {
  authorizationHelper.checkForAuthorizationByRequestId(requestId, user, SingularityAuthorizationScope.READ);

  final Integer limitCount = getLimitCount(count);
  final Integer limitStart = getLimitStart(limitCount, page);

  SingularityDeployKey key = new SingularityDeployKey(requestId, deployId);
  return deployTaskHistoryHelper.getBlendedHistory(key, limitStart, limitCount);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:17,代码来源:HistoryResource.java

示例8: getTaskHistory

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/tasks")
@ApiOperation("Retrieve the history sorted by startedAt for all inactive tasks.")
public List<SingularityTaskIdHistory> getTaskHistory(
    @ApiParam("Optional Request ID to match") @QueryParam("requestId") Optional<String> requestId,
    @ApiParam("Optional deploy ID to match") @QueryParam("deployId") Optional<String> deployId,
    @ApiParam("Optional host to match") @QueryParam("host") Optional<String> host,
    @ApiParam("Optional last task status to match") @QueryParam("lastTaskStatus") Optional<ExtendedTaskState> lastTaskStatus,
    @ApiParam("Optionally match only tasks started after") @QueryParam("startedAfter") Optional<Long> startedAfter,
    @ApiParam("Optionally match only tasks started before") @QueryParam("startedBefore") Optional<Long> startedBefore,
    @ApiParam("Sort direction") @QueryParam("orderDirection") Optional<OrderDirection> orderDirection,
    @ApiParam("Maximum number of items to return") @QueryParam("count") Integer count,
    @ApiParam("Which page of items to view") @QueryParam("page") Integer page) {
  if (requestId.isPresent()) {
    authorizationHelper.checkForAuthorizationByRequestId(requestId.get(), user, SingularityAuthorizationScope.READ);
  } else {
    authorizationHelper.checkAdminAuthorization(user);
  }

  final Integer limitCount = getLimitCount(count);
  final Integer limitStart = getLimitStart(limitCount, page);

  return taskHistoryHelper.getBlendedHistory(new SingularityTaskHistoryQuery(requestId, deployId, host, lastTaskStatus, startedBefore, startedAfter,
      orderDirection), limitStart, limitCount);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:26,代码来源:HistoryResource.java

示例9: getTaskHistoryForRequest

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@GET
@Path("/request/{requestId}/tasks")
@ApiOperation("Retrieve the history sorted by startedAt for all inactive tasks of a specific request.")
public List<SingularityTaskIdHistory> getTaskHistoryForRequest(
    @ApiParam("Request ID to match") @PathParam("requestId") String requestId,
    @ApiParam("Optional deploy ID to match") @QueryParam("deployId") Optional<String> deployId,
    @ApiParam("Optional host to match") @QueryParam("host") Optional<String> host,
    @ApiParam("Optional last task status to match") @QueryParam("lastTaskStatus") Optional<ExtendedTaskState> lastTaskStatus,
    @ApiParam("Optionally match only tasks started after") @QueryParam("startedAfter") Optional<Long> startedAfter,
    @ApiParam("Optionally match only tasks started before") @QueryParam("startedBefore") Optional<Long> startedBefore,
    @ApiParam("Sort direction") @QueryParam("orderDirection") Optional<OrderDirection> orderDirection,
    @ApiParam("Maximum number of items to return") @QueryParam("count") Integer count,
    @ApiParam("Which page of items to view") @QueryParam("page") Integer page) {
  authorizationHelper.checkForAuthorizationByRequestId(requestId, user, SingularityAuthorizationScope.READ);

  final Integer limitCount = getLimitCount(count);
  final Integer limitStart = getLimitStart(limitCount, page);

  return taskHistoryHelper.getBlendedHistory(new SingularityTaskHistoryQuery(Optional.of(requestId), deployId, host, lastTaskStatus, startedBefore, startedAfter,
      orderDirection), limitStart, limitCount);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:22,代码来源:HistoryResource.java

示例10: skipHealthchecks

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@PUT
@Path("/request/{requestId}/skipHealthchecks")
@Consumes({ MediaType.APPLICATION_JSON })
@ApiOperation(value="Update the skipHealthchecks field for the request, possibly temporarily", response=SingularityRequestParent.class)
@ApiResponses({
  @ApiResponse(code=404, message="No Request with that ID"),
})
public SingularityRequestParent skipHealthchecks(@ApiParam("The Request ID to scale") @PathParam("requestId") String requestId,
    @ApiParam("SkipHealtchecks options") SingularitySkipHealthchecksRequest skipHealthchecksRequest) {
  SingularityRequestWithState oldRequestWithState = fetchRequestWithState(requestId);

  SingularityRequest oldRequest = oldRequestWithState.getRequest();
  SingularityRequest newRequest = oldRequest.toBuilder().setSkipHealthchecks(skipHealthchecksRequest.getSkipHealthchecks()).build();

  submitRequest(newRequest, Optional.of(oldRequestWithState), Optional.<RequestHistoryType> absent(), Optional.<Boolean> absent(), skipHealthchecksRequest.getMessage());

  if (skipHealthchecksRequest.getDurationMillis().isPresent()) {
    requestManager.saveExpiringObject(new SingularityExpiringSkipHealthchecks(requestId, JavaUtils.getUserEmail(user),
        System.currentTimeMillis(), skipHealthchecksRequest, oldRequest.getSkipHealthchecks(), skipHealthchecksRequest.getActionId().or(UUID.randomUUID().toString())));
  }

  return fillEntireRequest(fetchRequestWithState(requestId));
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:24,代码来源:RequestResource.java

示例11: createSysUserPermission

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@RequiresPermissions("admin:authority:sysuser:userPermission:update")
@RequestMapping(value = "/createSysUserPermission", method = RequestMethod.POST)
@ResponseBody
@LogAudit
   @ApiOperation(value = "创建用户权限", httpMethod = "POST", response = Map.class, notes = "创建用户权限",
           produces="application/json",consumes="application/x-www-form-urlencoded")
public Map<String, Object> createSysUserPermission(@ApiParam(required=true, value="用户Id")@RequestParam("id") Integer userId,
                                                      @ApiParam(required=true, value="权限Id数组")@RequestParam("permissionIds") String permissionIds) throws Exception {
	SecurityUtils.getSubject().checkRole("Administrator");
       sysUserAdvanceService.clearCacheHolder();
	String[] permissionStrings = permissionIds.split(Constants.SPACE);
	if (userId != null && permissionStrings != null && permissionStrings.length > 0) {
		sysPermissionAdvanceService.deleteSysUserPermissionByUserId(userId);
		Set<String> permissionSet = new HashSet<String>();
		for (String add : permissionStrings) {
			permissionSet.add(add); //使用Set接口过滤去重权限
		}
		for (String permission : permissionSet) {
			sysPermissionAdvanceService.createSysUserPermission(userId, Integer.parseInt(permission));
		}
	}
	Map<String, Object> result = Maps.newHashMap();
	result.put("message", "保存用户权限成功!");
	result.put("responseid", 1);
	return result;
}
 
开发者ID:simbest,项目名称:simbest-cores,代码行数:27,代码来源:SysUserController.java

示例12: getStadisticByProblem

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@ApiOperation(value = "Obtener las estadísticas de un problema",  
        notes = "Dado el identificador de un problema, devuelve todos las estadísticas asociadas a este.",
        response = StadisticsRest.class)
@ApiResponses(value = { @ApiResponse(code = 404, message = "bad pid") })    
@RequestMapping(value = "/problem/{pid}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody
public ResponseEntity<?> getStadisticByProblem(
        @ApiParam(value = "Identificador del problema") @PathVariable int pid) {
    
    if (!problemDAO.exists(pid) )
        return new ResponseEntity<>(ErrorUtils.BAD_PID, HttpStatus.NOT_FOUND);     

    Problem p = problemDAO.getStatistics("en", pid);
    StadisticsRest stadistic = new StadisticsRest(""+pid, p.getAc(), p.getCe(), p.getIvf(), p.getMle(), p.getOle(), p.getPe(), p.getRte(), p.getTle(), p.getWa(), p.getSubmitions());
    return new ResponseEntity<>(stadistic, HttpStatus.OK);
    
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:18,代码来源:RestStatisticsController.java

示例13: getDescriptionCountryByCountryID

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@ApiOperation(value = "Obtener la descripción de un país",  
        notes = "Dado el identificador de un país, devuelve las descripción asociada a este.",
        response = CountryDescriptionRest.class)
@ApiResponses(value = { @ApiResponse(code = 404, message = "bad country id") })
@RequestMapping(value = "/description/country/{country_id}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody
public ResponseEntity<?> getDescriptionCountryByCountryID(
        @ApiParam(value = "Identificador de País") @PathVariable int country_id) {
    
    Country c = countryDAO.object("country.by.id", Country.class, country_id);
    if(c == null)
        return new ResponseEntity<>(ErrorUtils.BAD_COUNTRY_ID, HttpStatus.NOT_FOUND);
    
    c.setInstitutions(countryDAO.integer("count.institutions", country_id));
    c.setPoints(countryDAO.real("user.score", country_id));
    c.setRank(countryDAO.integer("country.rank", country_id));
    c.setUsers(countryDAO.integer("count.users", country_id));   
            
    String flag = "http://coj.uci.cu/images/countries/"+c.getZip()+".png";
    CountryDescriptionRest cdescrip = new CountryDescriptionRest(c.getName(),c.getZip_two(), c.getZip(), flag, c.getWebsite(), c.getInstitutions(), c.getUsers(), c.getPoints(), c.getRank());
    return new ResponseEntity<>(cdescrip, HttpStatus.OK);
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:23,代码来源:RestScoreboardsController.java

示例14: getRankingByCountryFromTo

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@ApiOperation(value = "Obtener tabla de posiciones por países (Paginados)",  
        notes = "Devuelve las posiciones de todos los países del COJ por páginas.",
        response = CountryRest.class,
        responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "page out of index") })
@RequestMapping(value = "/bycountry/page/{page}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody
public  ResponseEntity<?>  getRankingByCountryFromTo(
         @ApiParam(value = "Número de la página") @PathVariable int page) {
    
    int found = countryDAO.countEnabledCountries("");         
    if (page > 0 && page <= end(found)) { 
        PagingOptions options = new PagingOptions(page);            
        IPaginatedList<Country> pages = countryDAO.getEnabledCountries("", found, options);
        
        List<CountryRest> listCountryRest = new LinkedList();
        for(Country c:pages.getList()){
            CountryRest cr = new CountryRest(c.getId(),c.getRank(), c.getZip(), c.getName(),c.getInstitutions(),c.getUsers(), c.getAcc(), c.getPoints());
            listCountryRest.add(cr);
        }
        return new ResponseEntity<>(listCountryRest, HttpStatus.OK);
    }
    else
        return new ResponseEntity<>(ErrorUtils.PAGE_OUT_OF_INDEX, HttpStatus.BAD_REQUEST);
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:26,代码来源:RestScoreboardsController.java

示例15: competencias

import com.wordnik.swagger.annotations.ApiParam; //导入依赖的package包/类
@ApiOperation(value = "Obtener tabla de posiciones de los usuarios por competencias (Paginados)",  
        notes = "Devuelve las posiciones de todos los usuarios del COJ en las competencias por páginas.",
        response = UserRest.class,
        responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "page out of index") })
@RequestMapping(value = "/bycontest/page/{page}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody
public  ResponseEntity<?>  getRankingBybycontestFromTo(
         @ApiParam(value = "Número de la página") @PathVariable int page) {
    
    int found = contestDAO.countContestGeneralScoreboard("");         
    if (page > 0 && page <= end(found)) { 
        PagingOptions options = new PagingOptions(page);            
        IPaginatedList<User> pages = contestDAO.getContestGeneralScoreboard(found, "", options);
        
        List<UserRest> listUsersRest = new LinkedList();        
        for(User u:pages.getList()){
            UserRest ur = new UserRest(u.getRank(), u.getCountry(), u.getCountry_desc(), u.getUsername(), u.getStatus(),u.getTotal(), u.getAccu(),u.getPercent(),u.getPoints());
            listUsersRest.add(ur);
        }
        return new ResponseEntity<>(listUsersRest, HttpStatus.OK);
    }
    else
        return new ResponseEntity<>(ErrorUtils.PAGE_OUT_OF_INDEX, HttpStatus.BAD_REQUEST);
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:26,代码来源:RestScoreboardsController.java


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