io.swagger.annotations.ApiParam源码实例Demo

类io.swagger.annotations.ApiParam源码实例Demo

下面列出了怎么用io.swagger.annotations.ApiParam的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: cola   文件: SignUpController.java
@RequestMapping("/signUp")
@ApiOperation(("账号密码注册"))
public Result<String> signUp(@RequestBody @Valid @ApiParam(name = "注册参数") UsernamePasswordSignUpDto usernamePasswordSignUpDto) {

	//验证确认密码是否匹配
	if (StringUtils.equals(usernamePasswordSignUpDto.getPassword(), usernamePasswordSignUpDto.getConfirmPassword())) {
		throw new ServiceException(UserErrorMessage.CONFIRM_PASSWORD_NOT_MATCHED);
	}

	UserAddDto userDto = UserAddDto.builder()
			.name(usernamePasswordSignUpDto.getName())
			.username(usernamePasswordSignUpDto.getUsername())
			.password(usernamePasswordSignUpDto.getPassword())
			.build();
	userService.add(userDto);
	return Result.success();
}
 
源代码2 项目: XS2A-Sandbox   文件: CmsPsuPiisClient.java
@GetMapping(path = "/{consent-id}")
@ApiOperation(value = "Returns PIIS Consent object by its ID.")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "OK", response = PiisConsent.class),
    @ApiResponse(code = 404, message = "Not Found")})
ResponseEntity<PiisConsent> getConsent(
    @ApiParam(name = "consent-id", value = "PIIS consent identification assigned to the created PIIS consent.", example = "bf489af6-a2cb-4b75-b71d-d66d58b934d7")
    @PathVariable("consent-id") String consentId,
    @ApiParam(value = "Client ID of the PSU in the ASPSP client interface. Might be mandated in the ASPSP's documentation. Is not contained if an OAuth2 based authentication was performed in a pre-step or an OAuth2 based SCA was performed in an preceeding PIIS service in the same session. ")
    @RequestHeader(value = "psu-id", required = false) String psuId,
    @ApiParam(value = "Type of the PSU-ID, needed in scenarios where PSUs have several PSU-IDs as access possibility. ")
    @RequestHeader(value = "psu-id-type", required = false) String psuIdType,
    @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
    @RequestHeader(value = "psu-corporate-id", required = false) String psuCorporateId,
    @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
    @RequestHeader(value = "psu-corporate-id-type", required = false) String psuCorporateIdType,
    @RequestHeader(value = "instance-id", required = false, defaultValue = DEFAULT_SERVICE_INSTANCE_ID) String instanceId);
 
源代码3 项目: XS2A-Sandbox   文件: CmsAspspPiisClient.java
@GetMapping(path = "/")
@ApiOperation(value = "Returns a list of PIIS Consent objects by PSU ID")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "OK"),
    @ApiResponse(code = 404, message = "Not Found")})
ResponseEntity<List<PiisConsent>> getConsentsForPsu(
    @ApiParam(value = "Client ID of the PSU in the ASPSP client interface. Might be mandated in the ASPSP's documentation. Is not contained if an OAuth2 based authentication was performed in a pre-step or an OAuth2 based SCA was performed in an preceeding AIS service in the same session. ")
    @RequestHeader(value = "psu-id", required = false) String psuId,
    @ApiParam(value = "Type of the PSU-ID, needed in scenarios where PSUs have several PSU-IDs as access possibility. ")
    @RequestHeader(value = "psu-id-type", required = false) String psuIdType,
    @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
    @RequestHeader(value = "psu-corporate-id", required = false) String psuCorporateId,
    @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
    @RequestHeader(value = "psu-corporate-id-type", required = false) String psuCorporateIdType,
    @ApiParam(value = "ID of the particular service instance")
    @RequestHeader(value = "instance-id", required = false, defaultValue = DEFAULT_SERVICE_INSTANCE_ID) String instanceId);
 
源代码4 项目: singleton   文件: FormattingNumberAPI.java
/**
 * Get localized number by specific locale and scale
 *
 * @param locale
 *            A string specified by the product to represent a specific
 *            locale, in [language]_[country (region)] format. e.g. ja_JP,
 *            zh_CN.
 * @param number
 *            The digits.
 * @param scale
 *            Digital precision, decimal digits
 * @return APIResponseDTO The object which represents response status.
 */
