@GetMapping("/metas/{datasourceId}") @Authorize(action = Permission.ACTION_QUERY, description = "获取元数据") @ApiOperation("获取指定数据源的元数据") public ResponseMessage<Map<ObjectMetadata.ObjectType, List<? extends ObjectMetadata>>> parseAllObject( @PathVariable @ApiParam("数据源ID") String datasourceId) throws Exception { DataSourceHolder.switcher().use(datasourceId); return ResponseMessage.ok(databaseManagerService.getMetas()); }
@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); }
@GetMapping("/envs/{env}/instances/by-namespace") public PageDTO<InstanceDTO> getByNamespace(@PathVariable String env, @RequestParam String appId, @RequestParam String clusterName, @RequestParam String namespaceName, @RequestParam(required = false) String instanceAppId, @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size) { return instanceService.getByNamespace(Env.valueOf(env), appId, clusterName, namespaceName, instanceAppId, page, size); }
@GetMapping("/bookings/{booking}") public Object getBooking(@PathVariable Long booking) { return "url"; } }
@GetMapping("/signin") public String login(@RequestParam(value = "error", required = false) String error, @RequestParam(value = "logout", required = false) String logout) { return "login.html"; }
@GetMapping("/redirect") public String redirect() { return "redirect:/"; } }
@GetMapping("/me") @Authorize @ApiOperation("当前登录用户权限信息") public ResponseMessage<Authentication> me(@ApiParam(hidden = true) Authentication authentication) { return ok(authentication); }
.addAll(Arrays.asList(((RequestMapping) methodMapping).method())); } else if (methodMapping.annotationType().equals(GetMapping.class)) { suffixPaths = ((GetMapping) methodMapping).value().length != 0 ? newArrayList( ImmutableSet.copyOf(((GetMapping) methodMapping).value())) : newArrayList( ImmutableSet.copyOf(((GetMapping) methodMapping).path()));
@Override public void process(Object annotation, OperationGenerator operationGenerator) { GetMapping mappingAnnotation = (GetMapping) annotation; Operation operation = operationGenerator.getOperation(); // path/value是等同的 this.processPath(mappingAnnotation.path(), operationGenerator); this.processPath(mappingAnnotation.value(), operationGenerator); this.processMethod(RequestMethod.GET, operationGenerator); this.processConsumes(mappingAnnotation.consumes(), operation); this.processProduces(mappingAnnotation.produces(), operation); if (StringUtils.isEmpty(operationGenerator.getHttpMethod()) && StringUtils.isEmpty(operationGenerator.getSwaggerGenerator().getHttpMethod())) { throw new Error("HttpMethod must not both be empty in class and method"); } } }
private static void mapGetRequestInfo(JSONObject optMethod, Method method){ GetMapping methodMapping = method.getAnnotation(GetMapping.class); optMethod.put("optName",method.getName()); optMethod.put("optUrl",Pretreatment.mapTemplateString( StringBaseOpt.castObjectToString(methodMapping.value()),null,"*")); //GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE optMethod.put("optReq","R"); }
@GetMapping("/{accountId}/balances") @ApiOperation(value="Read balances", notes="Returns balances of the deposit account with the given accountId. " + "User must have access to the target account. This is also accessible to other token types like tpp token (DELEGATED_ACESS)", authorizations =@Authorization(value="apiKey")) @ApiResponses(value={ @ApiResponse(code=200, response=AccountBalanceTO[].class, message="List of accounts balances for the given account.") }) ResponseEntity<List<AccountBalanceTO>> getBalances( @ApiParam(ACCOUNT_ID) @PathVariable(name="accountId") String accountId) throws NotFoundRestException, ForbiddenRestException;
@GetMapping("/envs/{env}/instances/by-release") public PageDTO<InstanceDTO> getByRelease(@PathVariable String env, @RequestParam long releaseId, @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size) { return instanceService.getByRelease(Env.valueOf(env), releaseId, page, size); }
@GetMapping("/bookings/{booking}") public String getBooking(@PathVariable Long booking) { return "url"; } }
@GetMapping("/favorites") public List<Favorite> findFavorites(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "appId", required = false) String appId, Pageable page) { return favoriteService.search(userId, appId, page); }
@GetMapping("/test") public String handle() { return "It works!"; } }
@GetMapping({"/login-out", "/sign-out", "/exit"}) @Authorize @ApiOperation("退出当前登录") public ResponseMessage exit(@ApiParam(hidden = true) Authentication authentication) { eventPublisher.publishEvent(new AuthorizationExitEvent(authentication)); return ok(); }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { GetMapping mappingAnnotation = (GetMapping) annotation; Operation operation = operationGenerator.getOperation(); // path/value是等同的 this.processPath(mappingAnnotation.path(), operationGenerator); this.processPath(mappingAnnotation.value(), operationGenerator); this.processMethod(RequestMethod.GET, operationGenerator); this.processConsumes(mappingAnnotation.consumes(), operation); this.processProduces(mappingAnnotation.produces(), operation); if (StringUtils.isEmpty(operationGenerator.getHttpMethod()) && StringUtils.isEmpty(operationGenerator.getSwaggerGenerator().getHttpMethod())) { throw new Error("HttpMethod must not both be empty in class and method"); } } }