@SpringBootApplication @ComponentScan(value={"net.gdface.sdk","net.gdface.fse"}) @EnableSwagger2 public class RestfulService extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HTTP_PORT |
Constructor and Description |
---|
RestfulService() |
Modifier and Type | Method and Description |
---|---|
org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
corsConfigurer()
配置是否允许跨访问
|
static org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer |
getCustomizer()
返回tomcat参数定义接口实例
|
static int |
getHttpPort()
返回HTTP端口
|
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory |
getTomcatEmbeddedServletContainerFactory() |
static boolean |
isCorsEnable() |
static boolean |
isSwaggerEnable() |
static void |
main(java.lang.String[] args)
test only
|
static void |
run()
启动spring boot应用
|
springfox.documentation.spring.web.plugins.Docket |
serviceApi() |
static void |
setCorsEnable(boolean corsEnable)
设置是否支持跨域访问(CORS)
|
static void |
setCustomizer(org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer customizer)
设置tomcat参数定义接口实例
|
static void |
setHttpPort(int httpPort)
设置HTTP端口,默认8080
|
static void |
setInterfaceInstance(FaceApi apiInstance)
设置
FaceApi 实例 |
static void |
setInterfaceInstance(FeatureSe apiInstance)
设置
FaceApi 实例 |
static void |
setSwaggerEnable(boolean swaggerEnable)
设置是否显示在线swagger文档
|
public static final int DEFAULT_HTTP_PORT
public RestfulService()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static void run()
@Bean public springfox.documentation.spring.web.plugins.Docket serviceApi()
@Bean public org.springframework.boot.context.embedded.EmbeddedServletContainerFactory getTomcatEmbeddedServletContainerFactory()
public static int getHttpPort()
public static void setHttpPort(int httpPort)
httpPort
- 要设置的 httpPortpublic static org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer getCustomizer()
public static void setCustomizer(org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer customizer)
customizer
- 要设置的 customizer,不可为null
public static void setInterfaceInstance(FaceApi apiInstance)
FaceApi
实例apiInstance
- FaceApi
实例,不可为null
public static void setInterfaceInstance(FeatureSe apiInstance)
FaceApi
实例apiInstance
- FaceApi
实例,不可为null
public static boolean isSwaggerEnable()
public static void setSwaggerEnable(boolean swaggerEnable)
swaggerEnable
- public static boolean isCorsEnable()
public static void setCorsEnable(boolean corsEnable)
corsEnable
- @Bean public org.springframework.web.servlet.config.annotation.WebMvcConfigurer corsConfigurer()
Copyright © 2020. All rights reserved.