io.swagger.annotations.ApiOperation Java Examples
The following examples show how to use
io.swagger.annotations.ApiOperation.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserResource.java From dependency-track with Apache License 2.0 | 7 votes |
/** * @since 3.9.0 */ @GET @Path("oidc") @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Returns a list of all OIDC users", response = OidcUser.class, responseContainer = "List", responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADER, response = Long.class, description = "The total number of OIDC users") ) @ApiResponses(value = { @ApiResponse(code = 401, message = "Unauthorized") }) @PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT) public Response getOidcUsers() { try (QueryManager qm = new QueryManager(getAlpineRequest())) { final long totalCount = qm.getCount(OidcUser.class); final List<OidcUser> users = qm.getOidcUsers(); return Response.ok(users).header(TOTAL_COUNT_HEADER, totalCount).build(); } }
Example #2
Source File: MyInfoAPI.java From springboot-seed with MIT License | 7 votes |
@ApiOperation(value = "修改密码") @PutMapping("/change_password") public ResponseEntity<?> changePassword( @ApiParam("旧密码") @RequestParam("oldPassword") String oldPassword, @ApiParam("新密码") @RequestParam("newPassword") String newPassword ) { OAuth2Authentication auth = (OAuth2Authentication) SecurityContextHolder.getContext().getAuthentication(); Optional<User> user = userService.selectByID(((SecurityUser) auth.getPrincipal()).getId()); BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); if (user.isPresent() && encoder.matches(oldPassword, user.get().getPassword())) { User instance = user.get(); instance.setPassword(newPassword); userService.modifyById(instance); return ResponseEntity.status(HttpStatus.OK).build(); } else { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build(); } }
Example #3
Source File: DeploymentResource.java From flowable-engine with Apache License 2.0 | 6 votes |
@ApiOperation(value = "Delete a deployment", tags = { "Deployment" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the deployment was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested deployment was not found.") }) @DeleteMapping(value = "/repository/deployments/{deploymentId}", produces = "application/json") public void deleteDeployment(@ApiParam(name = "deploymentId") @PathVariable String deploymentId, @RequestParam(value = "cascade", required = false, defaultValue = "false") Boolean cascade, HttpServletResponse response) { Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); if (deployment == null) { throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class); } if (restApiInterceptor != null) { restApiInterceptor.deleteDeployment(deployment); } if (cascade) { repositoryService.deleteDeployment(deploymentId, true); } else { repositoryService.deleteDeployment(deploymentId); } response.setStatus(HttpStatus.NO_CONTENT.value()); }
Example #4
Source File: OpcFileController.java From paascloud-master with Apache License 2.0 | 6 votes |
/** * 上传文件. * * @param request the request * @param optUploadFileReqDto the opt upload file req dto * * @return the wrapper */ @PostMapping(consumes = "multipart/form-data", value = "/uploadFile") @ApiOperation(httpMethod = "POST", value = "上传文件") public Wrapper<String> uploadFile(HttpServletRequest request, OptUploadFileReqDto optUploadFileReqDto) { StringBuilder temp = new StringBuilder(); logger.info("uploadFile - 上传文件. optUploadFileReqDto={}", optUploadFileReqDto); Preconditions.checkArgument(StringUtils.isNotEmpty(optUploadFileReqDto.getFileType()), "文件类型为空"); Preconditions.checkArgument(StringUtils.isNotEmpty(optUploadFileReqDto.getBucketName()), "存储地址为空"); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; List<OptUploadFileRespDto> optUploadFileRespDtos = optAttachmentService.uploadFile(multipartRequest, optUploadFileReqDto, getLoginAuthDto(), true); for (final OptUploadFileRespDto fileRespDto : optUploadFileRespDtos) { temp.append(fileRespDto.getAttachmentId()).append(","); } String attachmentIds = temp.toString(); if (StringUtils.isNotEmpty(attachmentIds)) { attachmentIds = StringUtils.substringBeforeLast(attachmentIds, GlobalConstant.Symbol.COMMA); } return WrapMapper.ok(attachmentIds); }
Example #5
Source File: PipelineStoreResource.java From datacollector with Apache License 2.0 | 6 votes |
@Path("/pipeline/{pipelineId}/metadata") @POST @ApiOperation(value ="", hidden = true) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed({ AuthzRole.CREATOR, AuthzRole.ADMIN, AuthzRole.CREATOR_REMOTE, AuthzRole.ADMIN_REMOTE }) @SuppressWarnings("unchecked") public Response saveMetadata( @PathParam("pipelineId") String name, @QueryParam("rev") @DefaultValue("0") String rev, Map<String, Object> metadata ) throws PipelineException { PipelineInfo pipelineInfo = store.getInfo(name); RestAPIUtils.injectPipelineInMDC(pipelineInfo.getTitle(), pipelineInfo.getPipelineId()); store.saveMetadata(user, name, rev, metadata); return Response.ok().build(); }
Example #6
Source File: DossierFileManagement.java From opencps-v2 with GNU Affero General Public License v3.0 | 6 votes |
@PUT @Path("/{id}/files/{referenceUid}/formdata") @Consumes({ MediaType.APPLICATION_FORM_URLENCODED }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @ApiOperation(value = "update DossierFile") @ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class), @ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) }) public Response updateDossierFileFormData( @Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext, @ApiParam(value = "id of dossier", required = true) @PathParam("id") long id, @ApiParam(value = "referenceUid of dossierfile", required = true) @PathParam("referenceUid") String referenceUid, @ApiParam(value = "formdata of dossierfile", required = true) @FormParam("formdata") String formdata);
Example #7
Source File: UacActionCommonController.java From paascloud-master with Apache License 2.0 | 6 votes |
/** * 检测权限编码是否已存在 * * @param uacActionCheckCodeDto the uac action check code dto * * @return the wrapper */ @PostMapping(value = "/checkActionCode") @ApiOperation(httpMethod = "POST", value = "检测权限编码是否已存在") public Wrapper<Boolean> checkActionCode(@ApiParam(name = "uacActionCheckCodeDto", value = "id与url") @RequestBody UacActionCheckCodeDto uacActionCheckCodeDto) { logger.info("校验权限编码唯一性 uacActionCheckCodeDto={}", uacActionCheckCodeDto); Long id = uacActionCheckCodeDto.getActionId(); String actionCode = uacActionCheckCodeDto.getActionCode(); Example example = new Example(UacAction.class); Example.Criteria criteria = example.createCriteria(); if (id != null) { criteria.andNotEqualTo("id", id); } criteria.andEqualTo("actionCode", actionCode); int result = uacActionService.selectCountByExample(example); return WrapMapper.ok(result < 1); }
Example #8
Source File: StockQuoteService.java From product-ei with Apache License 2.0 | 6 votes |
/** * Retrieve a stock for a given symbol. * http://localhost:9090/stockquote/IBM * * @param symbol Stock symbol will be taken from the path parameter. * @return Response */ @GET @Path("/{symbol}") @Produces({"application/json", "text/xml"}) @ApiOperation( value = "Return stock quote corresponding to the symbol", notes = "Returns HTTP 404 if the symbol is not found") @ApiResponses(value = { @ApiResponse(code = 200, message = "Valid stock item found"), @ApiResponse(code = 404, message = "Stock item not found")}) public Response getQuote(@ApiParam(value = "Symbol", required = true) @PathParam("symbol") String symbol) throws SymbolNotFoundException { Stock stock = stockQuotes.get(symbol); if (stock == null) { throw new SymbolNotFoundException("Symbol " + symbol + " not found"); } return Response.ok().entity(stock).cookie(new NewCookie("symbol", symbol)).build(); }
Example #9
Source File: DeviceRestController.java From konker-platform with Apache License 2.0 | 6 votes |
@PutMapping(path = "/{deviceGuid}/application") @ApiOperation(value = "Move device to another application") @PreAuthorize("hasAuthority('EDIT_DEVICE')") public DeviceVO move( @PathVariable("application") String applicationId, @PathVariable("deviceGuid") String deviceGuid, @ApiParam(name = "body", required = true) @RequestBody ApplicationDestinationVO applicationDestinationVO) throws BadServiceResponseException, NotFoundResponseException { Tenant tenant = user.getTenant(); Application application = getApplication(applicationId); Application destApplication = getApplication(applicationDestinationVO.getDestinationApplicationName()); ServiceResponse<Device> deviceResponse = deviceRegisterService.move(tenant, application, deviceGuid, destApplication); if (!deviceResponse.isOk()) { throw new BadServiceResponseException( deviceResponse, validationsCode); } return new DeviceVO().apply(deviceResponse.getResult()); }
Example #10
Source File: VShopServlet.java From Web-API with MIT License | 6 votes |
@GET @Path("/shop/{id}/item") @Permission({"vshop", "item", "list"}) @ApiOperation( value = "List Shop Items", notes = "Return a list of all shops items") public Collection<CachedStockItem> listShopItems(@PathParam("id") UUID id) { return WebAPI.runOnMain(() -> { Optional<NPCguard> npc = VillagerShops.getNPCfromShopUUID(id); if (!npc.isPresent()) { throw new NotFoundException("Shop with id " + id + " not found"); } InvPrep inv = npc.get().getPreparator(); int s = inv.size(); List<CachedStockItem> csi = new ArrayList<>(s); for (int i = 0; i < s; i++) csi.add(new CachedStockItem(inv.getItem(i), i, npc.get().getIdentifier())); return csi; }); }
Example #11
Source File: ReportScheduleResource.java From graylog-plugin-aggregates with GNU General Public License v3.0 | 6 votes |
@POST @Path("/{name}") @Timed @RequiresAuthentication @RequiresPermissions(ReportScheduleRestPermissions.AGGREGATE_REPORT_SCHEDULES_UPDATE) @AuditEvent(type = AuditEventTypes.AGGREGATES_REPORT_SCHEDULE_UPDATE) @ApiOperation(value = "Update a report schedule") @ApiResponses(value = { @ApiResponse(code = 400, message = "The supplied request is not valid.") }) public Response update(@ApiParam(name = "name", required = true) @PathParam("name") String name, @ApiParam(name = "JSON body", required = true) @Valid @NotNull UpdateReportScheduleRequest request ) throws UnsupportedEncodingException { final ReportSchedule reportSchedule = reportScheduleService.fromRequest(request); reportScheduleService.update(java.net.URLDecoder.decode(name, "UTF-8"), reportSchedule); return Response.accepted().build(); }
Example #12
Source File: Namespaces.java From pulsar with Apache License 2.0 | 6 votes |
@POST @Path("/{property}/{cluster}/{namespace}/clearBacklog") @ApiOperation(hidden = true, value = "Clear backlog for all topics on a namespace.") @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"), @ApiResponse(code = 404, message = "Namespace does not exist") }) public void clearNamespaceBacklog(@Suspended final AsyncResponse asyncResponse, @PathParam("property") String property, @PathParam("cluster") String cluster, @PathParam("namespace") String namespace, @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) { try { validateNamespaceName(property, cluster, namespace); internalClearNamespaceBacklog(asyncResponse, authoritative); } catch (WebApplicationException wae) { asyncResponse.resume(wae); } catch (Exception e) { asyncResponse.resume(new RestException(e)); } }
Example #13
Source File: FilesResource.java From hmdm-server with Apache License 2.0 | 6 votes |
@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(); } }
Example #14
Source File: ConfigurationResource.java From hmdm-server with Apache License 2.0 | 6 votes |
@ApiOperation( value = "Copy configuration", notes = "Creates a new copy of configuration referenced by the id and names it with provided name." ) @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("/copy") public Response copyConfiguration(Configuration configuration) { Configuration dbConfiguration = this.configurationDAO.getConfigurationByName(configuration.getName()); if (dbConfiguration != null) { return Response.DUPLICATE_ENTITY("error.duplicate.configuration"); } else { dbConfiguration = this.getConfiguration(configuration.getId()); List<Application> configurationApplications = this.configurationDAO.getPlainConfigurationApplications(configuration.getId()); Configuration copy = dbConfiguration.newCopy(); copy.setName(configuration.getName()); copy.setApplications(configurationApplications); copy.setBaseUrl(this.configurationDAO.getBaseUrl()); this.configurationDAO.insertConfiguration(copy); return Response.OK(); } }
Example #15
Source File: ScopeResource.java From graviteeio-access-management with Apache License 2.0 | 6 votes |
@DELETE @ApiOperation(value = "Delete a scope", notes = "User must have the DOMAIN_SCOPE[DELETE] permission on the specified domain " + "or DOMAIN_SCOPE[DELETE] permission on the specified environment " + "or DOMAIN_SCOPE[DELETE] permission on the specified organization") @ApiResponses({ @ApiResponse(code = 204, message = "Scope successfully deleted"), @ApiResponse(code = 500, message = "Internal server error")}) public void delete( @PathParam("organizationId") String organizationId, @PathParam("environmentId") String environmentId, @PathParam("domain") String domain, @PathParam("scope") String scope, @Suspended final AsyncResponse response) { final User authenticatedUser = getAuthenticatedUser(); checkAnyPermission(organizationId, environmentId, domain, Permission.DOMAIN_SCOPE, Acl.DELETE) .andThen(scopeService.delete(scope, false, authenticatedUser)) .subscribe(() -> response.resume(Response.noContent().build()), response::resume); }
Example #16
Source File: ThingResource.java From smarthome with Eclipse Public License 2.0 | 6 votes |
@PUT @RolesAllowed({ Role.USER, Role.ADMIN }) @Path("/{thingUID}/enable") @ApiOperation(value = "Sets the thing enabled status.") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = String.class), @ApiResponse(code = 404, message = "Thing not found.") }) public Response setEnabled(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language, @PathParam("thingUID") @ApiParam(value = "thing") String thingUID, @ApiParam(value = "enabled") String enabled) throws IOException { final Locale locale = localeService.getLocale(language); ThingUID thingUIDObject = new ThingUID(thingUID); // Check if the Thing exists, 404 if not Thing thing = thingRegistry.get(thingUIDObject); if (null == thing) { logger.info("Received HTTP PUT request for set enabled at '{}' for the unknown thing '{}'.", uriInfo.getPath(), thingUID); return getThingNotFoundResponse(thingUID); } thingManager.setEnabled(thingUIDObject, Boolean.valueOf(enabled)); // everything went well return getThingResponse(Status.OK, thing, locale, null); }
Example #17
Source File: DeviceLogPluginSettingsResource.java From hmdm-server with Apache License 2.0 | 6 votes |
@ApiOperation( value = "Create or update plugin settings rule", notes = "Creates a new plugin settings rule record (if id is not provided) or updates existing one otherwise", authorizations = {@Authorization("Bearer Token")} ) @PUT @Path("/private/rule") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response saveSettingsRule(String ruleJSON) { try { ObjectMapper mapper = new ObjectMapper(); DeviceLogRule rule = mapper.readValue(ruleJSON, this.settingsDAO.getSettingsRuleClass()); this.settingsDAO.savePluginSettingsRule(rule); notifyRuleDevices(rule); return Response.OK(); } catch (Exception e) { log.error("Failed to create or update device log plugin settings rule", e); return Response.INTERNAL_ERROR(); } }
Example #18
Source File: JobManagementResource.java From titus-control-plane with Apache License 2.0 | 6 votes |
@PUT @ApiOperation("Update attributes of a task") @Path("/tasks/{taskId}/attributes") public Response updateTaskAttributes(@PathParam("taskId") String taskId, TaskAttributesUpdate request) { TaskAttributesUpdate sanitizedRequest; if (request.getTaskId().isEmpty()) { sanitizedRequest = request.toBuilder().setTaskId(taskId).build(); } else { if (!taskId.equals(request.getTaskId())) { return Response.status(Response.Status.BAD_REQUEST).build(); } sanitizedRequest = request; } return Responses.fromCompletable(jobServiceGateway.updateTaskAttributes(sanitizedRequest, resolveCallMetadata())); }
Example #19
Source File: ClassificationFacade.java From icure-backend with GNU General Public License v2.0 | 6 votes |
@ApiOperation( value = "Create a classification with the current user", response = ClassificationDto.class, httpMethod = "POST", notes = "Returns an instance of created classification Template." ) @POST public Response createClassification(ClassificationDto c) { if (c == null) { return Response.status(400).type("text/plain").entity("A required query parameter was not specified for this request.").build(); } Classification element = classificationLogic.createClassification(mapper.map(c, Classification.class)); boolean succeed = (element != null); if (succeed) { return Response.ok().entity(mapper.map(element, ClassificationDto.class)).build(); } else { return Response.status(500).type("text/plain").entity("Classification creation failed.").build(); } }
Example #20
Source File: SmsDeptController.java From HIS with Apache License 2.0 | 5 votes |
/** * 描述:根据ids删除科室 * <p>author: ma */ @ApiOperation("根据ids删除科室") @RequestMapping(value = "/delete", method = RequestMethod.POST) @ResponseBody public CommonResult delete(@RequestParam("ids") List<Long> ids){ int count = smsDeptService.delete(ids); if(count > 0){ return CommonResult.success(count,"删除科室成功"); } return CommonResult.failed("删除科室失败"); }
Example #21
Source File: ScheduleJobController.java From hdw-dubbo with Apache License 2.0 | 5 votes |
/** * 恢复定时任务信息 */ @ApiOperation(value = "恢复定时任务信息", notes = "恢复定时任务信息") @ApiImplicitParam(paramType = "query", name = "jobIds", value = "主键ID数组", dataType = "Integer", required = true, allowMultiple = true) @PostMapping("/resume") @RequiresPermissions("sys/schedule/resume") public CommonResult resume(@RequestBody Long[] jobIds) { scheduleJobService.resume(jobIds); return CommonResult.success(""); }
Example #22
Source File: SmsCouponController.java From xmall with MIT License | 5 votes |
@ApiOperation("获取单个优惠券的详细信息") @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public Object getItem(@PathVariable Long id) { SmsCouponParam couponParam = couponService.getItem(id); return new CommonResult().success(couponParam); }
Example #23
Source File: TokenApi.java From haven-platform with Apache License 2.0 | 5 votes |
@ApiOperation("Use header name: " + AuthenticationTokenFilter.X_AUTH_TOKEN) @RequestMapping(value = "login", method = RequestMethod.POST) public UITokenData getToken(@RequestBody UiUserCredentials credentials) { Authentication authentication = new UsernamePasswordAuthenticationToken(credentials.getUsername(), credentials.getPassword()); final Authentication authenticate = authenticationProvider.authenticate(authentication); if (authenticate != null && authenticate.isAuthenticated()) { return createToken(credentials.getUsername()); } else { throw new BadCredentialsException("Invalid login and password"); } }
Example #24
Source File: SysDataSourceController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 编辑 * * @param sysDataSource * @return */ @AutoLog(value = "多数据源管理-编辑") @ApiOperation(value = "多数据源管理-编辑", notes = "多数据源管理-编辑") @PutMapping(value = "/edit") public Result<?> edit(@RequestBody SysDataSource sysDataSource) { SysDataSource d = sysDataSourceService.getById(sysDataSource.getId()); DataSourceCachePool.removeCache(d.getCode()); sysDataSourceService.updateById(sysDataSource); return Result.ok("编辑成功!"); }
Example #25
Source File: UserRest.java From mobi with GNU Affero General Public License v3.0 | 5 votes |
/** * Attempts to retrieve the username for the User associated with the passed User IRI. Returns a 404 if * a User with the passed IRI cannot be found. * * @param userIri the IRI to search for * @return a Response with the username of the User associated with the IRI */ @GET @Path("username") @RolesAllowed("user") @Produces(MediaType.TEXT_PLAIN) @ApiOperation("Retrieve a username based on the passed User IRI") public Response getUsername(@QueryParam("iri") String userIri) { try { String username = engineManager.getUsername(vf.createIRI(userIri)).orElseThrow(() -> ErrorUtils.sendError("User not found", Response.Status.NOT_FOUND)); return Response.ok(username).build(); } catch (IllegalArgumentException ex) { throw ErrorUtils.sendError(ex.getMessage(), Response.Status.BAD_REQUEST); } }
Example #26
Source File: StoreProductController.java From yshopmall with Apache License 2.0 | 5 votes |
@ApiOperation(value = "清除属性") @CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true) @PostMapping(value = "/yxStoreProduct/clearAttr/{id}") public ResponseEntity clearAttr(@PathVariable Integer id){ yxStoreProductService.clearProductAttr(id,true); return new ResponseEntity(HttpStatus.OK); }
Example #27
Source File: EmailController.java From open-cloud with MIT License | 5 votes |
@ApiOperation(value = "发送邮件", notes = "发送邮件") @ApiImplicitParams({ @ApiImplicitParam(name = "to", required = true, value = "接收人 多个用;号隔开", paramType = "form"), @ApiImplicitParam(name = "cc", required = false, value = "抄送人 多个用;号隔开", paramType = "form"), @ApiImplicitParam(name = "subject", required = true, value = "主题", paramType = "form"), @ApiImplicitParam(name = "content", required = true, value = "内容", paramType = "form"), @ApiImplicitParam(name = "attachments", required = false, value = "附件:最大不超过10M", dataType = "file", paramType = "form", allowMultiple = true), }) @PostMapping(value = "/email/test/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @Override public ResultBody send2(@RequestPart(value = "file", required = false) MultipartFile file){ return ResultBody.ok(); }
Example #28
Source File: ExpressController.java From yshopmall with Apache License 2.0 | 5 votes |
@Log("修改快递") @ApiOperation(value = "修改快递") @PutMapping(value = "/yxExpress") @PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_EDIT')") public ResponseEntity update(@Validated @RequestBody YxExpress resources){ yxExpressService.saveOrUpdate(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); }
Example #29
Source File: SwaggerConfig.java From MeetingFilm with Apache License 2.0 | 5 votes |
@Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //这里采用包含注解的方式来确定要显示的接口 //.apis(RequestHandlerSelectors.basePackage("com.stylefeng.guns.modular.system.controller")) //这里采用包扫描的方式来确定要显示的接口 .paths(PathSelectors.any()) .build(); }
Example #30
Source File: ServerConfigManagement.java From opencps-v2 with GNU Affero General Public License v3.0 | 5 votes |
@DELETE @Path("/{id}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @ApiOperation(value = "Remove a ServerConfig", response = PaymentConfigInputModel.class) @ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the ServerConfig was remove", response = PaymentConfigInputModel.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class), @ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) }) public Response removeServerConfig(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext, @PathParam("id") long id);