@ApiOperation(value = APIOperation.FORMAT_NUMBER_GET_VALUE, notes = APIOperation.FORMAT_NUMBER_GET_NOTES)
@RequestMapping(value = APIV2.LOCALIZED_NUMBER, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO formatDate(
		@ApiParam(name = APIParamName.LOCALE, required = true, value = APIParamValue.LOCALE) @RequestParam(value = APIParamName.LOCALE, required = true) String locale,
		@ApiParam(name = APIParamName.NUMBER, required = true, value = APIParamValue.NUMBER) @RequestParam(value = APIParamName.NUMBER, required = true) String number,
		@ApiParam(name = APIParamName.SCALE, required = false, value = APIParamValue.SCALE) @RequestParam(value = APIParamName.SCALE, required = false) Integer scale,
		HttpServletRequest request) {
	int s = scale == null ? 0 : scale.intValue();
	String localeNumber = numberFormatService.formatNumber(locale, number,
			s);
	NumberDTO numberDTO = new NumberDTO();
	numberDTO.setFormattedNumber(localeNumber);
	numberDTO.setLocale(locale);
	numberDTO.setScale(new Integer(s).toString());
	numberDTO.setNumber(number);
	return super.handleResponse(APIResponseStatus.OK, numberDTO);
}
 
源代码5 项目: hyena   文件: PointController.java
@ApiOperation(value = "获取时间段内总共增加的积分数量")
@GetMapping(value = "/getIncreasedPoint")
public ObjectResponse<BigDecimal> getIncreasedPoint(
        HttpServletRequest request,
        @ApiParam(value = "积分类型", example = "score") @RequestParam(defaultValue = "default") String type,
        @ApiParam(value = "用户ID") @RequestParam(required = false) String uid,
        @ApiParam(value = "开始时间", example = "2019-03-25 18:35:21") @RequestParam(required = false, value = "start") String strStart,
        @ApiParam(value = "结束时间", example = "2019-04-26 20:15:31") @RequestParam(required = false, value = "end") String strEnd) {
    logger.info(LoggerHelper.formatEnterLog(request));
    try {
        Calendar calStart = DateUtils.fromYyyyMmDdHhMmSs(strStart);
        Calendar calEnd = DateUtils.fromYyyyMmDdHhMmSs(strEnd);
        var ret = this.pointRecDs.getIncreasedPoint(type, uid, calStart.getTime(), calEnd.getTime());

        ObjectResponse<BigDecimal> res = new ObjectResponse<>(ret);
        logger.info(LoggerHelper.formatLeaveLog(request) + " ret = {}", ret);
        return res;
    } catch (ParseException e) {
        logger.warn(e.getMessage(), e);
        throw new HyenaParameterException("参数错误, 时间格式无法解析");
    }
}
 
源代码6 项目: flair-engine   文件: ConnectionResource.java
/**
 * GET  /connections : get all the connections.
 *
 * @param pageable the pagination information
 * @return the ResponseEntity with status 200 (OK) and the list of connections in body
 */
@GetMapping("/connectionsIdAndName")
@Timed
public ResponseEntity<List<ConnectionDTO>> getAllConnectionsByIdAndNames(@ApiParam Pageable pageable) {
    log.debug("REST request to get a page of Connections filter the id and names only");
    Page<ConnectionDTO> page = connectionService.findAll(pageable);

    List<ConnectionDTO> filteredList = new ArrayList<>();

    for (ConnectionDTO c : page.getContent()) {
        ConnectionDTO dto = new ConnectionDTO();
        dto.setId(c.getId());
        dto.setName(c.getName());

        filteredList.add(dto);
    }


    HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/connectionsIdAndName");
    return new ResponseEntity<>(filteredList, headers, HttpStatus.OK);
}
 
源代码7 项目: sophia_scaffolding   文件: RoleController.java
@SysLog("分配角色权限")
@PostMapping("/web/permission/save/{id}")
@ApiOperation("分配该角色选择的权限-后端管理角色管理")
public ApiResponse savePermissionAndRole(@ApiParam("角色id") @PathVariable String id, @RequestBody String ids){
    if (StringUtils.isBlank(id)) {
        return fail("角色id不能为空");
    }
    if (StringUtils.isBlank(ids)) {
        return fail("参数不能为空");
    }
    List<String> idList = JSON.parseArray(((JSONArray) JSON.parseObject(ids).get("ids")).toJSONString(), String.class);
    if (permissionService.savePermissionAndRole(id,idList)){
        return success("分配成功");
    }else {
        return fail("分配失败");
    }
}
 
/**
 * Create source with post data, especially it's used for creating long
 * source
 * 
 */
@ApiOperation(value = APIOperation.SOURCE_TRANSLATION_POST_VALUE, notes = APIOperation.SOURCE_TRANSLATION_POST_NOTES)
@RequestMapping(value = APIV1.KEY2_POST, method = RequestMethod.POST, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getTranslationByPost(
		@PathVariable(APIParamName.PRODUCT_NAME) String productName,
		@ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @RequestParam(value = APIParamName.VERSION, required = true) String version,
		@PathVariable(APIParamName.COMPONENT) String component,
		@PathVariable(APIParamName.KEY) String key,
		@ApiParam(value = APIParamValue.SOURCE, required = false) String source,
		@ApiParam(name = APIParamName.COMMENT_SOURCE, value = APIParamValue.COMMENT_SOURCE) @RequestParam(value = APIParamName.COMMENT_SOURCE, required = false) String commentForSource,
		@ApiParam(name = APIParamName.LOCALE, value = APIParamValue.LOCALE) @RequestParam(value = APIParamName.LOCALE, required = false) String locale,
		@ApiParam(name = APIParamName.SOURCE_FORMAT, value = APIParamValue.SOURCE_FORMAT) @RequestParam(value = APIParamName.SOURCE_FORMAT, required = false) String sourceFormat,
		@ApiParam(name = APIParamName.COLLECT_SOURCE, value = APIParamValue.COLLECT_SOURCE) @RequestParam(value = APIParamName.COLLECT_SOURCE, required = false, defaultValue = "false") String collectSource,
		@ApiParam(name = APIParamName.PSEUDO, value = APIParamValue.PSEUDO) @RequestParam(value = APIParamName.PSEUDO, required = false, defaultValue = "false") String pseudo,
		HttpServletRequest request, HttpServletResponse response)
		throws L3APIException, IOException {
	return super.getTransByPost(productName, version, locale, component, key, source, commentForSource, sourceFormat, collectSource, pseudo, "false", "false", request, response);
}
 
源代码9 项目: mogu_blog_v2   文件: AdminRestApi.java
@AuthorityVerify
@OperationLogger(value = "重置用户密码")
@ApiOperation(value = "重置用户密码", notes = "重置用户密码")
@PostMapping("/restPwd")
public String restPwd(HttpServletRequest request,
                      @ApiParam(name = "uid", value = "管理员uid", required = true) @RequestParam(name = "uid", required = false) String uid) {

    if (StringUtils.isEmpty(uid)) {
        return ResultUtil.result(SysConf.ERROR, MessageConf.PARAM_INCORRECT);
    }

    Admin admin = adminService.getById(uid);
    PasswordEncoder encoder = new BCryptPasswordEncoder();
    admin.setPassWord(encoder.encode(DEFAULE_PWD));
    admin.setUpdateTime(new Date());
    admin.updateById();

    return ResultUtil.result(SysConf.SUCCESS, MessageConf.UPDATE_SUCCESS);
}
 
源代码10 项目: singleton   文件: FormattingDateAPI.java
/**
    * Get localized date by specific locale and pattern
    *
    * @param locale
    *        A string specified by the product to represent a specific locale, in [language]_[country (region)] format. e.g. ja_JP, zh_CN.
    * @param longDate
    *        The time stamp of java format. e.g. 1472728030290.
    * @param pattern
    *        The pattern specified by the product. e.g. [YEAR = "y",QUARTER = "QQQQ"], ABBR_QUARTER =
 *        "QQQ",YEAR_QUARTER = "yQQQQ",YEAR_ABBR_QUARTER = "yQQQ" and so on. 
    * @param request
    *        Extends the ServletRequest interface to provide request information for HTTP servlets.
    * @return APIResponseDTO 
    *         The object which represents response status.
    */
   @ApiOperation(value = APIOperation.FORMAT_DATE_GET_VALUE, notes = APIOperation.FORMAT_DATE_GET_NOTES)
/*   @ApiImplicitParams({
       @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "string", paramType = "header"),  
       @ApiImplicitParam(name = "sessionid", value = "sessionid", required = true, dataType = "string", paramType = "header")
   })*/
   @RequestMapping(value = APIV2.LOCALIZED_DATE, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
   public APIResponseDTO formatDate(
           @ApiParam(name = APIParamName.LOCALE, required = true, value = APIParamValue.LOCALE) @RequestParam(value = APIParamName.LOCALE, required = true) String locale,
           @ApiParam(name = APIParamName.LONGDATE, required = true, value = APIParamValue.LONGDATE) @RequestParam(value = APIParamName.LONGDATE, required = true) String longDate,
           @ApiParam(name = APIParamName.PATTERN, required = true, value = APIParamValue.PATTERN) @RequestParam(value = APIParamName.PATTERN, required = true) String pattern,
           HttpServletRequest request) throws Exception{
       DateDTO dateDTO = new DateDTO();
       String formattedDate = dateFormatService.formatDate(locale, Long.parseLong(longDate),
               pattern);
       dateDTO.setLongDate(longDate);
       dateDTO.setformattedDate(formattedDate);
       dateDTO.setLocale(locale);
       dateDTO.setPattern(pattern);
       return super.handleResponse(APIResponseStatus.OK, dateDTO);
   }
 
源代码11 项目: mogu_blog_v2   文件: AdminRestApi.java
@AuthorityVerify
@OperationLogger(value = "强退用户")
@ApiOperation(value = "强退用户", notes = "强退用户", response = String.class)
@PostMapping(value = "/forceLogout")
public String forceLogout(@ApiParam(name = "tokenList", value = "tokenList", required = false) @RequestBody List<String> tokenList) {
    if(tokenList == null || tokenList.size() == 0) {
        return ResultUtil.result(SysConf.ERROR, MessageConf.PARAM_INCORRECT);
    }
    List<String> keyList = new ArrayList<>();
    String keyPrefix = RedisConf.LOGIN_TOKEN_KEY + RedisConf.SEGMENTATION;
    for (String token : tokenList) {
        keyList.add(keyPrefix + token);
    }
    redisUtil.delete(keyList);
    return ResultUtil.result(SysConf.SUCCESS, MessageConf.OPERATION_SUCCESS);
}
 
/**
 * get translation by string
 *
 */
@ApiOperation(value = APIOperation.KEY_TRANSLATION_GET_VALUE, notes = APIOperation.KEY_TRANSLATION_GET_NOTES)
@RequestMapping(value = APIV1.KEY2_GET, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getTranslationByGet(
		@ApiParam(name = APIParamName.PRODUCT_NAME, required = true, value = APIParamValue.PRODUCT_NAME) @PathVariable(APIParamName.PRODUCT_NAME) String productName,
		@ApiParam(name = APIParamName.COMPONENT, required = true, value = APIParamValue.COMPONENT) @PathVariable(APIParamName.COMPONENT) String component,
		@ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @RequestParam(value = APIParamName.VERSION, required = true) String version,
		@ApiParam(name = APIParamName.KEY, required = true, value = APIParamValue.KEY) @PathVariable(APIParamName.KEY) String key,
		@ApiParam(name = APIParamName.SOURCE, required = false, value = APIParamValue.SOURCE) @RequestParam(value = APIParamName.SOURCE, required = false) String source,
		@ApiParam(name = APIParamName.COMMENT_SOURCE, value = APIParamValue.COMMENT_SOURCE) @RequestParam(value = APIParamName.COMMENT_SOURCE, required = false) String commentForSource,
		@ApiParam(name = APIParamName.LOCALE, value = APIParamValue.LOCALE) @RequestParam(value = APIParamName.LOCALE, required = false) String locale,
		@ApiParam(name = APIParamName.SOURCE_FORMAT, value = APIParamValue.SOURCE_FORMAT) @RequestParam(value = APIParamName.SOURCE_FORMAT, required = false) String sourceFormat,
		@ApiParam(name = APIParamName.COLLECT_SOURCE, value = APIParamValue.COLLECT_SOURCE) @RequestParam(value = APIParamName.COLLECT_SOURCE, required = false, defaultValue = "false") String collectSource,
		@ApiParam(name = APIParamName.PSEUDO, value = APIParamValue.PSEUDO) @RequestParam(value = APIParamName.PSEUDO, required = false, defaultValue = "false") String pseudo,
		HttpServletRequest request) throws L3APIException {
	return super.getTransByGet(productName, version, locale, component,
			key, source, commentForSource, sourceFormat, collectSource,
			pseudo, request);
}
 
源代码13 项目: identity-api-server   文件: ClaimManagementApi.java
@GET


@Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "Retrieve claim dialects.", notes = "Retrieve claim dialects.", response = ClaimDialectResDTO.class, responseContainer = "List")
@io.swagger.annotations.ApiResponses(value = { 
    @io.swagger.annotations.ApiResponse(code = 200, message = "Claim dialects."),
    
    @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized."),
    
    @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error."),
    
    @io.swagger.annotations.ApiResponse(code = 501, message = "Not Implemented.") })

public Response getClaimDialects(@ApiParam(value = "maximum number of records to return") @QueryParam("limit")  Integer limit,
@ApiParam(value = "number of records to skip for pagination") @QueryParam("offset")  Integer offset,
@ApiParam(value = "Condition to filter the retrival of records.") @QueryParam("filter")  String filter,
@ApiParam(value = "Define the order how the retrieved records should be sorted.") @QueryParam("sort")  String sort)
{
return delegate.getClaimDialects(limit,offset,filter,sort);
}
 
源代码14 项目: sophia_scaffolding   文件: RoleController.java
@SysLog("删除角色")
@DeleteMapping(value = "/web/del/{id}")
@ApiOperation(value = "删除角色管理-后端管理角色管理", notes = "删除角色管理-后端管理角色管理")
public ApiResponse deleteRole(@ApiParam(value = "角色id",required = true)@PathVariable String id){
    if(StringUtils.isBlank(id)){
        return fail("id不能为空");
    }
    Map<String, Object> map = roleService.deleteRole(id);
    boolean flag = (boolean) map.get("flag");
    String msg = (String) map.get("msg");
    if (flag){
        return success(msg);
    }else {
        return fail(msg);
    }
}
 
源代码15 项目: identity-api-server   文件: ChallengesApi.java
@DELETE
@Path("/{challenge-set-id}/questions/{question-id}")


@io.swagger.annotations.ApiOperation(value = "Remove a challenge question in a set.", notes = "Removes a specific question from an existing challenge question set. By specifying the locale query parameter, locale specific challenge question entry for the question can be deleted.\n\n  <b>Permission required:</b>\n    * /permission/admin/manage/identity/challenge/delete\n", response = void.class)
@io.swagger.annotations.ApiResponses(value = { 
    @io.swagger.annotations.ApiResponse(code = 204, message = "No Content."),
    
    @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"),
    
    @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"),
    
    @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") })

public Response deleteChallengeQuestion(@ApiParam(value = "Challenge Question ID",required=true ) @PathParam("question-id")  String questionId,
@ApiParam(value = "Challenge Question set ID",required=true ) @PathParam("challenge-set-id")  String challengeSetId,
@ApiParam(value = "An optional search string to look-up challenge-questions based on locale.\n") @QueryParam("locale")  String locale)
{
return delegate.deleteChallengeQuestion(questionId,challengeSetId,locale);
}
 
源代码16 项目: singleton   文件: TranslationComponentAPI.java
/**
 * Get translation based on single component.
 *
 */
//@ApiIgnore
@ApiOperation(value = APIOperation.COMPONENT_TRANSLATION_VALUE, notes = APIOperation.COMPONENT_TRANSLATION_NOTES)
@RequestMapping(value = APIV1.TRANS_COMPONENT, method = RequestMethod.GET, produces = {
        API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getSingleComponentTranslation(
        @ApiParam(name = APIParamName.PRODUCT_NAME, required = true, value = APIParamValue.PRODUCT_NAME) @RequestParam(value = APIParamName.PRODUCT_NAME, required = true) String productName,
        @ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @RequestParam(value = APIParamName.VERSION, required = true) String version,
        @ApiParam(name = APIParamName.COMPONENT, required = true, value = APIParamValue.COMPONENT) @RequestParam(value = APIParamName.COMPONENT, required = true) String component,
        @ApiParam(name = APIParamName.LOCALE, value = APIParamValue.LOCALE) @RequestParam(value = APIParamName.LOCALE, required = false) String locale,
        @ApiParam(name = APIParamName.PSEUDO, value = APIParamValue.PSEUDO)
        @RequestParam(value = APIParamName.PSEUDO, required=false, defaultValue="false") String pseudo,
        HttpServletRequest request)  throws Exception {
    ComponentMessagesDTO componentMessagesDTO = new ComponentMessagesDTO();
    componentMessagesDTO.setProductName(productName);
    componentMessagesDTO.setComponent(component == null ? ConstantsKeys.DEFAULT : component);
    componentMessagesDTO.setVersion(version);
    componentMessagesDTO.setLocale(locale == null ? ConstantsUnicode.EN : locale);
    componentMessagesDTO.setPseudo(new Boolean(pseudo));
    ComponentMessagesDTO dto = singleComponentService
            .getComponentTranslation(componentMessagesDTO);
    return super.handleResponse(APIResponseStatus.OK, dto);
}
 
源代码17 项目: identity-api-server   文件: ChallengesApi.java
@PATCH
@Path("/{challenge-set-id}")
@Consumes({ "application/json" })

@io.swagger.annotations.ApiOperation(value = "Add a challenge question to a set", notes = "Add new challenge question to an existing set.\n\n  <b>Permission required:</b>\n    * /permission/admin/manage/identity/challenge/update\n", response = void.class)
@io.swagger.annotations.ApiResponses(value = { 
    @io.swagger.annotations.ApiResponse(code = 200, message = "OK"),
    
    @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"),
    
    @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"),
    
    @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"),
    
    @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") })

public Response addChallengeQuestionToASet(@ApiParam(value = "Challenge Question set ID",required=true ) @PathParam("challenge-set-id")  String challengeSetId,
@ApiParam(value = "A challenge question to add."  ) ChallengeQuestionPatchDTO challengeQuestion)
{
return delegate.addChallengeQuestionToASet(challengeSetId,challengeQuestion);
}
 
/**
 * Provide translation based on String
 *
 */
@ApiIgnore
@ApiOperation(value = APIOperation.KEY_TRANSLATION_GET_VALUE, notes = APIOperation.KEY_TRANSLATION_GET_NOTES)
@RequestMapping(value = APIV2.KEY_TRANSLATION_GET, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getTranslationByGet(
		@ApiParam(name = APIParamName.PRODUCT_NAME, required = true, value = APIParamValue.PRODUCT_NAME) @PathVariable(APIParamName.PRODUCT_NAME) String productName,
		@ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @PathVariable(value = APIParamName.VERSION) String version,
		@ApiParam(name = APIParamName.LOCALE, required = true, value = APIParamValue.LOCALE) @PathVariable(value = APIParamName.LOCALE) String locale,
		@ApiParam(name = APIParamName.COMPONENT, required = true, value = APIParamValue.COMPONENT) @PathVariable(APIParamName.COMPONENT) String component,
		@ApiParam(name = APIParamName.KEY, required = true, value = APIParamValue.KEY) @PathVariable(APIParamName.KEY) String key,
		@ApiParam(name = APIParamName.SOURCE, required = true, value = APIParamValue.SOURCE) @RequestParam(value = APIParamName.SOURCE , required = true) String source,
		@ApiParam(name = APIParamName.COMMENT_SOURCE, value = APIParamValue.COMMENT_SOURCE) @RequestParam(value = APIParamName.COMMENT_SOURCE, required = false) String commentForSource,
		@ApiParam(name = APIParamName.SOURCE_FORMAT, value = APIParamValue.SOURCE_FORMAT) @RequestParam(value = APIParamName.SOURCE_FORMAT, required = false) String sourceFormat,
		@ApiParam(name = APIParamName.COLLECT_SOURCE, value = APIParamValue.COLLECT_SOURCE) @RequestParam(value = APIParamName.COLLECT_SOURCE, required = false, defaultValue = "false") String collectSource,
		@ApiParam(name = APIParamName.PSEUDO, value = APIParamValue.PSEUDO) @RequestParam(value = APIParamName.PSEUDO, required = false, defaultValue = "false") String pseudo,
		HttpServletRequest request) throws L3APIException {
	
	return super.getTransByGet(productName, version, locale, component, key, source, commentForSource, sourceFormat, collectSource, pseudo, request);
}
 
源代码19 项目: singleton   文件: LocaleAPI.java
/**
 * Get the supported language list from CLDR by display language
 *
 * @param productName
 *            product name
 * @param version
 *            product translation version
 * @param displayLanguage
 *            to be displayed language
 * @return APIResponseDTO
 * @throws Exception
 */
@ApiOperation(value = APIOperation.LOCALE_SUPPORTED_LANGUAGE_LIST_VALUE, notes = APIOperation.LOCALE_SUPPORTED_LANGUAGE_LIST_NOTES)
@RequestMapping(value = APIV2.SUPPORTED_LANGUAGE_LIST, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getDisplayLanguagesList(
		@ApiParam(name = APIParamName.PRODUCT_NAME, required = true, value = APIParamValue.PRODUCT_NAME) @RequestParam(value = APIParamName.PRODUCT_NAME, required = true) String productName,
		@ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @RequestParam(value = APIParamName.VERSION, required = true) String version,
		@ApiParam(name = APIParamName.DISPLAY_LANGUAGE, required = false, value = APIParamValue.DISPLAY_LANGUAGE) @RequestParam(value = APIParamName.DISPLAY_LANGUAGE, required = false) String displayLanguage)
		throws Exception {
	Map<String, Object> data = new HashMap<String, Object>();
	String newVersion = super.getAvailableVersion(productName, version);
	data.put(ConstantsKeys.LANGUAGES, this.localeService.getDisplayNamesFromCLDR(productName, newVersion, displayLanguage));
	data.put(ConstantsKeys.VERSION, newVersion);
	data.put(ConstantsKeys.PRODUCTNAME, productName);
	data.put(ConstantsKeys.DISPLAY_LANGUAGE, StringUtils.isEmpty(displayLanguage) ? "" : displayLanguage);
	return super.handleVersionFallbackResponse(version, newVersion, data);
}
 
源代码20 项目: hmdm-server   文件: FilesResource.java
@ApiOperation(
        value = "Get applications",
        notes = "Gets the list of applications using the file",
        response = Application.class,
        responseContainer = "List"
)
@GET
@Path("/apps/{url}")
@Produces(MediaType.APPLICATION_JSON)
public Response getApplicationsForFile(@PathParam("url") @ApiParam("An URL referencing the file") String url) {
    try {
        String decodedUrl = URLDecoder.decode(url, "UTF-8");
        return Response.OK(this.applicationDAO.getAllApplicationsByUrl(decodedUrl));
    } catch (Exception e) {
        logger.error("Unexpected error when getting the list of applications by URL", e);
        return Response.INTERNAL_ERROR();
    }
}
 
源代码21 项目: AthenaServing   文件: ServiceConfigController.java
/**
 * 查询配置详情
 *
 * @param id
 * @return
 */
@RequestMapping(value = "/detail", method = RequestMethod.GET)
@ApiOperation(value = "查询配置详情", notes = "查询配置详情")
public Response<ServiceConfigDetailResponseBody> find(@ApiParam("配置id") @RequestParam("id") String id) {
	if (StringUtils.isEmpty(id)) {
		return new Response<>(SystemErrCode.ERRCODE_INVALID_PARAMETER, SystemErrCode.ERRMSG_ID_NOT_NULL);
	}
	return this.serviceConfigImpl.find(id);
}
 
源代码22 项目: data-highway   文件: RoadController.java
@ApiOperation(value = "Returns the details of a road")
@ApiResponses({
    @ApiResponse(code = 200, message = "Details of a road returned successfully.", response = StandardResponse.class),
    @ApiResponse(code = 400, message = "Invalid request or road name.", response = StandardResponse.class),
    @ApiResponse(code = 404, message = "Road not found.", response = StandardResponse.class) })
@GetMapping("/{name}")
public RoadModel getRoad(@ApiParam(name = "name", value = "road name", required = true) @PathVariable String name)
  throws UnknownRoadException {
  return service.getRoad(name);
}
 
源代码23 项目: data-highway   文件: RoadController.java
@ApiOperation(value = "Applies JSON Patch modifications to a road")
@ApiResponses({
    @ApiResponse(code = 200, message = "Patch applied successfully", response = StandardResponse.class),
    @ApiResponse(code = 400, message = "Invalid patch", response = StandardResponse.class) })
@PreAuthorize("@paverAuthorisation.isAuthorised(authentication)")
@RequestMapping(value = "/{name}", method = {
    RequestMethod.PATCH,
    RequestMethod.PUT }, consumes = "application/json-patch+json")
public StandardResponse patchRoad(
    @ApiParam(name = "name", value = "road name", required = true) @PathVariable String name,
    @RequestBody List<PatchOperation> patchSet)
  throws UnknownRoadException {
  service.applyPatch(name, patchSet);
  return StandardResponse.successResponse("Patch applied");
}
 
源代码24 项目: data-highway   文件: RoadController.java
@ApiOperation(value = "Deletes a road")
@ApiResponses({
    @ApiResponse(code = 200, message = "Delete a road returned successfully.", response = StandardResponse.class),
    @ApiResponse(code = 400, message = "Invalid request or road name.", response = StandardResponse.class),
    @ApiResponse(code = 404, message = "Road not found.", response = StandardResponse.class) })
@PreAuthorize("@paverAuthorisation.isAuthorised(authentication)")
@DeleteMapping("/{name}")
public StandardResponse delete(@ApiParam(name = "name", value = "road name", required = true) @PathVariable String name)
  throws UnknownRoadException {
  service.deleteRoad(name);
  return StandardResponse
      .successResponse(String.format("Request to delete Road for \"%s\" received.", name));
}
 
源代码25 项目: data-highway   文件: SchemaController.java
@ApiOperation(value = "Adds a new schema to a road")
@ApiResponses({
    @ApiResponse(code = 200, message = "Request to add a new schema received.", response = StandardResponse.class),
    @ApiResponse(code = 404, message = "Road not found.", response = StandardResponse.class),
    @ApiResponse(code = 409, message = "Schema is not compatible with previous schemas.", response = StandardResponse.class) })
@PreAuthorize("@paverAuthorisation.isAuthorised(authentication)")
@PostMapping
public StandardResponse addNewSchema(
    @ApiParam(name = "name", value = "road name", required = true) @PathVariable String name,
    @RequestBody Schema schema)
  throws UnknownRoadException, InvalidKeyPathException {
  service.addSchema(name, schema);
  return StandardResponse.successResponse("Request to add a new schema received.");
}
 
源代码26 项目: sophia_scaffolding   文件: DeptController.java
@GetMapping(value = "/web/info/{id}")
@ApiOperation(value = "获取部门")
public ApiResponse getDept(@ApiParam(value = "部门id",required = true)@PathVariable String id){
    if(StringUtils.isBlank(id)){
        return fail("id不能为空");
    }
    DeptVo deptVo = deptService.queryDeptById(id);
    if (null == deptVo){
        return fail("未查找到该部门");
    }else{
        return success(deptVo);
    }
}
 
源代码27 项目: singleton   文件: TranslationProductComponentAPI.java
/**
 * Get translation based on multiple component.
 *
 */
@ApiOperation(value = APIOperation.MULT_COMPONENT_TRANSLATION_NOTES, notes = APIOperation.MULT_COMPONENT_TRANSLATION_NOTES)
@RequestMapping(value = APIV1.COMPONENTS2, method = RequestMethod.GET, produces = { API.API_CHARSET })
@ResponseStatus(HttpStatus.OK)
public APIResponseDTO getMultipleComponentsTrans(
        @ApiParam(name = APIParamName.PRODUCT_NAME, required = true, value = APIParamValue.PRODUCT_NAME) @PathVariable(APIParamName.PRODUCT_NAME) String productName,
        @ApiParam(name = APIParamName.COMPONENTS, required = true, value = APIParamValue.COMPONENTS) @PathVariable(APIParamName.COMPONENTS) String components,
        @ApiParam(name = APIParamName.VERSION, required = true, value = APIParamValue.VERSION) @RequestParam(value = APIParamName.VERSION, required = true) String version,
        @ApiParam(name = APIParamName.LOCALES, required = true, value = APIParamValue.LOCALES, defaultValue="") @RequestParam(value = APIParamName.LOCALES, required = true) String locales,
        @ApiParam(name = APIParamName.PSEUDO, value = APIParamValue.PSEUDO)
        @RequestParam(value = APIParamName.PSEUDO, required=false, defaultValue="false") String pseudo,
        HttpServletRequest req)  throws Exception {
		return super.getMultipleComponentsTrans(productName, components, version, locales, pseudo, req);
}
 
源代码28 项目: swagger-more   文件: ApiMethodInfo.java
private void readApiMethod() {
    ApiMethod apiMethod = findAnnotation(ApiMethod.class);
    if (nonNull(apiMethod)) {
        hidden |= apiMethod.hidden();
        if (!StringUtils.isEmpty(apiMethod.value())) {
            value = apiMethod.value();
        }
        noteBuilder.append(apiMethod.notes()).append("\n");
        if (!StringUtils.isEmpty(apiMethod.returnDescription())) {
            returnDescription = apiMethod.returnDescription();
        }
        if (apiMethod.params().length != parameterCount()) {
            DocLogger.warn("The number of @ApiParams for method [" +
                    method.getDeclaringClass().getName() + "." + method.getName() +
                    "(" + parameterNames() + ")] in @ApiMethod is incorrect");
        }
        ApiParam param;
        for (int i = 0; i < parameterCount(); i++) {
            param = apiMethod.params()[i];
            if (!StringUtils.isEmpty(param.name())) {
                paramInfos.get(i).setName(param.name());
            }
            if (!StringUtils.isEmpty(param.value())) {
                paramInfos.get(i).setValue(param.value());
            }
        }
    }
}
 
源代码29 项目: XS2A-Sandbox   文件: CmsAspspPiisClient.java
@PostMapping
@ApiOperation(value = "Creates new PIIS consent")
@ApiResponses(value = {
    @ApiResponse(code = 201, message = "Created", response = String.class),
    @ApiResponse(code = 400, message = "Bad Request")})
ResponseEntity<CreatePiisConsentResponse> createConsent(@RequestBody CreatePiisConsentRequest request,
                                                               @ApiParam(value = "Client ID of the PSU in the ASPSP client interface. Might be mandated in the ASPSP's documentation. Is not contained if an OAuth2 based authentication was performed in a pre-step or an OAuth2 based SCA was performed in an preceding AIS service in the same session. ")
                                                               @RequestHeader(value = "psu-id", required = false) String psuId,
                                                               @ApiParam(value = "Type of the PSU-ID, needed in scenarios where PSUs have several PSU-IDs as access possibility. ")
                                                               @RequestHeader(value = "psu-id-type", required = false) String psuIdType,
                                                               @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
                                                               @RequestHeader(value = "psu-corporate-id", required = false) String psuCorporateId,
                                                               @ApiParam(value = "Might be mandated in the ASPSP's documentation. Only used in a corporate context. ")
                                                               @RequestHeader(value = "psu-corporate-id-type", required = false) String psuCorporateIdType);
 
源代码30 项目: XS2A-Sandbox   文件: CmsAspspPiisClient.java
@DeleteMapping(path = "/{consent-id}")
@ApiOperation(value = "Terminates PIIS Consent object by its ID")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "OK", response = Boolean.class),
    @ApiResponse(code = 404, message = "Not Found")})
ResponseEntity<Boolean> terminateConsent(
    @ApiParam(name = "consent-id", value = "The account consent identification assigned to the created account consent.", example = "bf489af6-a2cb-4b75-b71d-d66d58b934d7")
    @PathVariable("consent-id") String consentId,
    @ApiParam(value = "ID of the particular service instance")
    @RequestHeader(value = "instance-id", required = false, defaultValue = DEFAULT_SERVICE_INSTANCE_ID) String instanceId);