use of com.alipay.sofa.rpc.doc.swagger.rest.SwaggerRestServiceImpl in project sofa-boot by alipay.
the class BoltSwaggerServiceApplicationListener method onApplicationEvent.
@Override
public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
List<BindingParam> bindingParams = new ArrayList<>();
bindingParams.add(new RestBindingParam());
ServiceParam serviceParam = new ServiceParam();
serviceParam.setInterfaceType(SwaggerRestService.class);
serviceParam.setInstance(new SwaggerRestServiceImpl());
serviceParam.setBindingParams(bindingParams);
ServiceClient serviceClient = clientFactory.getClient(ServiceClient.class);
serviceClient.service(serviceParam);
}
use of com.alipay.sofa.rpc.doc.swagger.rest.SwaggerRestServiceImpl in project sofa-rpc by sofastack.
the class BoltServerMainWithSwagger method main.
public static void main(String[] args) {
ApplicationConfig application = new ApplicationConfig().setAppName("test-server");
ServerConfig serverConfig = new ServerConfig().setPort(22000).setDaemon(false);
ProviderConfig<HelloService> providerConfig = new ProviderConfig<HelloService>().setInterfaceId(HelloService.class.getName()).setApplication(application).setRef(new HelloServiceImpl()).setServer(serverConfig).setRegister(false);
ProviderConfig<EchoService> providerConfig2 = new ProviderConfig<EchoService>().setInterfaceId(EchoService.class.getName()).setApplication(application).setRef(new EchoServiceImpl()).setServer(serverConfig).setRegister(false);
providerConfig.export();
providerConfig2.export();
ServerConfig restServer = new ServerConfig().setProtocol("rest").setPort(8888).setDaemon(false);
ProviderConfig<SwaggerRestService> restProviderConfig = new ProviderConfig<SwaggerRestService>().setInterfaceId(SwaggerRestService.class.getName()).setApplication(application).setRef(new SwaggerRestServiceImpl()).setBootstrap("rest").setServer(restServer).setRegister(false);
restProviderConfig.export();
LOGGER.warn("started at pid {}", RpcRuntimeContext.PID);
}
use of com.alipay.sofa.rpc.doc.swagger.rest.SwaggerRestServiceImpl in project sofa-boot by sofastack.
the class BoltSwaggerServiceApplicationListener method onApplicationEvent.
@Override
public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
List<BindingParam> bindingParams = new ArrayList<>();
bindingParams.add(new RestBindingParam());
ServiceParam serviceParam = new ServiceParam();
serviceParam.setInterfaceType(SwaggerRestService.class);
serviceParam.setInstance(new SwaggerRestServiceImpl());
serviceParam.setBindingParams(bindingParams);
ServiceClient serviceClient = clientFactory.getClient(ServiceClient.class);
serviceClient.service(serviceParam);
}
Aggregations