/** * This interface is for /introspect API stub */ @Headers("Content-Type: application/x-www-form-urlencoded") public interface IntrospectionServiceStub { @RequestLine("POST /") Response introspectToken(@Param("token") String token); @RequestLine("POST /") Response introspectToken(@Param("token") String token, @Param("token_type_hint") String tokenTypeHint); }
@Override protected void processAnnotationOnClass(MethodMetadata data, Class<?> targetType) { if (targetType.isAnnotationPresent(Headers.class)) { String[] headersOnType = targetType.getAnnotation(Headers.class).value(); checkState(headersOnType.length > 0, "Headers annotation was empty on type %s.", targetType.getName()); Map<String, Collection<String>> headers = toMap(headersOnType); headers.putAll(data.template().headers()); data.template().headers(null); // to clear data.template().headers(headers); } }
/** * This interface is for /introspect API stub */ @Headers("Content-Type: application/x-www-form-urlencoded") public interface IntrospectionServiceStub { @RequestLine("POST /") Response introspectToken(@Param("token") String token); @RequestLine("POST /") Response introspectToken(@Param("token") String token, @Param("token_type_hint") String tokenTypeHint); }
/** * This interface is for /userinfo API stub */ @Headers("Content-Type: application/x-www-form-urlencoded") public interface UserInfoServiceStub { @Headers("X-Auth-Token: {access_token}") @RequestLine("GET /") Response getUserInfo(@Param("access_token") String accessToken); }
@Headers("Content-Type: application/json") interface CloudIdentity { @RequestLine("POST /tokens") @Body("%7B\"auth\":%7B\"RAX-KSKEY:apiKeyCredentials\":%7B\"username\":\"{username}\",\"apiKey\":\"{apiKey}\"%7D%7D%7D") TokenIdAndPublicURL apiKeyAuth(URI endpoint, @Param("username") String username, @Param("apiKey") String apiKey); @RequestLine("POST /tokens") @Body("%7B\"auth\":%7B\"passwordCredentials\":%7B\"username\":\"{username}\",\"password\":\"{password}\"%7D%7D%7D") TokenIdAndPublicURL passwordAuth(URI endpoint, @Param("username") String username, @Param("password") String password); }
/** * This interface is for /userinfo API stub */ @Headers("Content-Type: application/x-www-form-urlencoded") public interface UserInfoServiceStub { @Headers("X-Auth-Token: {access_token}") @RequestLine("GET /") Response getUserInfo(@Param("access_token") String accessToken); }
@Headers("Accept: application/json") interface HttpBinResource { @RequestLine("GET /basic-auth/user/passwd") AuthStatus getAuthenticatedUser(); }
/** * This interface is for /introspect API stub. */ @Headers("Content-Type: application/x-www-form-urlencoded") public interface IntrospectionServiceStub { @RequestLine("POST /") Response introspectToken(String token); default Response introspectAccessToken(String token) { Map<String, String> requestParam = Collections.singletonMap("token", token); return introspectToken(ExternalIdPClientUtil.getRequestBody(requestParam)); } } }
@RequestMapping(value = "/commonRequest",method = {RequestMethod.POST},consumes = MediaType.APPLICATION_JSON_VALUE) @Headers("Content-Type: application/json") Result<UserResponseDO> commonRequest(@RequestBody UserRequestDO userRequestDO); }
@RequestLine("GET /IdentityKeyedEntity/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<IdentityKeyedEntity>> findByExample( FindByExampleCriteria<IdentityKeyedEntity> criteria); }
@RequestLine("GET /MappedSuperclassOneToManyChild/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<MappedSuperclassOneToManyChild>> findByExample( FindByExampleCriteria<MappedSuperclassOneToManyChild> criteria); }
/** * Execute the ReturnNullEntity operation. * * @return A service response-wrapped instance of {@link SimpleDomain} */ @RequestLine("POST /SimpleDomainManagerService/returnNullEntity") @Headers({ "Content-Type: " + MediaType.APPLICATION_JSON }) ValueServiceResponse<SimpleDomain> returnNullEntity();
/** * Execute the LogServiceEntityExample operation. * * @return An empty service response */ @RequestLine("POST /ServiceExampleLoggerService/logServiceEntityExample") @Headers({ "Content-Type: " + MediaType.APPLICATION_JSON }) public VoidServiceResponse logServiceEntityExample();
@RequestLine("GET /ForeignKeyColumnConventions/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<ForeignKeyColumnConventions>> findByExample( FindByExampleCriteria<ForeignKeyColumnConventions> criteria); }
@RequestMapping(method = RequestMethod.POST, value = "/{coin}/{chain}/txs/push?token={token}") @Headers("Content-Type: application/json") String sendSignedTransaction(@RequestHeader("User-Agent") String userAgent, @PathVariable("coin") final String coin, @PathVariable("chain") final String chain, @RequestParam("token") final String token, @RequestBody BlockCypherRawTransactionRequest request); }
@Headers("Content-Type:application/json") @FeignClient(name = "api-base", configuration = FeignIntercepter.class) public interface LogRpcService { @Async @PostMapping("log/save") R save(LogDO logDO); }
@Headers("Content-Type:application/json") @FeignClient(name = "api-admin", configuration = FeignIntercepter.class) public interface MenuService { @GetMapping("/menu/userMenus") List<MenuDTO> userMenus(); }
@RequestLine("GET /IntegerKeyedEntity/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<IntegerKeyedEntity>> findByExample( FindByExampleCriteria<IntegerKeyedEntity> criteria); }
@RequestLine("GET /SimpleDomainEagerChild/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<SimpleDomainEagerChild>> findByExample( FindByExampleCriteria<SimpleDomainEagerChild> criteria); }
@RequestLine("GET /ValidationReferenceExample/findByExample") @Headers({ "Content-Type: application/json" }) ValueServiceResponse<PageWrapper<ValidationReferenceExample>> findByExample( FindByExampleCriteria<ValidationReferenceExample> criteria); }