[GitHub] [servicecomb-docs] yhs0092 opened a new pull request #98: [SCB-1265] add config items about transport-rest-vertx
yhs0092 opened a new pull request #98: [SCB-1265] add config items about transport-rest-vertx URL: https://github.com/apache/servicecomb-docs/pull/98 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-java-chassis] branch weak-contract-type updated (e543ec1 -> 290ba44)
This is an automated email from the ASF dual-hosted git repository. wujimin pushed a change to branch weak-contract-type in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git. discard e543ec1 [SCB-1268][WIP][WEAK] update UT discard 5b01199 [SCB-1268][WIP][WEAK] publish Microservice life event discard 0291496 [SCB-1268][WIP][WEAK] delete metas from AppManager, will manage them by VendorExtensions discard b4216c7 [SCB-1268][WIP][WEAK] MicroserviceNameParser not depend on static variable discard 668a87e [SCB-1268][WIP][WEAK] format code discard 0df05c5 [SCB-1117][WIP][WEAK] UT for Springmvc mode discard 8866c71 [SCB-1117][WIP][WEAK] UT for Jaxrs mode discard a734e86 [SCB-1117][WIP][WEAK] UT for Pojo mode discard e1b8986 [SCB-1117][WIP][WEAK] prepare UT model and consumer interfaces discard 7cdacef [SCB-1117][WIP][WEAK] delete useless UT files discard 63346ed [SCB-1117][WIP][WEAK] delete useless files discard 3552bf5 [SCB-1117][WIP][WEAK] SwaggerConsumer arguments not depend on swagger interface discard 582a090 [SCB-1256][WIP][WEAK] rename ConcreteInterfaceRegister to ConcreteTypeRegister discard 395e119 [SCB-1252][WIP][WEAK] change element of HttpParameterType to uppercase discard 2df3243 [SCB-1248][WIP][WEAK] update unit test discard 00913dc [SCB-1248][WIP][WEAK] reduce EventBus subscribers discard 80d435f [SCB-1248][WIP][WEAK] add MicroserviceMeta discard e80efd0 [SCB-1248][WIP][WEAK] add SwaggerLoader discard 223b033 [SCB-1248][WIP][WEAK] remove MicroserviceVersionFactory discard b3194fc [SCB-1248][WIP][WEAK] improve config log discard 3d25816 [SCB-1248][WIP][WEAK] make local registry easier to use discard b2f0b36 [SCB-1228][WIP][WEAK] update chassis pom.xml to present interface argument name discard 739073f [SCB-1228][WIP][WEAK] update unit test discard 05eeb97 [SCB-1228][WIP][WEAK] update SPI definition discard 844b2d7 [SCB-1228][WIP][WEAK] springmvc processors switch to new mechanism discard eaaf38b [SCB-1228][WIP][WEAK] swagger springmvc generator switch to new mechanism discard a938e4f [SCB-1228][WIP][WEAK] delete swagger to class logic discard 9e3fed5 [SCB-1227][WIP][WEAK] update unit test discard 017dc6b [SCB-1227][WIP][WEAK] update SPI definition discard 6d69c89 [SCB-1227][WIP][WEAK] jaxrs processors switch to new mechanism discard 7f237e1 [SCB-1227][WIP][WEAK] swagger jaxrs generator switch to new mechanism discard 7d8a7a4 [SCB-1242] add spring data plugin project discard 75f7ab6 [SCB-1242] swagger generator and json deserializer prepare to support spring data discard c18cc1e [SCB-1225][WIP][WEAK] fix by review comments discard 9264e3c [SCB-1225][WIP][WEAK] remove unnecessary dependency of spring discard 1cf6834 [SCB-1225][WIP][WEAK] update unit test cases discard 983ff2a [SCB-1225][WIP][WEAK] SPI definition switch to new mechanism discard 4037c5c [SCB-1225][WIP][WEAK] delete useless files discard 6006114 [SCB-1225][WIP][WEAK] create abstract rest mode generator discard d3bbdbb [SCB-1225][WIP][WEAK] create pojo mode generator discard af97590 [SCB-1225][WIP][WEAK] unit test utils switch to new mechanism discard c0b88c4 [SCB-1225][WIP][WEAK] response generator switch to new mechanism discard 77f7e04 [SCB-1225][WIP][WEAK] parameter generator switch to new mechanism discard 5820a74 [SCB-1225][WIP][WEAK] class and method annotation switch to new mechanism discard 35d4b26 [SCB-1225][WIP][WEAK] create basic generator implementation discard cc5b14a [SCB-1225][WIP][WEAK] define new generator interfaces discard 64a91ae [SCB-1225][WIP][WEAK] delete swagger to class logic discard bed6de4 [SCB-1213][WIP][WEAK] swagger generator placeholder resolver not depend on spring discard 72847a7 [SC-1214][WIP][WEAK] change weak-contract-type branch version to weak-contract-type-SNAPSHOT new c957fc3 [SCB-1088] SDK IsolationServerEvent is missing endpoint information new 966e4a0 [SCB-1260] make configuration inspector css simpler new ee8a916 [SCB-1260] tiny improve PriorityProperty unit test new 215042d [SCB-1260] not refresh page when change schema format and tree active node is not schema new 89f6ca4 [SCB-1260] fix: inspector online test with servlet.urlPattern cause 404 new 62deed4 [SCB-1266] move getClassByName from ClassUtils to ReflectUtils new 6e29b70 [SCB-1266] hack Log4jMarkerFactory to not cache special marker new 316e208 [SCB-1266] fix marker leak problem in SCBEngine new 225823d [SCB-1266] fix by review new c6d0a12 [SCB-1263] do not inherit InvocationContext from request header in edge new 6cd1bcd [SCB-1263] test inheriting context in edge by custom filter new d3f42eb [SCB-1263] add reminder comment new 40b08ec [SCB-1259] swagger generator core support response type to be Optional new 1a068b5 [SCB-1259] swagger generator springmvc support response type to be Optional new bce224d
[servicecomb-java-chassis] branch weak-contract-type updated (0df05c5 -> e543ec1)
This is an automated email from the ASF dual-hosted git repository. liubao pushed a change to branch weak-contract-type in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git. from 0df05c5 [SCB-1117][WIP][WEAK] UT for Springmvc mode new 668a87e [SCB-1268][WIP][WEAK] format code new b4216c7 [SCB-1268][WIP][WEAK] MicroserviceNameParser not depend on static variable new 0291496 [SCB-1268][WIP][WEAK] delete metas from AppManager, will manage them by VendorExtensions new 5b01199 [SCB-1268][WIP][WEAK] publish Microservice life event new e543ec1 [SCB-1268][WIP][WEAK] update UT The 2268 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../foundation/common/VendorExtensions.java| 27 ++-- .../servicecomb/serviceregistry/RegistryUtils.java | 2 +- .../serviceregistry/ServiceRegistry.java | 2 + .../serviceregistry/client/IpPortManager.java | 1 - .../client/http/RequestContext.java| 1 - .../consumer/MicroserviceVersion.java | 60 + .../consumer/MicroserviceVersions.java | 42 -- .../consumer/StaticMicroserviceVersions.java | 85 ++--- .../definition/DefinitionConst.java| 4 +- .../definition/MicroserviceMeta.java | 141 - .../definition/MicroserviceNameParser.java | 21 ++- .../serviceregistry/definition/OperationMeta.java | 138 .../serviceregistry/definition/SchemaMeta.java | 135 .../event/CreateMicroserviceEvent.java | 24 ++-- .../event/CreateMicroserviceVersionEvent.java | 24 ++-- .../event/DestroyMicroserviceEvent.java| 24 ++-- .../event/DestroyMicroserviceVersionEvent.java | 24 ++-- .../registry/AbstractServiceRegistry.java | 20 +-- .../serviceregistry/swagger/SwaggerLoader.java | 8 +- .../serviceregistry/task/AbstractTask.java | 1 - .../task/MicroserviceRegisterTask.java | 4 +- .../servicecomb/serviceregistry/TestConsumers.java | 9 -- .../response/TestMicroserviceInstanceResponse.java | 2 - .../cache/TestInstanceCacheManagerNew.java | 9 -- .../serviceregistry/client/TestIpPortManager.java | 1 + .../client/http/TestAbstractClientPool.java| 1 - .../client/http/TestServiceRegistryClientImpl.java | 5 +- .../consumer/TestMicroserviceVersionRuleFixed.java | 9 -- .../TestMicroserviceVersionRuleLatest.java | 9 -- .../consumer/TestMicroserviceVersionRuleRange.java | 9 -- .../TestMicroserviceVersionRuleStartFrom.java | 9 -- .../instance/TestInstanceCacheChecker.java | 26 ++-- .../discovery/TestAbstractDiscoveryFilter.java | 1 - .../discovery/TestDiscoveryTree.java | 1 - .../registry/TestLocalServiceRegistry.java | 2 +- .../serviceregistry/swagger/TestSwaggerLoader.java | 79 ++-- .../task/TestMicroserviceRegisterTask.java | 1 - .../serviceregistry/version/TestVersion.java | 1 - 38 files changed, 254 insertions(+), 708 deletions(-) copy service-registry/src/main/java/org/apache/servicecomb/serviceregistry/version/VersionUtils.java => foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/VendorExtensions.java (60%) delete mode 100644 service-registry/src/main/java/org/apache/servicecomb/serviceregistry/definition/MicroserviceMeta.java delete mode 100644 service-registry/src/main/java/org/apache/servicecomb/serviceregistry/definition/OperationMeta.java delete mode 100644 service-registry/src/main/java/org/apache/servicecomb/serviceregistry/definition/SchemaMeta.java copy demo/demo-edge/model/src/main/java/org/apache/servicecomb/demo/edge/model/DependTypeB.java => service-registry/src/main/java/org/apache/servicecomb/serviceregistry/event/CreateMicroserviceEvent.java (65%) copy common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/ParameterConfig.java => service-registry/src/main/java/org/apache/servicecomb/serviceregistry/event/CreateMicroserviceVersionEvent.java (64%) copy demo/demo-edge/model/src/main/java/org/apache/servicecomb/demo/edge/model/DependTypeB.java => service-registry/src/main/java/org/apache/servicecomb/serviceregistry/event/DestroyMicroserviceEvent.java (65%) copy common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/ParameterConfig.java => service-registry/src/main/java/org/apache/servicecomb/serviceregistry/event/DestroyMicroserviceVersionEvent.java (64%)
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1194: [SCB-1268][WIP][WEAK] Sc publish ms life event
liubao68 merged pull request #1194: [SCB-1268][WIP][WEAK] Sc publish ms life event URL: https://github.com/apache/servicecomb-java-chassis/pull/1194 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-java-chassis] branch weak-contract-type updated (582a090 -> 0df05c5)
This is an automated email from the ASF dual-hosted git repository. liubao pushed a change to branch weak-contract-type in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git. from 582a090 [SCB-1256][WIP][WEAK] rename ConcreteInterfaceRegister to ConcreteTypeRegister new 3552bf5 [SCB-1117][WIP][WEAK] SwaggerConsumer arguments not depend on swagger interface new 63346ed [SCB-1117][WIP][WEAK] delete useless files new 7cdacef [SCB-1117][WIP][WEAK] delete useless UT files new e1b8986 [SCB-1117][WIP][WEAK] prepare UT model and consumer interfaces new a734e86 [SCB-1117][WIP][WEAK] UT for Pojo mode new 8866c71 [SCB-1117][WIP][WEAK] UT for Jaxrs mode new 0df05c5 [SCB-1117][WIP][WEAK] UT for Springmvc mode The 2263 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: swagger/swagger-invocation/invocation-core/pom.xml | 24 +-- .../swagger/engine/SwaggerBootstrap.java | 21 -- .../swagger/engine/SwaggerConsumer.java| 21 +- .../swagger/engine/SwaggerConsumerOperation.java | 21 +- .../swagger/engine/SwaggerEnvironment.java | 101 +++-- .../swagger/engine/bootstrap/BootstrapNormal.java | 51 - .../engine/unittest/LocalProducerInvoker.java | 94 .../parameter/InvocationContextParameter.java | 24 --- .../arguments/AbstractArgumentsMapperCreator.java | 240 + .../arguments/ArgumentsMapperConfig.java | 84 .../arguments/ContextArgumentMapperFactory.java| 24 --- .../swagger/invocation/arguments/FieldInfo.java| 40 .../invocation/arguments/ProviderParameter.java| 87 ...mentsMapper.java => ArgumentsMapperCommon.java} | 29 +-- .../ArgumentsMapperDirectReuse.java} | 10 +- .../arguments/consumer/ConsumerArgumentSame.java | 17 +- .../consumer/ConsumerArgumentToBodyField.java | 69 ++ .../consumer/ConsumerArgumentsMapper.java | 55 +++-- .../consumer/ConsumerArgumentsMapperCreator.java | 119 ++ .../consumer/ConsumerArgumentsMapperFactory.java | 65 -- ...umentSame.java => ConsumerBeanParamMapper.java} | 53 +++-- .../ConsumerContextArgumentMapperFactory.java | 8 +- .../consumer/ConsumerInvocationContextMapper.java | 1 + .../ConsumerInvocationContextMapperFactory.java| 8 +- .../generator/InvocationContextProcessor.java | 14 +- ...ecomb.swagger.generator.SwaggerContextRegister} | 2 +- ...s.consumer.ConsumerContextArgumentMapperFactory | 2 +- .../engine/SwaggerEnvironmentForTest.java | 55 - .../arguments/TestPojoConsumerEqualProducer.java | 211 -- .../arguments/TestPojoConsumerEqualSwagger.java| 233 .../consumer/ConsumerArgumentSameTest.java | 53 - .../arguments/consumer/TestJaxrsV1V1.java | 142 .../arguments/consumer/TestJaxrsV1V2.java | 146 + .../arguments/consumer/TestJaxrsV2V1.java | 142 .../arguments/consumer/TestJaxrsV2V2.java | 147 + .../arguments/consumer/TestPojoV1V1.java | 139 .../arguments/consumer/TestPojoV1V2.java | 105 + .../arguments/consumer/TestPojoV2V1.java | 105 + .../arguments/consumer/TestPojoV2V2.java | 107 + .../arguments/consumer/TestSpringmvcV1V1.java | 143 .../arguments/consumer/TestSpringmvcV1V2.java | 147 + .../arguments/consumer/TestSpringmvcV2V1.java | 143 .../arguments/consumer/TestSpringmvcV2V2.java | 148 + .../swagger/invocation/arguments/utils/Utils.java | 30 --- .../invocation/schemas/ConsumerAddBodyV1.java | 9 +- .../invocation/schemas/ConsumerAddBodyV2.java | 9 +- .../swagger/invocation/schemas/ConsumerAddV1.java | 6 +- .../swagger/invocation/schemas/ConsumerAddV2.java | 9 +- .../invocation/schemas/ConsumerAddWithContext.java | 9 +- .../invocation/schemas/JaxrsAddBeanParamV1.java| 16 +- .../invocation/schemas/JaxrsAddBeanParamV2.java| 16 +- .../swagger/invocation/schemas/JaxrsAddBodyV1.java | 19 +- .../swagger/invocation/schemas/JaxrsAddBodyV2.java | 19 +- .../swagger/invocation/schemas/JaxrsAddV1.java | 16 +- .../swagger/invocation/schemas/JaxrsAddV2.java | 17 +- .../swagger/invocation/schemas/PojoAddBodyV1.java | 10 +- .../swagger/invocation/schemas/PojoAddBodyV2.java | 9 +- .../swagger/invocation/schemas/PojoAddV1.java | 9 +- .../swagger/invocation/schemas/PojoAddV2.java | 9 +- .../invocation/schemas/PojoAddWithContextV1.java} | 12 +- .../invocation/schemas/SpringmvcAddBodyV1.java | 18 +-
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments
liubao68 merged pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments URL: https://github.com/apache/servicecomb-java-chassis/pull/1141 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] wujimin commented on a change in pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments
wujimin commented on a change in pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments URL: https://github.com/apache/servicecomb-java-chassis/pull/1141#discussion_r279173618 ## File path: swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerEnvironment.java ## @@ -17,115 +17,78 @@ package org.apache.servicecomb.swagger.engine; import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; - -import javax.inject.Inject; +import java.util.function.Function; +import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.apache.servicecomb.foundation.common.utils.BeanUtils; -import org.apache.servicecomb.foundation.common.utils.ReflectUtils; -import org.apache.servicecomb.swagger.invocation.arguments.ArgumentsMapperConfig; +import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils; +import org.apache.servicecomb.swagger.generator.core.model.SwaggerOperation; +import org.apache.servicecomb.swagger.generator.core.model.SwaggerOperations; +import org.apache.servicecomb.swagger.invocation.arguments.ContextArgumentMapperFactory; import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapper; -import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapperFactory; +import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapperCreator; +import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerContextArgumentMapperFactory; import org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapper; import org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapperFactory; -import org.apache.servicecomb.swagger.invocation.converter.ConverterMgr; import org.apache.servicecomb.swagger.invocation.response.ResponseMapperFactorys; import org.apache.servicecomb.swagger.invocation.response.consumer.ConsumerResponseMapper; import org.apache.servicecomb.swagger.invocation.response.consumer.ConsumerResponseMapperFactory; import org.apache.servicecomb.swagger.invocation.response.producer.ProducerResponseMapper; import org.apache.servicecomb.swagger.invocation.response.producer.ProducerResponseMapperFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; import io.swagger.annotations.ApiOperation; -import io.swagger.models.Operation; +import io.swagger.models.Swagger; +import io.swagger.util.Json; -@Component public class SwaggerEnvironment { private static final Logger LOGGER = LoggerFactory.getLogger(SwaggerEnvironment.class); - /** - * default producerArgumentsFactory - */ - @Inject - private ProducerArgumentsMapperFactory producerArgumentsFactory; - - @Autowired - private List producerArgumentsMapperFactoryList = new ArrayList<>(0); - private ResponseMapperFactorys producerResponseMapperFactorys = new ResponseMapperFactorys<>(ProducerResponseMapperFactory.class); - @Inject - private ConsumerArgumentsMapperFactory consumerArgumentsFactory; - private ResponseMapperFactorys consumerResponseMapperFactorys = new ResponseMapperFactorys<>(ConsumerResponseMapperFactory.class); - @Inject - public void setConverterMgr(ConverterMgr converterMgr) { -consumerResponseMapperFactorys.setConverterMgr(converterMgr); -producerResponseMapperFactorys.setConverterMgr(converterMgr); - } - - public ProducerArgumentsMapperFactory getProducerArgumentsFactory() { -return producerArgumentsFactory; - } - - public void setProducerArgumentsFactory(ProducerArgumentsMapperFactory producerArgumentsFactory) { -this.producerArgumentsFactory = producerArgumentsFactory; - } - - public ConsumerArgumentsMapperFactory getConsumerArgumentsFactory() { -return consumerArgumentsFactory; - } - - public void setConsumerArgumentsFactory(ConsumerArgumentsMapperFactory consumerArgumentsFactory) { -this.consumerArgumentsFactory = consumerArgumentsFactory; - } - - public SwaggerConsumer createConsumer(Class consumerIntf) { -// consumer interface equals to contract interface -return createConsumer(consumerIntf, consumerIntf); - } + public SwaggerConsumer createConsumer(Class consumerIntf, Swagger swagger) { +Map, ContextArgumentMapperFactory> contextFactorys = SPIServiceUtils +.getOrLoadSortedService(ConsumerContextArgumentMapperFactory.class) +.stream() + .collect(Collectors.toMap(ConsumerContextArgumentMapperFactory::getContextClass, Function.identity())); +SwaggerOperations swaggerOperations = new SwaggerOperations(swagger); - public SwaggerConsumer createConsumer(Class consumerIntf, Class swaggerIntf) { SwaggerConsumer consumer =
[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments
liubao68 commented on a change in pull request #1141: [SCB-1117][WIP][WEAK] Weak swagger consumer arguments URL: https://github.com/apache/servicecomb-java-chassis/pull/1141#discussion_r279173424 ## File path: swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerEnvironment.java ## @@ -17,115 +17,78 @@ package org.apache.servicecomb.swagger.engine; import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; - -import javax.inject.Inject; +import java.util.function.Function; +import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.apache.servicecomb.foundation.common.utils.BeanUtils; -import org.apache.servicecomb.foundation.common.utils.ReflectUtils; -import org.apache.servicecomb.swagger.invocation.arguments.ArgumentsMapperConfig; +import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils; +import org.apache.servicecomb.swagger.generator.core.model.SwaggerOperation; +import org.apache.servicecomb.swagger.generator.core.model.SwaggerOperations; +import org.apache.servicecomb.swagger.invocation.arguments.ContextArgumentMapperFactory; import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapper; -import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapperFactory; +import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerArgumentsMapperCreator; +import org.apache.servicecomb.swagger.invocation.arguments.consumer.ConsumerContextArgumentMapperFactory; import org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapper; import org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapperFactory; -import org.apache.servicecomb.swagger.invocation.converter.ConverterMgr; import org.apache.servicecomb.swagger.invocation.response.ResponseMapperFactorys; import org.apache.servicecomb.swagger.invocation.response.consumer.ConsumerResponseMapper; import org.apache.servicecomb.swagger.invocation.response.consumer.ConsumerResponseMapperFactory; import org.apache.servicecomb.swagger.invocation.response.producer.ProducerResponseMapper; import org.apache.servicecomb.swagger.invocation.response.producer.ProducerResponseMapperFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; import io.swagger.annotations.ApiOperation; -import io.swagger.models.Operation; +import io.swagger.models.Swagger; +import io.swagger.util.Json; -@Component public class SwaggerEnvironment { private static final Logger LOGGER = LoggerFactory.getLogger(SwaggerEnvironment.class); - /** - * default producerArgumentsFactory - */ - @Inject - private ProducerArgumentsMapperFactory producerArgumentsFactory; - - @Autowired - private List producerArgumentsMapperFactoryList = new ArrayList<>(0); - private ResponseMapperFactorys producerResponseMapperFactorys = new ResponseMapperFactorys<>(ProducerResponseMapperFactory.class); - @Inject - private ConsumerArgumentsMapperFactory consumerArgumentsFactory; - private ResponseMapperFactorys consumerResponseMapperFactorys = new ResponseMapperFactorys<>(ConsumerResponseMapperFactory.class); - @Inject - public void setConverterMgr(ConverterMgr converterMgr) { -consumerResponseMapperFactorys.setConverterMgr(converterMgr); -producerResponseMapperFactorys.setConverterMgr(converterMgr); - } - - public ProducerArgumentsMapperFactory getProducerArgumentsFactory() { -return producerArgumentsFactory; - } - - public void setProducerArgumentsFactory(ProducerArgumentsMapperFactory producerArgumentsFactory) { -this.producerArgumentsFactory = producerArgumentsFactory; - } - - public ConsumerArgumentsMapperFactory getConsumerArgumentsFactory() { -return consumerArgumentsFactory; - } - - public void setConsumerArgumentsFactory(ConsumerArgumentsMapperFactory consumerArgumentsFactory) { -this.consumerArgumentsFactory = consumerArgumentsFactory; - } - - public SwaggerConsumer createConsumer(Class consumerIntf) { -// consumer interface equals to contract interface -return createConsumer(consumerIntf, consumerIntf); - } + public SwaggerConsumer createConsumer(Class consumerIntf, Swagger swagger) { +Map, ContextArgumentMapperFactory> contextFactorys = SPIServiceUtils +.getOrLoadSortedService(ConsumerContextArgumentMapperFactory.class) +.stream() + .collect(Collectors.toMap(ConsumerContextArgumentMapperFactory::getContextClass, Function.identity())); +SwaggerOperations swaggerOperations = new SwaggerOperations(swagger); - public SwaggerConsumer createConsumer(Class consumerIntf, Class swaggerIntf) { SwaggerConsumer consumer