Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
fb208eba
Commit
fb208eba
authored
Jul 23, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
0eac2919
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
1182 additions
and
150 deletions
+1182
-150
pom.xml
datax-common/datax-common-database/pom.xml
+1
-1
datax-service-codegen-dev.yml
...g/src/main/resources/config/datax-service-codegen-dev.yml
+14
-2
datax-service-data-factory-dev.yml
.../main/resources/config/datax-service-data-factory-dev.yml
+14
-2
datax-service-data-market-dev.yml
...c/main/resources/config/datax-service-data-market-dev.yml
+14
-2
datax-service-data-sql-console-dev.yml
...n/resources/config/datax-service-data-sql-console-dev.yml
+14
-2
datax-service-email-dev.yml
...fig/src/main/resources/config/datax-service-email-dev.yml
+14
-2
datax-service-file-dev.yml
...nfig/src/main/resources/config/datax-service-file-dev.yml
+12
-3
datax-service-quartz-dev.yml
...ig/src/main/resources/config/datax-service-quartz-dev.yml
+14
-2
datax-service-system-dev.yml
...ig/src/main/resources/config/datax-service-system-dev.yml
+14
-2
datax-service-system-prod.yml
...g/src/main/resources/config/datax-service-system-prod.yml
+0
-74
DataResourceServerConfig.java
...atax/service/codegen/config/DataResourceServerConfig.java
+67
-0
StartedUpRunner.java
...java/cn/datax/service/codegen/config/StartedUpRunner.java
+31
-0
SwaggerConfig.java
...n/java/cn/datax/service/codegen/config/SwaggerConfig.java
+112
-0
SwaggerProperties.java
...va/cn/datax/service/codegen/config/SwaggerProperties.java
+92
-0
InnerController.java
.../cn/datax/service/codegen/controller/InnerController.java
+11
-0
SwaggerConfig.java
...ervice/data/factory/sql/console/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
...ce/data/factory/sql/console/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...a/cn/datax/service/data/factory/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
.../datax/service/data/factory/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...va/cn/datax/service/data/market/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
...n/datax/service/data/market/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...ain/java/cn/datax/service/email/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
...java/cn/datax/service/email/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...main/java/cn/datax/service/file/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
.../java/cn/datax/service/file/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...in/java/cn/datax/service/quartz/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
...ava/cn/datax/service/quartz/config/SwaggerProperties.java
+92
-0
SwaggerConfig.java
...in/java/cn/datax/service/system/config/SwaggerConfig.java
+16
-8
SwaggerProperties.java
...ava/cn/datax/service/system/config/SwaggerProperties.java
+92
-0
pom.xml
pom.xml
+2
-2
No files found.
datax-common/datax-common-database/pom.xml
View file @
fb208eba
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<version>
${mariadb.version}
</version>
<version>
${mariadb.version}
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.oracle.
o
jdbc
</groupId>
<groupId>
com.oracle.
database.
jdbc
</groupId>
<artifactId>
ojdbc8
</artifactId>
<artifactId>
ojdbc8
</artifactId>
<version>
${oracle.version}
</version>
<version>
${oracle.version}
</version>
</dependency>
</dependency>
...
...
datax-config/src/main/resources/config/datax-service-codegen-dev.yml
View file @
fb208eba
...
@@ -70,4 +70,16 @@ security:
...
@@ -70,4 +70,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.codegen.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-data-factory-dev.yml
View file @
fb208eba
...
@@ -70,4 +70,16 @@ security:
...
@@ -70,4 +70,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.data.factory.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-data-market-dev.yml
View file @
fb208eba
...
@@ -70,4 +70,16 @@ security:
...
@@ -70,4 +70,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.data.market.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-data-sql-console-dev.yml
View file @
fb208eba
...
@@ -70,4 +70,16 @@ security:
...
@@ -70,4 +70,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.data.factory.sql.console.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-email-dev.yml
View file @
fb208eba
...
@@ -82,4 +82,16 @@ security:
...
@@ -82,4 +82,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.email.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-file-dev.yml
View file @
fb208eba
...
@@ -73,12 +73,21 @@ security:
...
@@ -73,12 +73,21 @@ security:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.file.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
data
:
data
:
file-server
:
file-server
:
type
:
local
type
:
local
#fdfs配置
fdfs
:
web-url
:
#oss配置
#oss配置
oss
:
oss
:
access-key
:
tpi8mObnfzZi4ggBX8Bw7zydjoTQ0WeML3RkPKsX
access-key
:
tpi8mObnfzZi4ggBX8Bw7zydjoTQ0WeML3RkPKsX
...
...
datax-config/src/main/resources/config/datax-service-quartz-dev.yml
View file @
fb208eba
...
@@ -100,4 +100,16 @@ security:
...
@@ -100,4 +100,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.quartz.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-system-dev.yml
View file @
fb208eba
...
@@ -70,4 +70,16 @@ security:
...
@@ -70,4 +70,16 @@ security:
scope
:
all
scope
:
all
resource
:
resource
:
loadBalanced
:
true
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
# Swagger界面内容配置
swagger
:
title
:
API接口文档
description
:
Api Documentation
version
:
1.0.0
basePackage
:
cn.datax.service.system.controller
termsOfServiceUrl
:
http://www.baidu.com
contact
:
name
:
yuwei
url
:
http://www.baidu.com
email
:
312075478@qq.com
\ No newline at end of file
datax-config/src/main/resources/config/datax-service-system-prod.yml
deleted
100644 → 0
View file @
0eac2919
# 数据源配置
spring
:
redis
:
database
:
1
host
:
127.0.0.1
port
:
6379
password
:
# 密码(默认为空)
timeout
:
6000ms
# 连接超时时长(毫秒)
lettuce
:
pool
:
max-active
:
1000
# 连接池最大连接数(使用负值表示没有限制)
max-wait
:
-1ms
# 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle
:
10
# 连接池中的最大空闲连接
min-idle
:
5
# 连接池中的最小空闲连接
datasource
:
dynamic
:
type
:
com.zaxxer.hikari.HikariDataSource
hikari
:
auto-commit
:
false
connection-timeout
:
30000
idle-timeout
:
25000
login-timeout
:
5
max-lifetime
:
30000
read-only
:
false
validation-timeout
:
3000
maximum-pool-size
:
15
minimum-idle
:
5
pool-name
:
DataxHikariCP
connection-test-query
:
SELECT 1 FROM DUAL
data-source-properties
:
cachePrepStmts
:
true
prepStmtCacheSize
:
250
prepStmtCacheSqlLimit
:
2048
useServerPrepStmts
:
true
useLocalSessionState
:
true
rewriteBatchedStatements
:
true
cacheResultSetMetadata
:
true
cacheServerConfiguration
:
true
elideSetAutoCommits
:
true
maintainTimeStats
:
false
primary
:
mysql
datasource
:
mysql
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://127.0.0.1:3306/data_cloud?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
password
:
1234@abcd
mybatis-plus
:
mapper-locations
:
classpath*:mapper/*Mapper.xml
type-aliases-package
:
cn.datax.system.api.entity
global-config
:
db-config
:
id-type
:
ASSIGN_ID
banner
:
false
configuration
:
map-underscore-to-camel-case
:
true
cache-enabled
:
false
call-setters-on-nulls
:
true
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置
security
:
oauth2
:
client
:
access-token-uri
:
http://localhost:8612/auth/oauth/token
user-authorization-uri
:
http://localhost:8612/auth/oauth/authorize
client-id
:
datax
client-secret
:
123456
scope
:
all
resource
:
loadBalanced
:
true
token-info-uri
:
http://localhost:8612/auth/oauth/check_token
\ No newline at end of file
datax-modules/codegen-service-parent/codegen-service/src/main/java/cn/datax/service/codegen/config/DataResourceServerConfig.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
codegen
.
config
;
import
cn.datax.common.security.handler.DataAccessDeniedHandler
;
import
cn.datax.common.security.handler.DataAuthExceptionEntryPoint
;
import
cn.datax.common.security.utils.DataRedisTokenServices
;
import
cn.datax.common.security.utils.RedisTokenStore
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer
;
import
org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter
;
import
org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
@Configuration
@EnableResourceServer
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
public
class
DataResourceServerConfig
extends
ResourceServerConfigurerAdapter
{
@Autowired
private
DataAccessDeniedHandler
accessDeniedHandler
;
@Autowired
private
DataAuthExceptionEntryPoint
exceptionEntryPoint
;
@Autowired
private
RedisConnectionFactory
redisConnectionFactory
;
@Bean
public
TokenStore
redisTokenStore
()
{
return
new
RedisTokenStore
(
redisConnectionFactory
);
}
@Override
public
void
configure
(
ResourceServerSecurityConfigurer
resources
)
{
DataRedisTokenServices
dataTokenServices
=
new
DataRedisTokenServices
();
dataTokenServices
.
setTokenStore
(
redisTokenStore
());
resources
.
tokenStore
(
redisTokenStore
())
.
tokenServices
(
dataTokenServices
)
.
authenticationEntryPoint
(
exceptionEntryPoint
)
.
accessDeniedHandler
(
accessDeniedHandler
);
}
@Override
public
void
configure
(
HttpSecurity
http
)
throws
Exception
{
//允许使用iframe 嵌套,避免swagger-ui 不被加载的问题
http
.
headers
().
frameOptions
().
disable
();
http
.
authorizeRequests
()
.
antMatchers
(
"/actuator/**"
,
"/v2/api-docs/**"
,
"/swagger-ui.html"
,
"/doc.html"
,
"/swagger-resources/**"
,
"/webjars/**"
,
// feign 内部调用不用授权
"/inner/**"
).
permitAll
()
.
anyRequest
().
authenticated
()
.
and
().
csrf
().
disable
();
}
}
datax-modules/codegen-service-parent/codegen-service/src/main/java/cn/datax/service/codegen/config/StartedUpRunner.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
codegen
.
config
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
@Component
@RequiredArgsConstructor
public
class
StartedUpRunner
implements
ApplicationRunner
{
private
final
ConfigurableApplicationContext
context
;
private
final
Environment
environment
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
if
(
context
.
isActive
())
{
String
banner
=
"-----------------------------------------\n"
+
"服务启动成功,时间:"
+
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
LocalDateTime
.
now
())
+
"\n"
+
"服务名称:"
+
environment
.
getProperty
(
"spring.application.name"
)
+
"\n"
+
"端口号:"
+
environment
.
getProperty
(
"server.port"
)
+
"\n"
+
"-----------------------------------------"
;
System
.
out
.
println
(
banner
);
}
}
}
datax-modules/codegen-service-parent/codegen-service/src/main/java/cn/datax/service/codegen/config/SwaggerConfig.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
codegen
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.*
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.util.ArrayList
;
import
java.util.List
;
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
* 创建API应用
* apiInfo() 增加API相关信息
* 通过select()函数返回一个ApiSelectorBuilder实例,用来控制哪些接口暴露给Swagger来展现,
* 本例采用指定扫描的包路径来定义指定要建立API的目录。
*
* @return
*/
@Bean
public
Docket
createRestApi
(){
//版本类型是swagger2
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
//通过调用自定义方法apiInfo,获得文档的主要信息
.
apiInfo
(
apiInfo
())
//设置全局参数
.
globalOperationParameters
(
globalParamBuilder
())
//设置全局响应参数
.
globalResponseMessage
(
RequestMethod
.
GET
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
POST
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
build
()
//设置安全认证
.
securitySchemes
(
security
());
}
/**
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
* 访问地址:http://项目实际地址/swagger-ui.html
* @return
*/
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
swaggerProperties
.
getDescription
())
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
}
/**
* 安全认证参数
* @return
*/
private
List
<
ApiKey
>
security
()
{
List
<
ApiKey
>
apiKeys
=
new
ArrayList
<>();
apiKeys
.
add
(
new
ApiKey
(
"Authorization"
,
"Authorization"
,
"header"
));
return
apiKeys
;
}
/**
* 构建全局参数列表
* @return
*/
private
List
<
Parameter
>
globalParamBuilder
(){
List
<
Parameter
>
pars
=
new
ArrayList
<>();
pars
.
add
(
parameterBuilder
(
"Authorization"
,
"令牌"
,
"string"
,
"header"
,
false
).
build
());
return
pars
;
}
/**
* 创建参数
* @return
*/
private
ParameterBuilder
parameterBuilder
(
String
name
,
String
desc
,
String
type
,
String
parameterType
,
boolean
required
)
{
ParameterBuilder
tokenPar
=
new
ParameterBuilder
();
tokenPar
.
name
(
name
).
description
(
desc
).
modelRef
(
new
ModelRef
(
type
)).
parameterType
(
parameterType
).
required
(
required
).
build
();
return
tokenPar
;
}
/**
* 创建全局响应值
* @return
*/
private
List
<
ResponseMessage
>
responseBuilder
()
{
List
<
ResponseMessage
>
responseMessageList
=
new
ArrayList
<>();
responseMessageList
.
add
(
new
ResponseMessageBuilder
().
code
(
200
).
message
(
"响应成功"
).
build
());
responseMessageList
.
add
(
new
ResponseMessageBuilder
().
code
(
500
).
message
(
"服务器内部错误"
).
build
());
return
responseMessageList
;
}
}
datax-modules/codegen-service-parent/codegen-service/src/main/java/cn/datax/service/codegen/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
codegen
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/codegen-service-parent/codegen-service/src/main/java/cn/datax/service/codegen/controller/InnerController.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
codegen
.
controller
;
import
cn.datax.common.base.BaseController
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/inner"
)
public
class
InnerController
extends
BaseController
{
}
datax-modules/data-factory-service-parent/data-factory-service-sql-console/src/main/java/cn/datax/service/data/factory/sql/console/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
factory
.
sql
.
console
.
config
;
package
cn
.
datax
.
service
.
data
.
factory
.
sql
.
console
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.data.factory.sql.console.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"数据工厂管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"数据工厂管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/data-factory-service-parent/data-factory-service-sql-console/src/main/java/cn/datax/service/data/factory/sql/console/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
factory
.
sql
.
console
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/data-factory-service-parent/data-factory-service/src/main/java/cn/datax/service/data/factory/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
factory
.
config
;
package
cn
.
datax
.
service
.
data
.
factory
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.data.factory.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"数据工厂管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"数据工厂管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/data-factory-service-parent/data-factory-service/src/main/java/cn/datax/service/data/factory/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
factory
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
market
.
config
;
package
cn
.
datax
.
service
.
data
.
market
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.data.market.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"数据市场管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"数据市场管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
data
.
market
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/email-service-parent/email-service/src/main/java/cn/datax/service/email/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
email
.
config
;
package
cn
.
datax
.
service
.
email
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.email.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"邮件管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"邮件管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/email-service-parent/email-service/src/main/java/cn/datax/service/email/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
email
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/file-service-parent/file-service/src/main/java/cn/datax/service/file/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
file
.
config
;
package
cn
.
datax
.
service
.
file
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.file.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"系统管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"系统管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/file-service-parent/file-service/src/main/java/cn/datax/service/file/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
file
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/quartz-service-parent/quartz-service/src/main/java/cn/datax/service/quartz/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
quartz
.
config
;
package
cn
.
datax
.
service
.
quartz
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.quartz.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"系统管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"系统管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/quartz-service-parent/quartz-service/src/main/java/cn/datax/service/quartz/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
quartz
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
datax-modules/system-service-parent/system-service/src/main/java/cn/datax/service/system/config/SwaggerConfig.java
View file @
fb208eba
package
cn
.
datax
.
service
.
system
.
config
;
package
cn
.
datax
.
service
.
system
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.builders.*
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.*
;
import
springfox.documentation.service.ApiKey
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResponseMessage
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
...
@@ -17,9 +17,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"swagger"
,
name
=
"enable"
,
havingValue
=
"true"
)
@EnableConfigurationProperties
(
SwaggerProperties
.
class
)
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Autowired
private
SwaggerProperties
swaggerProperties
;
/**
/**
* 创建API应用
* 创建API应用
* apiInfo() 增加API相关信息
* apiInfo() 增加API相关信息
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
...
@@ -42,7 +47,8 @@ public class SwaggerConfig {
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
PUT
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
globalResponseMessage
(
RequestMethod
.
DELETE
,
responseBuilder
())
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.datax.service.system.controller"
))
//扫描该包下面的API注解
//扫描该包下面的API注解
.
apis
(
RequestHandlerSelectors
.
basePackage
(
swaggerProperties
.
getBasePackage
()))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
build
()
//设置安全认证
//设置安全认证
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
...
@@ -55,9 +61,11 @@ public class SwaggerConfig {
*/
*/
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"系统管理中心"
)
//接口管理文档首页显示
.
title
(
swaggerProperties
.
getTitle
())
.
description
(
"系统管理中心接口文档"
)
//API的描述
.
description
(
swaggerProperties
.
getDescription
())
.
version
(
"1.0"
)
.
termsOfServiceUrl
(
swaggerProperties
.
getTermsOfServiceUrl
())
.
version
(
swaggerProperties
.
getVersion
())
.
contact
(
new
Contact
(
swaggerProperties
.
getContact
().
getName
(),
swaggerProperties
.
getContact
().
getUrl
(),
swaggerProperties
.
getContact
().
getEmail
()))
.
build
();
.
build
();
}
}
...
...
datax-modules/system-service-parent/system-service/src/main/java/cn/datax/service/system/config/SwaggerProperties.java
0 → 100644
View file @
fb208eba
package
cn
.
datax
.
service
.
system
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
ignoreUnknownFields
=
false
,
prefix
=
"swagger"
)
public
class
SwaggerProperties
{
private
String
title
;
private
String
description
;
private
String
version
;
private
String
termsOfServiceUrl
;
private
String
basePackage
;
private
Contact
contact
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getTermsOfServiceUrl
()
{
return
termsOfServiceUrl
;
}
public
void
setTermsOfServiceUrl
(
String
termsOfServiceUrl
)
{
this
.
termsOfServiceUrl
=
termsOfServiceUrl
;
}
public
String
getBasePackage
()
{
return
basePackage
;
}
public
void
setBasePackage
(
String
basePackage
)
{
this
.
basePackage
=
basePackage
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
static
class
Contact
{
private
String
name
;
private
String
url
;
private
String
email
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
}
pom.xml
View file @
fb208eba
...
@@ -30,8 +30,8 @@
...
@@ -30,8 +30,8 @@
<spring-cloud.version>
Hoxton.SR4
</spring-cloud.version>
<spring-cloud.version>
Hoxton.SR4
</spring-cloud.version>
<spring-boot-admin.version>
2.2.3
</spring-boot-admin.version>
<spring-boot-admin.version>
2.2.3
</spring-boot-admin.version>
<fastjson.version>
1.2.
68
</fastjson.version>
<fastjson.version>
1.2.
72
</fastjson.version>
<hutool.version>
5.3.
5
</hutool.version>
<hutool.version>
5.3.
9
</hutool.version>
<mybatis-plus.version>
3.3.1
</mybatis-plus.version>
<mybatis-plus.version>
3.3.1
</mybatis-plus.version>
<dynamic-datasource.version>
2.5.7
</dynamic-datasource.version>
<dynamic-datasource.version>
2.5.7
</dynamic-datasource.version>
<p6spy.version>
3.8.7
</p6spy.version>
<p6spy.version>
3.8.7
</p6spy.version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment