Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
d9bf06d8
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
704
Star
9572
Fork
3514
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d9bf06d8
编写于
5月 23, 2019
作者:
L
lidongdai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加api文档
上级
bb1fa37e
变更
32
展开全部
隐藏空白更改
内联
并排
Showing
32 changed file
with
780 addition
and
1035 deletion
+780
-1035
escheduler-api/pom.xml
escheduler-api/pom.xml
+0
-6
escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java
...ava/cn/escheduler/api/configuration/AppConfiguration.java
+7
-5
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java
...uler/api/configuration/SwaggerApiImplicitParamPlugin.java
+0
-109
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java
...ler/api/configuration/SwaggerApiImplicitParamsPlugin.java
+0
-71
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java
...n/escheduler/api/configuration/SwaggerApiModelPlugin.java
+0
-74
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java
...uler/api/configuration/SwaggerApiModelPropertyPlugin.java
+0
-219
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java
...cheduler/api/configuration/SwaggerApiOperationPlugin.java
+0
-141
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java
...n/escheduler/api/configuration/SwaggerApiParamPlugin.java
+0
-115
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java
...ava/cn/escheduler/api/configuration/SwaggerApiPlugin.java
+0
-74
escheduler-api/src/main/java/cn/escheduler/api/controller/AccessTokenController.java
...a/cn/escheduler/api/controller/AccessTokenController.java
+19
-3
escheduler-api/src/main/java/cn/escheduler/api/controller/AlertGroupController.java
...va/cn/escheduler/api/controller/AlertGroupController.java
+5
-0
escheduler-api/src/main/java/cn/escheduler/api/controller/DataAnalysisController.java
.../cn/escheduler/api/controller/DataAnalysisController.java
+2
-0
escheduler-api/src/main/java/cn/escheduler/api/controller/DataSourceController.java
...va/cn/escheduler/api/controller/DataSourceController.java
+89
-11
escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java
...java/cn/escheduler/api/controller/ExecutorController.java
+2
-0
escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java
...n/java/cn/escheduler/api/controller/LoggerController.java
+5
-5
escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java
...in/java/cn/escheduler/api/controller/LoginController.java
+6
-3
escheduler-api/src/main/java/cn/escheduler/api/controller/MonitorController.java
.../java/cn/escheduler/api/controller/MonitorController.java
+14
-4
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java
...scheduler/api/controller/ProcessDefinitionController.java
+10
-10
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java
.../escheduler/api/controller/ProcessInstanceController.java
+11
-11
escheduler-api/src/main/java/cn/escheduler/api/controller/ProjectController.java
.../java/cn/escheduler/api/controller/ProjectController.java
+46
-7
escheduler-api/src/main/java/cn/escheduler/api/controller/QueueController.java
...in/java/cn/escheduler/api/controller/QueueController.java
+35
-5
escheduler-api/src/main/java/cn/escheduler/api/controller/ResourcesController.java
...ava/cn/escheduler/api/controller/ResourcesController.java
+151
-25
escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java
...ava/cn/escheduler/api/controller/SchedulerController.java
+14
-14
escheduler-api/src/main/java/cn/escheduler/api/controller/ServerController.java
...n/java/cn/escheduler/api/controller/ServerController.java
+0
-85
escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java
.../cn/escheduler/api/controller/TaskInstanceController.java
+3
-3
escheduler-api/src/main/java/cn/escheduler/api/controller/TaskRecordController.java
...va/cn/escheduler/api/controller/TaskRecordController.java
+9
-3
escheduler-api/src/main/java/cn/escheduler/api/controller/TenantController.java
...n/java/cn/escheduler/api/controller/TenantController.java
+45
-6
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
...in/java/cn/escheduler/api/controller/UsersController.java
+15
-15
escheduler-api/src/main/java/cn/escheduler/api/controller/WorkerGroupController.java
...a/cn/escheduler/api/controller/WorkerGroupController.java
+2
-0
escheduler-api/src/main/resources/messages.properties
escheduler-api/src/main/resources/messages.properties
+99
-6
escheduler-api/src/main/resources/messages_en_US.properties
escheduler-api/src/main/resources/messages_en_US.properties
+98
-5
escheduler-api/src/main/resources/messages_zh_CN.properties
escheduler-api/src/main/resources/messages_zh_CN.properties
+93
-0
未找到文件。
escheduler-api/pom.xml
浏览文件 @
d9bf06d8
...
...
@@ -168,12 +168,6 @@
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
io.swagger
</groupId>
<artifactId>
swagger-jaxrs
</artifactId>
<version>
1.5.12
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java
浏览文件 @
d9bf06d8
...
...
@@ -19,8 +19,8 @@ package cn.escheduler.api.configuration;
import
cn.escheduler.api.interceptor.LoginHandlerInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.*
;
import
org.springframework.web.servlet.LocaleResolver
;
import
org.springframework.web.servlet.config.annotation.*
;
import
org.springframework.web.servlet.i18n.CookieLocaleResolver
;
import
org.springframework.web.servlet.i18n.LocaleChangeInterceptor
;
...
...
@@ -49,12 +49,12 @@ public class AppConfiguration implements WebMvcConfigurer {
/**
* Cookie
*/
@Bean
@Bean
(
name
=
"localeResolver"
)
public
LocaleResolver
localeResolver
()
{
CookieLocaleResolver
localeResolver
=
new
CookieLocaleResolver
();
localeResolver
.
setCookieName
(
LOCALE_LANGUAGE_COOKIE
);
/** set default locale **/
localeResolver
.
setDefaultLocale
(
Locale
.
ENGLISH
);
localeResolver
.
setDefaultLocale
(
Locale
.
US
);
/** set cookie max age **/
localeResolver
.
setCookieMaxAge
(
COOKIE_MAX_AGE
);
return
localeResolver
;
...
...
@@ -64,7 +64,7 @@ public class AppConfiguration implements WebMvcConfigurer {
public
LocaleChangeInterceptor
localeChangeInterceptor
()
{
LocaleChangeInterceptor
lci
=
new
LocaleChangeInterceptor
();
/** **/
lci
.
setParamName
(
"lang"
);
lci
.
setParamName
(
"lang
uage
"
);
return
lci
;
}
...
...
@@ -72,14 +72,16 @@ public class AppConfiguration implements WebMvcConfigurer {
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
loginInterceptor
()).
addPathPatterns
(
LOGIN_INTERCEPTOR_PATH_PATTERN
).
excludePathPatterns
(
LOGIN_PATH_PATTERN
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/v2/**"
,
"/doc.html"
,
"*.html"
);
//i18n
registry
.
addInterceptor
(
localeChangeInterceptor
());
registry
.
addInterceptor
(
loginInterceptor
()).
addPathPatterns
(
LOGIN_INTERCEPTOR_PATH_PATTERN
).
excludePathPatterns
(
LOGIN_PATH_PATTERN
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/v2/**"
,
"/doc.html"
,
"*.html"
);
}
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"classpath:/static/"
);
registry
.
addResourceHandler
(
"doc.html"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/webjars/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
}
...
...
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.api.configuration
;
import
com.google.common.base.MoreObjects
;
import
com.google.common.base.Optional
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiImplicitParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.builders.ParameterBuilder
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.AllowableValues
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.OperationContext
;
import
springfox.documentation.spring.web.DescriptionResolver
;
import
springfox.documentation.swagger.common.SwaggerPluginSupport
;
import
java.util.List
;
import
java.util.Locale
;
import
static
com
.
google
.
common
.
base
.
Strings
.
emptyToNull
;
import
static
springfox
.
documentation
.
schema
.
Types
.
isBaseType
;
import
static
springfox
.
documentation
.
swagger
.
common
.
SwaggerPluginSupport
.
SWAGGER_PLUGIN_ORDER
;
import
static
springfox
.
documentation
.
swagger
.
readers
.
parameter
.
Examples
.
examples
;
import
static
springfox
.
documentation
.
swagger
.
schema
.
ApiModelProperties
.
allowableValueFromString
;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiImplicitParamPlugin
implements
OperationBuilderPlugin
{
@Autowired
private
DescriptionResolver
descriptions
;
@Autowired
private
MessageSource
messageSource
;
static
Parameter
implicitParameter
(
MessageSource
messageSource
,
DescriptionResolver
descriptions
,
ApiImplicitParam
param
)
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
ModelRef
modelRef
=
maybeGetModelRef
(
param
);
return
new
ParameterBuilder
()
.
name
(
param
.
name
())
.
description
(
descriptions
.
resolve
(
messageSource
.
getMessage
(
param
.
value
(),
null
,
locale
)))
.
defaultValue
(
param
.
defaultValue
())
.
required
(
param
.
required
())
.
allowMultiple
(
param
.
allowMultiple
())
.
modelRef
(
modelRef
)
.
allowableValues
(
allowableValueFromString
(
param
.
allowableValues
()))
.
parameterType
(
emptyToNull
(
param
.
paramType
()))
.
parameterAccess
(
param
.
access
())
.
order
(
SWAGGER_PLUGIN_ORDER
)
.
scalarExample
(
param
.
example
())
.
complexExamples
(
examples
(
param
.
examples
()))
.
build
();
}
private
static
ModelRef
maybeGetModelRef
(
ApiImplicitParam
param
)
{
String
dataType
=
MoreObjects
.
firstNonNull
(
emptyToNull
(
param
.
dataType
()),
"string"
);
AllowableValues
allowableValues
=
null
;
if
(
isBaseType
(
dataType
))
{
allowableValues
=
allowableValueFromString
(
param
.
allowableValues
());
}
if
(
param
.
allowMultiple
())
{
return
new
ModelRef
(
""
,
new
ModelRef
(
dataType
,
allowableValues
));
}
return
new
ModelRef
(
dataType
,
allowableValues
);
}
@Override
public
void
apply
(
OperationContext
context
)
{
context
.
operationBuilder
().
parameters
(
readParameters
(
context
));
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
SwaggerPluginSupport
.
pluginDoesApply
(
delimiter
);
}
private
List
<
Parameter
>
readParameters
(
OperationContext
context
)
{
Optional
<
ApiImplicitParam
>
annotation
=
context
.
findAnnotation
(
ApiImplicitParam
.
class
);
List
<
Parameter
>
parameters
=
Lists
.
newArrayList
();
if
(
annotation
.
isPresent
())
{
parameters
.
add
(
implicitParameter
(
messageSource
,
descriptions
,
annotation
.
get
()));
}
return
parameters
;
}
}
\ No newline at end of file
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.api.configuration
;
import
com.google.common.base.Optional
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.OperationContext
;
import
springfox.documentation.spring.web.DescriptionResolver
;
import
java.util.List
;
import
static
springfox
.
documentation
.
swagger
.
common
.
SwaggerPluginSupport
.
pluginDoesApply
;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiImplicitParamsPlugin
implements
OperationBuilderPlugin
{
@Autowired
private
DescriptionResolver
descriptions
;
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
OperationContext
context
)
{
context
.
operationBuilder
().
parameters
(
readParameters
(
context
));
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
pluginDoesApply
(
delimiter
);
}
private
List
<
Parameter
>
readParameters
(
OperationContext
context
)
{
Optional
<
ApiImplicitParams
>
annotation
=
context
.
findAnnotation
(
ApiImplicitParams
.
class
);
List
<
Parameter
>
parameters
=
Lists
.
newArrayList
();
if
(
annotation
.
isPresent
())
{
for
(
ApiImplicitParam
param
:
annotation
.
get
().
value
())
{
parameters
.
add
(
SwaggerApiImplicitParamPlugin
.
implicitParameter
(
messageSource
,
descriptions
,
param
));
}
}
return
parameters
;
}
}
\ No newline at end of file
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
package
cn.escheduler.api.configuration
;
import
com.fasterxml.classmate.TypeResolver
;
import
io.swagger.annotations.ApiModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.schema.ModelReference
;
import
springfox.documentation.schema.TypeNameExtractor
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.schema.ModelBuilderPlugin
;
import
springfox.documentation.spi.schema.contexts.ModelContext
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
import
static
springfox
.
documentation
.
schema
.
ResolvedTypes
.*;
import
static
springfox
.
documentation
.
swagger
.
common
.
SwaggerPluginSupport
.*;
/**
* NOTE : not useful
*/
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiModelPlugin
implements
ModelBuilderPlugin
{
@Autowired
private
TypeResolver
typeResolver
;
@Autowired
private
TypeNameExtractor
typeNameExtractor
;
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
ModelContext
context
)
{
ApiModel
annotation
=
AnnotationUtils
.
findAnnotation
(
forClass
(
context
),
ApiModel
.
class
);
if
(
annotation
!=
null
)
{
List
<
ModelReference
>
modelRefs
=
new
ArrayList
<
ModelReference
>();
for
(
Class
<?>
each
:
annotation
.
subTypes
())
{
modelRefs
.
add
(
modelRefFactory
(
context
,
typeNameExtractor
)
.
apply
(
typeResolver
.
resolve
(
each
)));
}
Locale
locale
=
LocaleContextHolder
.
getLocale
();
context
.
getBuilder
()
.
description
(
messageSource
.
getMessage
(
annotation
.
description
(),
null
,
locale
))
.
discriminator
(
annotation
.
discriminator
())
.
subTypes
(
modelRefs
);
}
}
private
Class
<?>
forClass
(
ModelContext
context
)
{
return
typeResolver
.
resolve
(
context
.
getType
()).
getErasedType
();
}
// @Override
// public boolean supports(DocumentationType delimiter) {
// return pluginDoesApply(delimiter);
// }
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
true
;
}
}
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
package
cn.escheduler.api.configuration
;
import
com.fasterxml.classmate.ResolvedType
;
import
com.fasterxml.classmate.TypeResolver
;
import
com.google.common.base.Function
;
import
com.google.common.base.Optional
;
import
com.google.common.base.Splitter
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.service.AllowableListValues
;
import
springfox.documentation.service.AllowableRangeValues
;
import
springfox.documentation.service.AllowableValues
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.schema.ModelPropertyBuilderPlugin
;
import
springfox.documentation.spi.schema.contexts.ModelPropertyContext
;
import
springfox.documentation.spring.web.DescriptionResolver
;
import
springfox.documentation.swagger.common.SwaggerPluginSupport
;
import
springfox.documentation.swagger.schema.ApiModelProperties
;
import
java.lang.reflect.AnnotatedElement
;
import
java.lang.reflect.Method
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
import
static
org
.
springframework
.
util
.
StringUtils
.
hasText
;
import
static
springfox
.
documentation
.
schema
.
Annotations
.*;
import
static
springfox
.
documentation
.
swagger
.
schema
.
ApiModelProperties
.*;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiModelPropertyPlugin
implements
ModelPropertyBuilderPlugin
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ApiModelProperties
.
class
);
private
static
final
Pattern
RANGE_PATTERN
=
Pattern
.
compile
(
"range([\\[(])(.*),(.*)([])])$"
);
@Autowired
private
DescriptionResolver
descriptions
;
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
ModelPropertyContext
context
)
{
Optional
<
ApiModelProperty
>
annotation
=
Optional
.
absent
();
if
(
context
.
getAnnotatedElement
().
isPresent
())
{
annotation
=
annotation
.
or
(
findApiModePropertyAnnotation
(
context
.
getAnnotatedElement
().
get
()));
}
if
(
context
.
getBeanPropertyDefinition
().
isPresent
())
{
annotation
=
annotation
.
or
(
findPropertyAnnotation
(
context
.
getBeanPropertyDefinition
().
get
(),
ApiModelProperty
.
class
));
}
if
(
annotation
.
isPresent
())
{
context
.
getBuilder
()
.
allowableValues
(
annotation
.
transform
(
toAllowableValues
()).
orNull
())
.
required
(
annotation
.
transform
(
toIsRequired
()).
or
(
false
))
.
readOnly
(
annotation
.
transform
(
toIsReadOnly
()).
or
(
false
))
.
description
(
annotation
.
transform
(
toDescription
(
descriptions
)).
orNull
())
.
isHidden
(
annotation
.
transform
(
toHidden
()).
or
(
false
))
.
type
(
annotation
.
transform
(
toType
(
context
.
getResolver
())).
orNull
())
.
position
(
annotation
.
transform
(
toPosition
()).
or
(
0
))
.
example
(
annotation
.
transform
(
toExample
()).
orNull
());
}
}
static
Function
<
ApiModelProperty
,
AllowableValues
>
toAllowableValues
()
{
return
new
Function
<
ApiModelProperty
,
AllowableValues
>()
{
@Override
public
AllowableValues
apply
(
ApiModelProperty
annotation
)
{
return
allowableValueFromString
(
annotation
.
allowableValues
());
}
};
}
public
static
AllowableValues
allowableValueFromString
(
String
allowableValueString
)
{
AllowableValues
allowableValues
=
new
AllowableListValues
(
Lists
.<
String
>
newArrayList
(),
"LIST"
);
String
trimmed
=
allowableValueString
.
trim
();
Matcher
matcher
=
RANGE_PATTERN
.
matcher
(
trimmed
.
replaceAll
(
" "
,
""
));
if
(
matcher
.
matches
())
{
if
(
matcher
.
groupCount
()
!=
4
)
{
LOGGER
.
warn
(
"Unable to parse range specified {} correctly"
,
trimmed
);
}
else
{
allowableValues
=
new
AllowableRangeValues
(
matcher
.
group
(
2
).
contains
(
"infinity"
)
?
null
:
matcher
.
group
(
2
),
matcher
.
group
(
1
).
equals
(
"("
),
matcher
.
group
(
3
).
contains
(
"infinity"
)
?
null
:
matcher
.
group
(
3
),
matcher
.
group
(
4
).
equals
(
")"
));
}
}
else
if
(
trimmed
.
contains
(
","
))
{
Iterable
<
String
>
split
=
Splitter
.
on
(
','
).
trimResults
().
omitEmptyStrings
().
split
(
trimmed
);
allowableValues
=
new
AllowableListValues
(
newArrayList
(
split
),
"LIST"
);
}
else
if
(
hasText
(
trimmed
))
{
List
<
String
>
singleVal
=
Collections
.
singletonList
(
trimmed
);
allowableValues
=
new
AllowableListValues
(
singleVal
,
"LIST"
);
}
return
allowableValues
;
}
static
Function
<
ApiModelProperty
,
Boolean
>
toIsRequired
()
{
return
new
Function
<
ApiModelProperty
,
Boolean
>()
{
@Override
public
Boolean
apply
(
ApiModelProperty
annotation
)
{
return
annotation
.
required
();
}
};
}
static
Function
<
ApiModelProperty
,
Integer
>
toPosition
()
{
return
new
Function
<
ApiModelProperty
,
Integer
>()
{
@Override
public
Integer
apply
(
ApiModelProperty
annotation
)
{
return
annotation
.
position
();
}
};
}
static
Function
<
ApiModelProperty
,
Boolean
>
toIsReadOnly
()
{
return
new
Function
<
ApiModelProperty
,
Boolean
>()
{
@Override
public
Boolean
apply
(
ApiModelProperty
annotation
)
{
return
annotation
.
readOnly
();
}
};
}
static
Function
<
ApiModelProperty
,
Boolean
>
toAllowEmptyValue
()
{
return
new
Function
<
ApiModelProperty
,
Boolean
>()
{
@Override
public
Boolean
apply
(
ApiModelProperty
annotation
)
{
return
annotation
.
allowEmptyValue
();
}
};
}
Function
<
ApiModelProperty
,
String
>
toDescription
(
final
DescriptionResolver
descriptions
)
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
return
new
Function
<
ApiModelProperty
,
String
>()
{
@Override
public
String
apply
(
ApiModelProperty
annotation
)
{
String
description
=
""
;
if
(!
Strings
.
isNullOrEmpty
(
annotation
.
value
()))
{
description
=
messageSource
.
getMessage
(
annotation
.
value
(),
null
,
""
,
locale
);
}
else
if
(!
Strings
.
isNullOrEmpty
(
annotation
.
notes
()))
{
description
=
messageSource
.
getMessage
(
annotation
.
notes
(),
null
,
""
,
locale
);
}
return
descriptions
.
resolve
(
description
);
}
};
}
static
Function
<
ApiModelProperty
,
ResolvedType
>
toType
(
final
TypeResolver
resolver
)
{
return
new
Function
<
ApiModelProperty
,
ResolvedType
>()
{
@Override
public
ResolvedType
apply
(
ApiModelProperty
annotation
)
{
try
{
return
resolver
.
resolve
(
Class
.
forName
(
annotation
.
dataType
()));
}
catch
(
ClassNotFoundException
e
)
{
return
resolver
.
resolve
(
Object
.
class
);
}
}
};
}
public
static
Optional
<
ApiModelProperty
>
findApiModePropertyAnnotation
(
AnnotatedElement
annotated
)
{
Optional
<
ApiModelProperty
>
annotation
=
Optional
.
absent
();
if
(
annotated
instanceof
Method
)
{
// If the annotated element is a method we can use this information to check superclasses as well
annotation
=
Optional
.
fromNullable
(
AnnotationUtils
.
findAnnotation
(((
Method
)
annotated
),
ApiModelProperty
.
class
));
}
return
annotation
.
or
(
Optional
.
fromNullable
(
AnnotationUtils
.
getAnnotation
(
annotated
,
ApiModelProperty
.
class
)));
}
static
Function
<
ApiModelProperty
,
Boolean
>
toHidden
()
{
return
new
Function
<
ApiModelProperty
,
Boolean
>()
{
@Override
public
Boolean
apply
(
ApiModelProperty
annotation
)
{
return
annotation
.
hidden
();
}
};
}
static
Function
<
ApiModelProperty
,
String
>
toExample
()
{
return
new
Function
<
ApiModelProperty
,
String
>()
{
@Override
public
String
apply
(
ApiModelProperty
annotation
)
{
String
example
=
""
;
if
(!
Strings
.
isNullOrEmpty
(
annotation
.
example
()))
{
example
=
annotation
.
example
();
}
return
example
;
}
};
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
SwaggerPluginSupport
.
pluginDoesApply
(
delimiter
);
}
}
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
package
cn.escheduler.api.configuration
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
import
com.google.common.base.Function
;
import
com.google.common.base.Optional
;
import
com.google.common.base.Splitter
;
import
com.google.common.collect.Sets
;
import
io.swagger.annotations.Api
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.util.StringUtils
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.OperationContext
;
import
springfox.documentation.spring.web.DescriptionResolver
;
import
springfox.documentation.spring.web.readers.operation.DefaultTagsProvider
;
import
springfox.documentation.swagger.common.SwaggerPluginSupport
;
import
static
com
.
google
.
common
.
base
.
Strings
.
nullToEmpty
;
import
static
com
.
google
.
common
.
collect
.
FluentIterable
.
from
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
import
static
com
.
google
.
common
.
collect
.
Sets
.*;
import
static
springfox
.
documentation
.
service
.
Tags
.
emptyTags
;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiOperationPlugin
implements
OperationBuilderPlugin
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SwaggerApiOperationPlugin
.
class
);
@Autowired
private
DescriptionResolver
descriptions
;
@Autowired
private
DefaultTagsProvider
tagsProvider
;
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
OperationContext
context
)
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
Set
<
String
>
defaultTags
=
tagsProvider
.
tags
(
context
);
Sets
.
SetView
<
String
>
tags
=
union
(
operationTags
(
context
),
controllerTags
(
context
));
if
(
tags
.
isEmpty
())
{
context
.
operationBuilder
().
tags
(
defaultTags
);
}
else
{
context
.
operationBuilder
().
tags
(
tags
);
}
Optional
<
ApiOperation
>
apiOperationAnnotation
=
context
.
findAnnotation
(
ApiOperation
.
class
);
if
(
apiOperationAnnotation
.
isPresent
())
{
ApiOperation
operation
=
apiOperationAnnotation
.
get
();
if
(
StringUtils
.
hasText
(
operation
.
nickname
()))
{
// Populate the value of nickname annotation into uniqueId
context
.
operationBuilder
().
uniqueId
(
operation
.
nickname
());
context
.
operationBuilder
().
codegenMethodNameStem
(
operation
.
nickname
());
}
if
(
StringUtils
.
hasText
(
apiOperationAnnotation
.
get
().
notes
()))
{
context
.
operationBuilder
().
notes
(
descriptions
.
resolve
(
messageSource
.
getMessage
(
apiOperationAnnotation
.
get
().
notes
(),
null
,
""
,
locale
)));
}
if
(
apiOperationAnnotation
.
get
().
position
()
>
0
)
{
context
.
operationBuilder
().
position
(
apiOperationAnnotation
.
get
().
position
());
}
if
(
StringUtils
.
hasText
(
apiOperationAnnotation
.
get
().
value
()))
{
context
.
operationBuilder
().
summary
(
descriptions
.
resolve
(
apiOperationAnnotation
.
get
().
value
()));
}
context
.
operationBuilder
().
consumes
(
asSet
(
nullToEmpty
(
apiOperationAnnotation
.
get
().
consumes
())));
context
.
operationBuilder
().
produces
(
asSet
(
nullToEmpty
(
apiOperationAnnotation
.
get
().
produces
())));
}
}
private
Set
<
String
>
controllerTags
(
OperationContext
context
)
{
Optional
<
Api
>
controllerAnnotation
=
context
.
findControllerAnnotation
(
Api
.
class
);
return
controllerAnnotation
.
transform
(
tagsFromController
()).
or
(
Sets
.<
String
>
newHashSet
());
}
private
Set
<
String
>
operationTags
(
OperationContext
context
)
{
Optional
<
ApiOperation
>
annotation
=
context
.
findAnnotation
(
ApiOperation
.
class
);
return
annotation
.
transform
(
tagsFromOperation
()).
or
(
Sets
.<
String
>
newHashSet
());
}
private
Function
<
ApiOperation
,
Set
<
String
>>
tagsFromOperation
()
{
return
new
Function
<
ApiOperation
,
Set
<
String
>>()
{
@Override
public
Set
<
String
>
apply
(
ApiOperation
input
)
{
Set
<
String
>
tags
=
newTreeSet
();
tags
.
addAll
(
from
(
newArrayList
(
input
.
tags
())).
filter
(
emptyTags
()).
toSet
());
return
tags
;
}
};
}
private
Function
<
Api
,
Set
<
String
>>
tagsFromController
()
{
return
new
Function
<
Api
,
Set
<
String
>>()
{
@Override
public
Set
<
String
>
apply
(
Api
input
)
{
Set
<
String
>
tags
=
newTreeSet
();
tags
.
addAll
(
from
(
newArrayList
(
input
.
tags
())).
filter
(
emptyTags
()).
toSet
());
return
tags
;
}
};
}
private
Set
<
String
>
asSet
(
String
mediaTypes
)
{
return
newHashSet
(
Splitter
.
on
(
','
)
.
trimResults
()
.
omitEmptyStrings
()
.
splitToList
(
mediaTypes
));
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
SwaggerPluginSupport
.
pluginDoesApply
(
delimiter
);
// return true;
}
}
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
/*
*
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package
cn.escheduler.api.configuration
;
import
com.fasterxml.classmate.ResolvedType
;
import
com.google.common.base.Function
;
import
com.google.common.base.Optional
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.schema.Collections
;
import
springfox.documentation.schema.Enums
;
import
springfox.documentation.schema.Example
;
import
springfox.documentation.service.AllowableValues
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.schema.EnumTypeDeterminer
;
import
springfox.documentation.spi.service.ParameterBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.ParameterContext
;
import
springfox.documentation.spring.web.DescriptionResolver
;
import
springfox.documentation.swagger.schema.ApiModelProperties
;
import
java.util.Locale
;
import
static
com
.
google
.
common
.
base
.
Strings
.
emptyToNull
;
import
static
com
.
google
.
common
.
base
.
Strings
.
isNullOrEmpty
;
import
static
springfox
.
documentation
.
swagger
.
common
.
SwaggerPluginSupport
.
SWAGGER_PLUGIN_ORDER
;
import
static
springfox
.
documentation
.
swagger
.
common
.
SwaggerPluginSupport
.
pluginDoesApply
;
import
static
springfox
.
documentation
.
swagger
.
readers
.
parameter
.
Examples
.
examples
;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiParamPlugin
implements
ParameterBuilderPlugin
{
@Autowired
private
DescriptionResolver
descriptions
;
@Autowired
private
EnumTypeDeterminer
enumTypeDeterminer
;
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
ParameterContext
context
)
{
Optional
<
ApiParam
>
apiParam
=
context
.
resolvedMethodParameter
().
findAnnotation
(
ApiParam
.
class
);
context
.
parameterBuilder
()
.
allowableValues
(
allowableValues
(
context
.
alternateFor
(
context
.
resolvedMethodParameter
().
getParameterType
()),
apiParam
.
transform
(
toAllowableValue
()).
or
(
""
)));
if
(
apiParam
.
isPresent
())
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
ApiParam
annotation
=
apiParam
.
get
();
context
.
parameterBuilder
().
name
(
emptyToNull
(
annotation
.
name
()))
.
description
(
emptyToNull
(
descriptions
.
resolve
(
messageSource
.
getMessage
(
annotation
.
value
(),
null
,
""
,
locale
))))
.
parameterAccess
(
emptyToNull
(
annotation
.
access
()))
.
defaultValue
(
emptyToNull
(
annotation
.
defaultValue
()))
.
allowMultiple
(
annotation
.
allowMultiple
())
.
allowEmptyValue
(
annotation
.
allowEmptyValue
())
.
required
(
annotation
.
required
())
.
scalarExample
(
new
Example
(
annotation
.
example
()))
.
complexExamples
(
examples
(
annotation
.
examples
()))
.
hidden
(
annotation
.
hidden
())
.
collectionFormat
(
annotation
.
collectionFormat
())
.
order
(
SWAGGER_PLUGIN_ORDER
);
}
}
private
Function
<
ApiParam
,
String
>
toAllowableValue
()
{
return
new
Function
<
ApiParam
,
String
>()
{
@Override
public
String
apply
(
ApiParam
input
)
{
return
input
.
allowableValues
();
}
};
}
private
AllowableValues
allowableValues
(
ResolvedType
parameterType
,
String
allowableValueString
)
{
AllowableValues
allowableValues
=
null
;
if
(!
isNullOrEmpty
(
allowableValueString
))
{
allowableValues
=
ApiModelProperties
.
allowableValueFromString
(
allowableValueString
);
}
else
{
if
(
enumTypeDeterminer
.
isEnum
(
parameterType
.
getErasedType
()))
{
allowableValues
=
Enums
.
allowableValues
(
parameterType
.
getErasedType
());
}
if
(
Collections
.
isContainerType
(
parameterType
))
{
allowableValues
=
Enums
.
allowableValues
(
Collections
.
collectionElementType
(
parameterType
).
getErasedType
());
}
}
return
allowableValues
;
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
pluginDoesApply
(
delimiter
);
}
}
escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.api.configuration
;
import
io.swagger.annotations.Api
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.OperationContext
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
-
10
)
public
class
SwaggerApiPlugin
implements
OperationBuilderPlugin
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SwaggerApiPlugin
.
class
);
@Autowired
private
MessageSource
messageSource
;
@Override
public
void
apply
(
OperationContext
context
)
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
List
<
Api
>
list
=
context
.
findAllAnnotations
(
Api
.
class
);
if
(
list
.
size
()
>
0
)
{
Api
api
=
list
.
get
(
0
);
Set
<
String
>
tagsSet
=
new
HashSet
<>(
1
);
if
(
api
.
tags
()
!=
null
&&
api
.
tags
().
length
>
0
){
tagsSet
.
add
(
StringUtils
.
isNotBlank
(
api
.
tags
()[
0
])
?
messageSource
.
getMessage
(
api
.
tags
()[
0
],
null
,
locale
)
:
" "
);
}
context
.
operationBuilder
().
hidden
(
api
.
hidden
())
.
tags
(
tagsSet
).
build
();
}
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
true
;
}
}
escheduler-api/src/main/java/cn/escheduler/api/controller/AccessTokenController.java
浏览文件 @
d9bf06d8
...
...
@@ -23,11 +23,16 @@ import cn.escheduler.api.service.UsersService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -35,8 +40,9 @@ import static cn.escheduler.api.enums.Status.*;
/**
*
user
controller
*
access token
controller
*/
@Api
(
tags
=
"ACCESS_TOKEN_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"/access-token"
)
public
class
AccessTokenController
extends
BaseController
{
...
...
@@ -53,9 +59,10 @@ public class AccessTokenController extends BaseController{
* @param loginUser
* @return
*/
@ApiIgnore
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
createToken
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
createToken
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"userId"
)
int
userId
,
@RequestParam
(
value
=
"expireTime"
)
String
expireTime
,
@RequestParam
(
value
=
"token"
)
String
token
){
...
...
@@ -76,6 +83,7 @@ public class AccessTokenController extends BaseController{
* @param loginUser
* @return
*/
@ApiIgnore
@PostMapping
(
value
=
"/generate"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
generateToken
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
...
...
@@ -100,9 +108,15 @@ public class AccessTokenController extends BaseController{
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"queryAccessTokenList"
,
notes
=
"QUERY_ACCESS_TOKEN_LIST_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"20"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryAccessTokenList
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryAccessTokenList
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"searchVal"
,
required
=
false
)
String
searchVal
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
){
...
...
@@ -127,6 +141,7 @@ public class AccessTokenController extends BaseController{
* @param id
* @return
*/
@ApiIgnore
@PostMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
delAccessTokenById
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
...
...
@@ -147,6 +162,7 @@ public class AccessTokenController extends BaseController{
* @param loginUser
* @return
*/
@ApiIgnore
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
updateToken
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/AlertGroupController.java
浏览文件 @
d9bf06d8
...
...
@@ -26,12 +26,17 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
cn
.
escheduler
.
api
.
enums
.
Status
.*;
/**
* alert group controller
*/
@ApiIgnore
@RestController
@RequestMapping
(
"alert-group"
)
public
class
AlertGroupController
extends
BaseController
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/DataAnalysisController.java
浏览文件 @
d9bf06d8
...
...
@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -34,6 +35,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* data analysis controller
*/
@ApiIgnore
@RestController
@RequestMapping
(
"projects/analysis"
)
public
class
DataAnalysisController
extends
BaseController
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/DataSourceController.java
浏览文件 @
d9bf06d8
...
...
@@ -22,11 +22,16 @@ import cn.escheduler.api.utils.Constants;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.common.enums.DbType
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -36,6 +41,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* data source controller
*/
@Api
(
tags
=
"DATA_SOURCE_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"datasources"
)
public
class
DataSourceController
extends
BaseController
{
...
...
@@ -56,9 +62,21 @@ public class DataSourceController extends BaseController {
* @param other
* @return
*/
@ApiOperation
(
value
=
"createDataSource"
,
notes
=
"CREATE_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"DATA_SOURCE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"note"
,
value
=
"DATA_SOURCE_NOTE"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"DB_TYPE"
,
required
=
true
,
dataType
=
"DbType"
),
@ApiImplicitParam
(
name
=
"host"
,
value
=
"DATA_SOURCE_HOST"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"port"
,
value
=
"DATA_SOURCE_PORT"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"database"
,
value
=
"DATABASE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"PASSWORD"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"other"
,
value
=
"DATA_SOURCE_OTHER"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
createDataSource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
createDataSource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
value
=
"note"
,
required
=
false
)
String
note
,
@RequestParam
(
value
=
"type"
)
DbType
type
,
...
...
@@ -92,9 +110,22 @@ public class DataSourceController extends BaseController {
* @param other
* @return
*/
@ApiOperation
(
value
=
"updateDataSource"
,
notes
=
"UPDATE_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DATA_SOURCE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"DATA_SOURCE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"note"
,
value
=
"DATA_SOURCE_NOTE"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"DB_TYPE"
,
required
=
true
,
dataType
=
"DbType"
),
@ApiImplicitParam
(
name
=
"host"
,
value
=
"DATA_SOURCE_HOST"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"port"
,
value
=
"DATA_SOURCE_PORT"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"database"
,
value
=
"DATABASE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"PASSWORD"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"other"
,
value
=
"DATA_SOURCE_OTHER"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
updateDataSource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
updateDataSource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"id"
)
int
id
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
value
=
"note"
,
required
=
false
)
String
note
,
...
...
@@ -126,9 +157,14 @@ public class DataSourceController extends BaseController {
* @param id
* @return
*/
@ApiOperation
(
value
=
"queryDataSource"
,
notes
=
"QUERY_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DATA_SOURCE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@PostMapping
(
value
=
"/update-ui"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryDataSource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryDataSource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"id"
)
int
id
)
{
logger
.
info
(
"login user {}, query datasource: {}"
,
loginUser
.
getUserName
(),
id
);
...
...
@@ -149,9 +185,13 @@ public class DataSourceController extends BaseController {
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryDataSourceList"
,
notes
=
"QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"DB_TYPE"
,
required
=
true
,
dataType
=
"DbType"
)
})
@GetMapping
(
value
=
"/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryDataSourceList
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryDataSourceList
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"type"
)
DbType
type
)
{
try
{
Map
<
String
,
Object
>
result
=
dataSourceService
.
queryDataSourceList
(
loginUser
,
type
.
ordinal
());
...
...
@@ -171,9 +211,15 @@ public class DataSourceController extends BaseController {
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"queryDataSourceListPaging"
,
notes
=
"QUERY_DATA_SOURCE_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"20"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryDataSourceListPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryDataSourceListPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"searchVal"
,
required
=
false
)
String
searchVal
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
...
...
@@ -200,9 +246,21 @@ public class DataSourceController extends BaseController {
* @param other
* @return
*/
@ApiOperation
(
value
=
"connectDataSource"
,
notes
=
"CONNECT_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"DATA_SOURCE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"note"
,
value
=
"DATA_SOURCE_NOTE"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"DB_TYPE"
,
required
=
true
,
dataType
=
"DbType"
),
@ApiImplicitParam
(
name
=
"host"
,
value
=
"DATA_SOURCE_HOST"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"port"
,
value
=
"DATA_SOURCE_PORT"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"database"
,
value
=
"DATABASE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"PASSWORD"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"other"
,
value
=
"DATA_SOURCE_OTHER"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/connect"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
connectDataSource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
connectDataSource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
value
=
"note"
,
required
=
false
)
String
note
,
@RequestParam
(
value
=
"type"
)
DbType
type
,
...
...
@@ -237,9 +295,13 @@ public class DataSourceController extends BaseController {
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"connectionTest"
,
notes
=
"CONNECT_DATA_SOURCE_TEST_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DATA_SOURCE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/connect-by-id"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
connectionTest
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
connectionTest
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"id"
)
int
id
)
{
logger
.
info
(
"connection test, login user:{}, id:{}"
,
loginUser
.
getUserName
(),
id
);
...
...
@@ -267,9 +329,13 @@ public class DataSourceController extends BaseController {
* @param id datasource id
* @return
*/
@ApiOperation
(
value
=
"delete"
,
notes
=
"DELETE_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"DATA_SOURCE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
delete
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
delete
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"id"
)
int
id
)
{
try
{
logger
.
info
(
"delete datasource,login user:{}, id:{}"
,
loginUser
.
getUserName
(),
id
);
...
...
@@ -287,9 +353,13 @@ public class DataSourceController extends BaseController {
* @param name
* @return
*/
@ApiOperation
(
value
=
"verifyDataSourceName"
,
notes
=
"VERIFY_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"DATA_SOURCE_NAME"
,
required
=
true
,
dataType
=
"String"
)
})
@GetMapping
(
value
=
"/verify-name"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
verifyDataSourceName
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
verifyDataSourceName
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"name"
)
String
name
)
{
logger
.
info
(
"login user {}, verfiy datasource name: {}"
,
...
...
@@ -312,9 +382,13 @@ public class DataSourceController extends BaseController {
* @param userId
* @return
*/
@ApiOperation
(
value
=
"unauthDatasource"
,
notes
=
"UNAUTHORIZED_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/unauth-datasource"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
unauthDatasource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
unauthDatasource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"userId"
)
Integer
userId
)
{
try
{
logger
.
info
(
"unauthorized datasource, login user:{}, unauthorized userId:{}"
,
...
...
@@ -335,9 +409,13 @@ public class DataSourceController extends BaseController {
* @param userId
* @return
*/
@ApiOperation
(
value
=
"authedDatasource"
,
notes
=
"AUTHORIZED_DATA_SOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/authed-datasource"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
authedDatasource
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
authedDatasource
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"userId"
)
Integer
userId
)
{
try
{
logger
.
info
(
"authorized data source, login user:{}, authorized useId:{}"
,
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java
浏览文件 @
d9bf06d8
...
...
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -39,6 +40,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* execute task controller
*/
@ApiIgnore
@RestController
@RequestMapping
(
"projects/{projectName}/executors"
)
public
class
ExecutorController
extends
BaseController
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java
浏览文件 @
d9bf06d8
...
...
@@ -57,9 +57,9 @@ public class LoggerController extends BaseController {
*/
@ApiOperation
(
value
=
"queryLog"
,
notes
=
"QUERY_TASK_INSTANCE_LOG_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskInstId"
,
value
=
"TASK_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"skipLineNum"
,
value
=
"SKIP_LINE_NUM"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"LIMIT"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"taskInstId"
,
value
=
"TASK_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"skipLineNum"
,
value
=
"SKIP_LINE_NUM"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"LIMIT"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/detail"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -87,11 +87,11 @@ public class LoggerController extends BaseController {
*/
@ApiOperation
(
value
=
"downloadTaskLog"
,
notes
=
"DOWNLOAD_TASK_INSTANCE_LOG_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskInstId"
,
value
=
"TASK_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"taskInstId"
,
value
=
"TASK_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/download-log"
)
@ResponseBody
public
ResponseEntity
downloadTaskLog
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
ResponseEntity
downloadTaskLog
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"taskInstId"
)
int
taskInstanceId
)
{
try
{
byte
[]
logBytes
=
loggerService
.
getLogBytes
(
taskInstanceId
);
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java
浏览文件 @
d9bf06d8
...
...
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -36,6 +37,8 @@ import javax.servlet.http.Cookie;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Locale
;
import
static
cn
.
escheduler
.
api
.
enums
.
Status
.*;
/**
...
...
@@ -43,9 +46,9 @@ import static cn.escheduler.api.enums.Status.*;
*
* swagger bootstrap ui docs refer : https://doc.xiaominfo.com/guide/enh-func.html
*/
@Api
(
tags
=
"LOGIN_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
""
)
@Api
(
tags
=
"LOGIN_TAG"
,
position
=
1
)
public
class
LoginController
extends
BaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LoginController
.
class
);
...
...
@@ -69,8 +72,8 @@ public class LoginController extends BaseController {
*/
@ApiOperation
(
value
=
"login"
,
notes
=
"LOGIN_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
required
=
true
,
t
ype
=
"String"
),
@ApiImplicitParam
(
name
=
"userPassword"
,
value
=
"USER_PASSWORD"
,
required
=
true
,
t
ype
=
"String"
)
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
required
=
true
,
dataT
ype
=
"String"
),
@ApiImplicitParam
(
name
=
"userPassword"
,
value
=
"USER_PASSWORD"
,
required
=
true
,
dataT
ype
=
"String"
)
})
@PostMapping
(
value
=
"/login"
)
public
Result
login
(
@RequestParam
(
value
=
"userName"
)
String
userName
,
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/MonitorController.java
浏览文件 @
d9bf06d8
...
...
@@ -22,11 +22,16 @@ import cn.escheduler.api.service.ServerService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -36,6 +41,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* monitor controller
*/
@Api
(
tags
=
"MONITOR_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"/monitor"
)
public
class
MonitorController
extends
BaseController
{
...
...
@@ -53,9 +59,10 @@ public class MonitorController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"listMaster"
,
notes
=
"MASTER_LIST_NOTES"
)
@GetMapping
(
value
=
"/master/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listMaster
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
public
Result
listMaster
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query all master"
,
loginUser
.
getUserName
());
try
{
logger
.
info
(
"list master, user:{}"
,
loginUser
.
getUserName
());
...
...
@@ -73,9 +80,10 @@ public class MonitorController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"listWorker"
,
notes
=
"WORKER_LIST_NOTES"
)
@GetMapping
(
value
=
"/worker/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listWorker
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
public
Result
listWorker
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query all workers"
,
loginUser
.
getUserName
());
try
{
Map
<
String
,
Object
>
result
=
serverService
.
queryWorker
(
loginUser
);
...
...
@@ -92,9 +100,10 @@ public class MonitorController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryDatabaseState"
,
notes
=
"QUERY_DATABASE_STATE_NOTES"
)
@GetMapping
(
value
=
"/database"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryDatabaseState
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
public
Result
queryDatabaseState
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query database state"
,
loginUser
.
getUserName
());
try
{
...
...
@@ -112,9 +121,10 @@ public class MonitorController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryZookeeperState"
,
notes
=
"QUERY_ZOOKEEPER_STATE_NOTES"
)
@GetMapping
(
value
=
"/zookeeper/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryZookeeperState
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
public
Result
queryZookeeperState
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query zookeeper state"
,
loginUser
.
getUserName
());
try
{
Map
<
String
,
Object
>
result
=
monitorService
.
queryZookeeperState
(
loginUser
);
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java
浏览文件 @
d9bf06d8
...
...
@@ -130,7 +130,7 @@ public class ProcessDefinitionController extends BaseController{
@ApiOperation
(
value
=
"updateProccessDefinition"
,
notes
=
"UPDATE_PROCCESS_DEFINITION_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"PROCESS_DEFINITION_NAME"
,
required
=
true
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"processDefinitionJson"
,
value
=
"PROCESS_DEFINITION_JSON"
,
required
=
true
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"locations"
,
value
=
"PROCESS_DEFINITION_LOCATIONS"
,
required
=
true
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"connects"
,
value
=
"PROCESS_DEFINITION_CONNECTS"
,
required
=
true
,
type
=
"String"
),
...
...
@@ -172,8 +172,8 @@ public class ProcessDefinitionController extends BaseController{
@ApiOperation
(
value
=
"releaseProccessDefinition"
,
notes
=
"RELEASE_PROCCESS_DEFINITION_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"PROCESS_DEFINITION_NAME"
,
required
=
true
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"releaseState"
,
value
=
"PROCESS_DEFINITION_CONNECTS"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"releaseState"
,
value
=
"PROCESS_DEFINITION_CONNECTS"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
})
@PostMapping
(
value
=
"/release"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -204,7 +204,7 @@ public class ProcessDefinitionController extends BaseController{
*/
@ApiOperation
(
value
=
"queryProccessDefinitionById"
,
notes
=
"QUERY_PROCCESS_DEFINITION_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/select-by-id"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -258,10 +258,10 @@ public class ProcessDefinitionController extends BaseController{
*/
@ApiOperation
(
value
=
"queryProcessDefinitionListPaging"
,
notes
=
"QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
required
=
false
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
required
=
false
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
required
=
false
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -296,8 +296,8 @@ public class ProcessDefinitionController extends BaseController{
*/
@ApiOperation
(
value
=
"viewTree"
,
notes
=
"VIEW_TREE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"LIMIT"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"LIMIT"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/view-tree"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -327,7 +327,7 @@ public class ProcessDefinitionController extends BaseController{
*/
@ApiOperation
(
value
=
"getNodeListByDefinitionId"
,
notes
=
"GET_NODE_LIST_BY_DEFINITION_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"gen-task-list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java
浏览文件 @
d9bf06d8
...
...
@@ -60,14 +60,14 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"queryProcessInstanceList"
,
notes
=
"QUERY_PROCESS_INSTANCE_LIST_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"stateType"
,
value
=
"EXECUTION_STATUS"
,
type
=
"ExecutionStatus"
),
@ApiImplicitParam
(
name
=
"host"
,
value
=
"HOST"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"START_DATE"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"END_DATE"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -105,7 +105,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"queryTaskListByProcessId"
,
notes
=
"QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/task-list-by-process-id"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -139,7 +139,7 @@ public class ProcessInstanceController extends BaseController{
@ApiOperation
(
value
=
"updateProcessInstance"
,
notes
=
"UPDATE_PROCESS_INSTANCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceJson"
,
value
=
"PROCESS_INSTANCE_JSON"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"scheduleTime"
,
value
=
"SCHEDULE_TIME"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"syncDefine"
,
value
=
"SYNC_DEFINE"
,
type
=
"Boolean"
),
@ApiImplicitParam
(
name
=
"locations"
,
value
=
"PROCESS_INSTANCE_LOCATIONS"
,
type
=
"String"
),
...
...
@@ -182,7 +182,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"queryProcessInstanceById"
,
notes
=
"QUERY_PROCESS_INSTANCE_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/select-by-id"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -212,7 +212,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"deleteProcessInstanceById"
,
notes
=
"DELETE_PROCESS_INSTANCE_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -241,7 +241,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"querySubProcessInstanceByTaskId"
,
notes
=
"QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"TASK_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"TASK_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/select-sub-process"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -267,7 +267,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"queryParentInstanceBySubId"
,
notes
=
"QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"subId"
,
value
=
"SUB_PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"subId"
,
value
=
"SUB_PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/select-parent-process"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -292,7 +292,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"viewVariables"
,
notes
=
"QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/view-variables"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -317,7 +317,7 @@ public class ProcessInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"vieGanttTree"
,
notes
=
"VIEW_GANTT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
value
=
"/view-gantt"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ProjectController.java
浏览文件 @
d9bf06d8
...
...
@@ -22,11 +22,16 @@ import cn.escheduler.api.service.ProjectService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -35,6 +40,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* project controller
*/
@Api
(
tags
=
"PROJECT_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"projects"
)
public
class
ProjectController
extends
BaseController
{
...
...
@@ -52,9 +58,14 @@ public class ProjectController extends BaseController {
* @param desc
* @return returns an error if it exists
*/
@ApiOperation
(
value
=
"createProject"
,
notes
=
"CREATE_PROJECT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"PROJECT_NAME"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"desc"
,
value
=
"PROJECT_DESC"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
createProject
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
createProject
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"projectName"
)
String
projectName
,
@RequestParam
(
value
=
"desc"
,
required
=
false
)
String
desc
)
{
...
...
@@ -77,9 +88,15 @@ public class ProjectController extends BaseController {
* @param desc
* @return
*/
@ApiOperation
(
value
=
"updateProject"
,
notes
=
"UPDATE_PROJECT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"PROJECT_ID"
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"PROJECT_NAME"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"desc"
,
value
=
"PROJECT_DESC"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
updateProject
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
updateProject
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"projectId"
)
Integer
projectId
,
@RequestParam
(
"projectName"
)
String
projectName
,
@RequestParam
(
value
=
"desc"
,
required
=
false
)
String
desc
)
{
...
...
@@ -100,9 +117,13 @@ public class ProjectController extends BaseController {
* @param projectId
* @return
*/
@ApiOperation
(
value
=
"queryProjectById"
,
notes
=
"QUERY_PROJECT_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"PROJECT_ID"
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/query-by-id"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryProjectById
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryProjectById
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"projectId"
)
Integer
projectId
)
{
logger
.
info
(
"login user {}, query project by id: {}"
,
loginUser
.
getUserName
(),
projectId
);
...
...
@@ -124,9 +145,15 @@ public class ProjectController extends BaseController {
* @param pageNo
* @return
*/
@ApiOperation
(
value
=
"queryProjectListPaging"
,
notes
=
"QUERY_PROJECT_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"20"
),
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"1"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryProjectListPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryProjectListPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"searchVal"
,
required
=
false
)
String
searchVal
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
...
...
@@ -149,9 +176,13 @@ public class ProjectController extends BaseController {
* @param projectId
* @return
*/
@ApiOperation
(
value
=
"deleteProjectById"
,
notes
=
"DELETE_PROJECT_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"PROJECT_ID"
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
deleteProject
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
deleteProject
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"projectId"
)
Integer
projectId
)
{
...
...
@@ -172,9 +203,13 @@ public class ProjectController extends BaseController {
* @param userId
* @return
*/
@ApiOperation
(
value
=
"queryUnauthorizedProject"
,
notes
=
"QUERY_UNAUTHORIZED_PROJECT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/unauth-project"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryUnauthorizedProject
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryUnauthorizedProject
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"userId"
)
Integer
userId
)
{
try
{
logger
.
info
(
"login user {}, query unauthorized project by user id: {}."
,
loginUser
.
getUserName
(),
userId
);
...
...
@@ -194,9 +229,13 @@ public class ProjectController extends BaseController {
* @param userId
* @return
*/
@ApiOperation
(
value
=
"queryAuthorizedProject"
,
notes
=
"QUERY_AUTHORIZED_PROJECT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100"
)
})
@GetMapping
(
value
=
"/authed-project"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryAuthorizedProject
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryAuthorizedProject
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"userId"
)
Integer
userId
)
{
try
{
logger
.
info
(
"login user {}, query authorized project by user id: {}."
,
loginUser
.
getUserName
(),
userId
);
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/QueueController.java
浏览文件 @
d9bf06d8
...
...
@@ -22,11 +22,16 @@ import cn.escheduler.api.service.QueueService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -36,6 +41,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* queue controller
*/
@Api
(
tags
=
"QUEUE_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"/queue"
)
public
class
QueueController
extends
BaseController
{
...
...
@@ -51,9 +57,10 @@ public class QueueController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryList"
,
notes
=
"QUERY_QUEUE_LIST_NOTES"
)
@GetMapping
(
value
=
"/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryList
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
public
Result
queryList
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
try
{
logger
.
info
(
"login user {}, query queue list"
,
loginUser
.
getUserName
());
Map
<
String
,
Object
>
result
=
queueService
.
queryList
(
loginUser
);
...
...
@@ -69,9 +76,15 @@ public class QueueController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryQueueListPaging"
,
notes
=
"QUERY_QUEUE_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"20"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryQueueListPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryQueueListPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"searchVal"
,
required
=
false
)
String
searchVal
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
){
...
...
@@ -98,9 +111,14 @@ public class QueueController extends BaseController{
* @param queueName
* @return
*/
@ApiOperation
(
value
=
"createQueue"
,
notes
=
"CREATE_QUEUE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"YARN_QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"queueName"
,
value
=
"QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
createQueue
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
createQueue
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"queue"
)
String
queue
,
@RequestParam
(
value
=
"queueName"
)
String
queueName
)
{
logger
.
info
(
"login user {}, create queue, queue: {}, queueName: {}"
,
...
...
@@ -123,9 +141,15 @@ public class QueueController extends BaseController{
* @param queueName
* @return
*/
@ApiOperation
(
value
=
"updateQueue"
,
notes
=
"UPDATE_QUEUE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"QUEUE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"YARN_QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"queueName"
,
value
=
"QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
updateQueue
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
updateQueue
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"id"
)
int
id
,
@RequestParam
(
value
=
"queue"
)
String
queue
,
@RequestParam
(
value
=
"queueName"
)
String
queueName
)
{
...
...
@@ -149,9 +173,15 @@ public class QueueController extends BaseController{
* @param queueName
* @return
*/
@ApiOperation
(
value
=
"verifyQueue"
,
notes
=
"VERIFY_QUEUE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"QUEUE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"YARN_QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"queueName"
,
value
=
"QUEUE_NAME"
,
required
=
true
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/verify-queue"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
verifyQueue
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
verifyQueue
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"queue"
)
String
queue
,
@RequestParam
(
value
=
"queueName"
)
String
queueName
)
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ResourcesController.java
浏览文件 @
d9bf06d8
此差异已折叠。
点击以展开。
escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java
浏览文件 @
d9bf06d8
...
...
@@ -70,14 +70,14 @@ public class SchedulerController extends BaseController {
*/
@ApiOperation
(
value
=
"createSchedule"
,
notes
=
"CREATE_SCHEDULE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"schedule"
,
value
=
"SCHEDULE"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"schedule"
,
value
=
"SCHEDULE"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"warningType"
,
value
=
"WARNING_TYPE"
,
type
=
"WarningType"
),
@ApiImplicitParam
(
name
=
"warningGroupId"
,
value
=
"WARNING_GROUP_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"warningGroupId"
,
value
=
"WARNING_GROUP_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"failureStrategy"
,
value
=
"FAILURE_STRATEGY"
,
type
=
"FailureStrategy"
),
@ApiImplicitParam
(
name
=
"receivers"
,
value
=
"RECEIVERS"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"receiversCc"
,
value
=
"RECEIVERS_CC"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"workerGroupId"
,
value
=
"WORKER_GROUP_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"workerGroupId"
,
value
=
"WORKER_GROUP_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"processInstancePriority"
,
value
=
"PROCESS_INSTANCE_PRIORITY"
,
type
=
"Priority"
),
})
@PostMapping
(
"/create"
)
...
...
@@ -122,14 +122,14 @@ public class SchedulerController extends BaseController {
*/
@ApiOperation
(
value
=
"updateSchedule"
,
notes
=
"UPDATE_SCHEDULE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"schedule"
,
value
=
"SCHEDULE"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"schedule"
,
value
=
"SCHEDULE"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"warningType"
,
value
=
"WARNING_TYPE"
,
type
=
"WarningType"
),
@ApiImplicitParam
(
name
=
"warningGroupId"
,
value
=
"WARNING_GROUP_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"warningGroupId"
,
value
=
"WARNING_GROUP_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"failureStrategy"
,
value
=
"FAILURE_STRATEGY"
,
type
=
"FailureStrategy"
),
@ApiImplicitParam
(
name
=
"receivers"
,
value
=
"RECEIVERS"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"receiversCc"
,
value
=
"RECEIVERS_CC"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"workerGroupId"
,
value
=
"WORKER_GROUP_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"workerGroupId"
,
value
=
"WORKER_GROUP_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"processInstancePriority"
,
value
=
"PROCESS_INSTANCE_PRIORITY"
,
type
=
"Priority"
),
})
@PostMapping
(
"/update"
)
...
...
@@ -171,7 +171,7 @@ public class SchedulerController extends BaseController {
*/
@ApiOperation
(
value
=
"online"
,
notes
=
"ONLINE_SCHEDULE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@PostMapping
(
"/online"
)
public
Result
online
(
@ApiIgnore
@RequestAttribute
(
value
=
SESSION_USER
)
User
loginUser
,
...
...
@@ -199,7 +199,7 @@ public class SchedulerController extends BaseController {
*/
@ApiOperation
(
value
=
"offline"
,
notes
=
"OFFLINE_SCHEDULE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@PostMapping
(
"/offline"
)
public
Result
offline
(
@ApiIgnore
@RequestAttribute
(
value
=
SESSION_USER
)
User
loginUser
,
...
...
@@ -228,11 +228,11 @@ public class SchedulerController extends BaseController {
*/
@ApiOperation
(
value
=
"queryScheduleListPaging"
,
notes
=
"QUERY_SCHEDULE_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"SCHEDULE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"processDefinitionId"
,
value
=
"PROCESS_DEFINITION_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
"/list-paging"
)
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/ServerController.java
已删除
100644 → 0
浏览文件 @
bb1fa37e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.api.controller
;
import
cn.escheduler.api.service.ServerService
;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
import
static
cn
.
escheduler
.
api
.
enums
.
Status
.
LIST_MASTERS_ERROR
;
import
static
cn
.
escheduler
.
api
.
enums
.
Status
.
LIST_WORKERS_ERROR
;
/**
* server controller
*/
@RestController
@RequestMapping
(
"process"
)
public
class
ServerController
extends
BaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ExecutorController
.
class
);
@Autowired
private
ServerService
serverService
;
/**
* master list
* @param loginUser
* @return
*/
@GetMapping
(
value
=
"/master/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listMaster
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query all master"
,
loginUser
.
getUserName
());
try
{
logger
.
info
(
"list master, user:{}"
,
loginUser
.
getUserName
());
Map
<
String
,
Object
>
result
=
serverService
.
queryMaster
(
loginUser
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
logger
.
error
(
LIST_MASTERS_ERROR
.
getMsg
(),
e
);
return
error
(
LIST_MASTERS_ERROR
.
getCode
(),
LIST_MASTERS_ERROR
.
getMsg
());
}
}
/**
* worker list
* @param loginUser
* @return
*/
@GetMapping
(
value
=
"/worker/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listWorker
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query all workers"
,
loginUser
.
getUserName
());
try
{
Map
<
String
,
Object
>
result
=
serverService
.
queryWorker
(
loginUser
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
logger
.
error
(
LIST_WORKERS_ERROR
.
getMsg
(),
e
);
return
error
(
LIST_WORKERS_ERROR
.
getCode
(),
LIST_WORKERS_ERROR
.
getMsg
());
}
}
}
escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java
浏览文件 @
d9bf06d8
...
...
@@ -56,15 +56,15 @@ public class TaskInstanceController extends BaseController{
*/
@ApiOperation
(
value
=
"queryTaskListPaging"
,
notes
=
"QUERY_TASK_INSTANCE_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
required
=
false
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"processInstanceId"
,
value
=
"PROCESS_INSTANCE_ID"
,
required
=
false
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"taskName"
,
value
=
"TASK_NAME"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"stateType"
,
value
=
"EXECUTION_STATUS"
,
type
=
"ExecutionStatus"
),
@ApiImplicitParam
(
name
=
"host"
,
value
=
"HOST"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"START_DATE"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"END_DATE"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@GetMapping
(
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/TaskRecordController.java
浏览文件 @
d9bf06d8
...
...
@@ -21,19 +21,25 @@ import cn.escheduler.api.service.TaskRecordService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
import
static
cn
.
escheduler
.
api
.
enums
.
Status
.
QUERY_TASK_RECORD_LIST_PAGING_ERROR
;
/**
*
task record
controller
*
data quality
controller
*/
@ApiIgnore
@RestController
@RequestMapping
(
"/projects/task-record"
)
public
class
TaskRecordController
extends
BaseController
{
...
...
@@ -53,7 +59,7 @@ public class TaskRecordController extends BaseController{
*/
@GetMapping
(
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryTaskRecordListPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryTaskRecordListPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"taskName"
,
required
=
false
)
String
taskName
,
@RequestParam
(
value
=
"state"
,
required
=
false
)
String
state
,
@RequestParam
(
value
=
"sourceTable"
,
required
=
false
)
String
sourceTable
,
...
...
@@ -85,7 +91,7 @@ public class TaskRecordController extends BaseController{
*/
@GetMapping
(
"/history-list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryHistoryTaskRecordListPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryHistoryTaskRecordListPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"taskName"
,
required
=
false
)
String
taskName
,
@RequestParam
(
value
=
"state"
,
required
=
false
)
String
state
,
@RequestParam
(
value
=
"sourceTable"
,
required
=
false
)
String
sourceTable
,
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/TenantController.java
浏览文件 @
d9bf06d8
...
...
@@ -22,11 +22,16 @@ import cn.escheduler.api.service.TenantService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
...
...
@@ -36,6 +41,7 @@ import static cn.escheduler.api.enums.Status.*;
/**
* tenant controller
*/
@Api
(
tags
=
"TENANT_TAG"
,
position
=
1
)
@RestController
@RequestMapping
(
"/tenant"
)
public
class
TenantController
extends
BaseController
{
...
...
@@ -56,9 +62,17 @@ public class TenantController extends BaseController{
* @param desc
* @return
*/
@ApiOperation
(
value
=
"createTenant"
,
notes
=
"CREATE_TENANT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"tenantCode"
,
value
=
"TENANT_CODE"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"tenantName"
,
value
=
"TENANT_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"queueId"
,
value
=
"QUEUE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"desc"
,
value
=
"TENANT_DESC"
,
dataType
=
"String"
)
})
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
Result
createTenant
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
createTenant
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"tenantCode"
)
String
tenantCode
,
@RequestParam
(
value
=
"tenantName"
)
String
tenantName
,
@RequestParam
(
value
=
"queueId"
)
int
queueId
,
...
...
@@ -85,9 +99,15 @@ public class TenantController extends BaseController{
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"queryTenantlistPaging"
,
notes
=
"QUERY_TENANT_LIST_PAGING_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
dataType
=
"Int"
,
example
=
"20"
)
})
@GetMapping
(
value
=
"/list-paging"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryTenantlistPaging
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
queryTenantlistPaging
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"searchVal"
,
required
=
false
)
String
searchVal
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
){
...
...
@@ -113,9 +133,10 @@ public class TenantController extends BaseController{
* @param loginUser
* @return
*/
@ApiOperation
(
value
=
"queryTenantlist"
,
notes
=
"QUERY_TENANT_LIST_NOTES"
)
@GetMapping
(
value
=
"/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
queryTenantlist
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
public
Result
queryTenantlist
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
logger
.
info
(
"login user {}, query tenant list"
);
try
{
Map
<
String
,
Object
>
result
=
tenantService
.
queryTenantList
(
loginUser
);
...
...
@@ -138,9 +159,18 @@ public class TenantController extends BaseController{
* @param desc
* @return
*/
@ApiOperation
(
value
=
"updateTenant"
,
notes
=
"UPDATE_TENANT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ID"
,
value
=
"TENANT_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"tenantCode"
,
value
=
"TENANT_CODE"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"tenantName"
,
value
=
"TENANT_NAME"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"queueId"
,
value
=
"QUEUE_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
),
@ApiImplicitParam
(
name
=
"desc"
,
value
=
"TENANT_DESC"
,
type
=
"String"
)
})
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
updateTenant
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
updateTenant
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"id"
)
int
id
,
@RequestParam
(
value
=
"tenantCode"
)
String
tenantCode
,
@RequestParam
(
value
=
"tenantName"
)
String
tenantName
,
...
...
@@ -164,9 +194,14 @@ public class TenantController extends BaseController{
* @param id
* @return
*/
@ApiOperation
(
value
=
"deleteTenantById"
,
notes
=
"DELETE_TENANT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ID"
,
value
=
"TENANT_ID"
,
required
=
true
,
dataType
=
"Int"
,
example
=
"100"
)
})
@PostMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
deleteTenantById
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
deleteTenantById
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"id"
)
int
id
)
{
logger
.
info
(
"login user {}, delete tenant, tenantCode: {},"
,
loginUser
.
getUserName
(),
id
);
try
{
...
...
@@ -186,9 +221,13 @@ public class TenantController extends BaseController{
* @param tenantCode
* @return
*/
@ApiOperation
(
value
=
"verifyTenantCode"
,
notes
=
"VERIFY_TENANT_CODE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"tenantCode"
,
value
=
"TENANT_CODE"
,
required
=
true
,
dataType
=
"String"
)
})
@GetMapping
(
value
=
"/verify-tenant-code"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
verifyTenantCode
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
public
Result
verifyTenantCode
(
@
ApiIgnore
@
RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@RequestParam
(
value
=
"tenantCode"
)
String
tenantCode
)
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
浏览文件 @
d9bf06d8
...
...
@@ -66,10 +66,10 @@ public class UsersController extends BaseController{
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"userPassword"
,
value
=
"USER_PASSWORD"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"tenantId"
,
value
=
"TENANT_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"QUEUE"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"email"
,
value
=
"EMAIL"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"PHONE"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"tenantId"
,
value
=
"TENANT_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"QUEUE"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"email"
,
value
=
"EMAIL"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"PHONE"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@PostMapping
(
value
=
"/create"
)
@ResponseStatus
(
HttpStatus
.
CREATED
)
...
...
@@ -103,7 +103,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"queryUserList"
,
notes
=
"QUERY_USER_LIST_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"PAGE_NO"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"PAGE_SIZE"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"searchVal"
,
value
=
"SEARCH_VAL"
,
type
=
"String"
)
})
...
...
@@ -143,13 +143,13 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"updateUser"
,
notes
=
"UPDATE_USER_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"USER_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"USER_NAME"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"userPassword"
,
value
=
"USER_PASSWORD"
,
type
=
"String"
),
@ApiImplicitParam
(
name
=
"tenantId"
,
value
=
"TENANT_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"QUEUE"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"email"
,
value
=
"EMAIL"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"PHONE"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"tenantId"
,
value
=
"TENANT_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"queue"
,
value
=
"QUEUE"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"email"
,
value
=
"EMAIL"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"PHONE"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@PostMapping
(
value
=
"/update"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -180,7 +180,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"delUserById"
,
notes
=
"DELETE_USER_BY_ID_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"USER_ID"
,
type
=
"Int
"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
)
})
@PostMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
@@ -205,7 +205,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"grantProject"
,
notes
=
"GRANT_PROJECT_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"projectIds"
,
value
=
"PROJECT_IDS"
,
type
=
"String"
)
})
@PostMapping
(
value
=
"/grant-project"
)
...
...
@@ -232,7 +232,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"grantResource"
,
notes
=
"GRANT_RESOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"resourceIds"
,
value
=
"RESOURCE_IDS"
,
type
=
"String"
)
})
@PostMapping
(
value
=
"/grant-file"
)
...
...
@@ -260,7 +260,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"grantUDFFunc"
,
notes
=
"GRANT_UDF_FUNC_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"udfIds"
,
value
=
"UDF_IDS"
,
type
=
"String"
)
})
@PostMapping
(
value
=
"/grant-udf-func"
)
...
...
@@ -289,7 +289,7 @@ public class UsersController extends BaseController{
*/
@ApiOperation
(
value
=
"grantDataSource"
,
notes
=
"GRANT_DATASOURCE_NOTES"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
type
=
"Int
"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"USER_ID"
,
dataType
=
"Int"
,
example
=
"100
"
),
@ApiImplicitParam
(
name
=
"datasourceIds"
,
value
=
"DATASOURCE_IDS"
,
type
=
"String"
)
})
@PostMapping
(
value
=
"/grant-datasource"
)
...
...
escheduler-api/src/main/java/cn/escheduler/api/controller/WorkerGroupController.java
浏览文件 @
d9bf06d8
...
...
@@ -27,12 +27,14 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
/**
* worker group controller
*/
@ApiIgnore
@RestController
@RequestMapping
(
"/worker-group"
)
public
class
WorkerGroupController
extends
BaseController
{
...
...
escheduler-api/src/main/resources/messages.properties
浏览文件 @
d9bf06d8
QUERY_SCHEDULE_LIST_NOTES
=
query schedule list
ACCESS_TOKEN_TAG
=
access token related operation
MONITOR_TAG
=
monitor related operation
MASTER_LIST_NOTES
=
master server list
WORKER_LIST_NOTES
=
worker server list
QUERY_DATABASE_STATE_NOTES
=
query database state
QUERY_ZOOKEEPER_STATE_NOTES
=
QUERY ZOOKEEPER STATE
TASK_STATE
=
task instance state
SOURCE_TABLE
=
SOURCE TABLE
DEST_TABLE
=
dest table
TASK_DATE
=
task date
QUERY_HISTORY_TASK_RECORD_LIST_PAGING_NOTES
=
query history task record list paging
DATA_SOURCE_TAG
=
data source related operation
CREATE_DATA_SOURCE_NOTES
=
create data source
DATA_SOURCE_NAME
=
data source name
DATA_SOURCE_NOTE
=
data source desc
DB_TYPE
=
database type
DATA_SOURCE_HOST
=
DATA SOURCE HOST
DATA_SOURCE_PORT
=
data source port
DATABASE_NAME
=
database name
QUEUE_TAG
=
QUERY_QUEUE_LIST_NOTES
=
QUERY_QUEUE_LIST_PAGING_NOTES
=
CREATE_QUEUE_NOTES
=
YARN_QUEUE_NAME
=
QUEUE_ID
=
TENANT_DESC
=
QUERY_TENANT_LIST_PAGING_NOTES
=
QUERY_TENANT_LIST_NOTES
=
UPDATE_TENANT_NOTES
=
DELETE_TENANT_NOTES
=
RESOURCES_TAG
=
CREATE_RESOURCE_NOTES
=
RESOURCE_TYPE
=
RESOURCE_NAME
=
RESOURCE_DESC
=
RESOURCE_FILE
=
RESOURCE_ID
=
QUERY_RESOURCE_LIST_NOTES
=
DELETE_RESOURCE_BY_ID_NOTES
=
VIEW_RESOURCE_BY_ID_NOTES
=
ONLINE_CREATE_RESOURCE_NOTES
=
SUFFIX
=
CONTENT
=
UPDATE_RESOURCE_NOTES
=
DOWNLOAD_RESOURCE_NOTES
=
CREATE_UDF_FUNCTION_NOTES
=
UDF_TYPE
=
FUNC_NAME
=
CLASS_NAME
=
ARG_TYPES
=
UDF_DESC
=
VIEW_UDF_FUNCTION_NOTES
=
UPDATE_UDF_FUNCTION_NOTES
=
QUERY_UDF_FUNCTION_LIST_PAGING_NOTES
=
VERIFY_UDF_FUNCTION_NAME_NOTES
=
DELETE_UDF_FUNCTION_NOTES
=
AUTHORIZED_FILE_NOTES
=
UNAUTHORIZED_FILE_NOTES
=
AUTHORIZED_UDF_FUNC_NOTES
=
UNAUTHORIZED_UDF_FUNC_NOTES
=
VERIFY_QUEUE_NOTES
=
TENANT_TAG
=
CREATE_TENANT_NOTES
=
TENANT_CODE
=
TENANT_NAME
=
QUEUE_NAME
=
PASSWORD
=
password
DATA_SOURCE_OTHER
=
jdbc connection params, format:{"key1":"value1",...}
PROJECT_TAG
=
project related operation
CREATE_PROJECT_NOTES
=
create project
PROJECT_DESC
=
project description
UPDATE_PROJECT_NOTES
=
update project
PROJECT_ID
=
project id
QUERY_PROJECT_BY_ID_NOTES
=
query project info by project id
QUERY_PROJECT_LIST_PAGING_NOTES
=
QUERY PROJECT LIST PAGING
DELETE_PROJECT_BY_ID_NOTES
=
delete project by id
QUERY_UNAUTHORIZED_PROJECT_NOTES
=
query unauthorized project
QUERY_AUTHORIZED_PROJECT_NOTES
=
query authorized project
TASK_RECORD_TAG
=
task record related operation
QUERY_TASK_RECORD_LIST_PAGING_NOTES
=
query task record list paging
CREATE_TOKEN_NOTES
=
create token ,note: please login first
QUERY_ACCESS_TOKEN_LIST_NOTES
=
query access token list paging
SCHEDULE
=
schedule
WARNING_TYPE
=
warning type(sending strategy)
WARNING_GROUP_ID
=
warning group id
...
...
@@ -50,16 +132,16 @@ PAGE_SIZE=page size
LIMIT
=
limit
VIEW_TREE_NOTES
=
view tree
GET_NODE_LIST_BY_DEFINITION_ID_NOTES
=
get task node list by process definition id
PROCESS_DEFINITION_ID_LIST
=
PROCESS DEFINITION ID LIST
PROCESS_DEFINITION_ID_LIST
=
process definition id list
QUERY_PROCESS_INSTANCE_BY_ID_NOTES
=
query process instance by process instance id
DELETE_PROCESS_INSTANCE_BY_ID_NOTES
=
delete process instance by process instance id
TASK_ID
=
TASK INSTANCE ID
TASK_ID
=
task instance id
SKIP_LINE_NUM
=
skip line num
QUERY_TASK_INSTANCE_LOG_NOTES
=
QUERY TASK INSTANCE LOG
QUERY_TASK_INSTANCE_LOG_NOTES
=
query task instance log
DOWNLOAD_TASK_INSTANCE_LOG_NOTES
=
download task instance log
USERS_TAG
=
users related operation
SCHEDULER_TAG
=
scheduler related operation
CREATE_SCHEDULE_NOTES
=
CREATE SCHEDULE
CREATE_SCHEDULE_NOTES
=
create schedule
CREATE_USER_NOTES
=
create user
TENANT_ID
=
tenant id
QUEUE
=
queue
...
...
@@ -80,7 +162,7 @@ ALERT_GROUP_ID=alert group id
AUTHORIZED_USER_NOTES
=
authorized user
GRANT_UDF_FUNC_NOTES
=
grant udf function
UDF_IDS
=
udf ids(string format, multiple udf functions separated by ",")
GRANT_DATASOURCE_NOTES
=
GRANT DATASOURCE
GRANT_DATASOURCE_NOTES
=
grant datasource
DATASOURCE_IDS
=
datasource ids(string format, multiple datasources separated by ",")
QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES
=
query subprocess instance by task instance id
QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES
=
query parent process instance info by sub process instance id
...
...
@@ -95,4 +177,15 @@ EXECUTION_STATUS=runing status for workflow and task nodes
HOST
=
ip address of running task
START_DATE
=
start date
END_DATE
=
end date
QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES
=
query task list by process instance id
\ No newline at end of file
QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES
=
query task list by process instance id
UPDATE_DATA_SOURCE_NOTES
=
DATA_SOURCE_ID
=
QUERY_DATA_SOURCE_NOTES
=
QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES
=
QUERY_DATA_SOURCE_LIST_PAGING_NOTES
=
CONNECT_DATA_SOURCE_NOTES
=
CONNECT_DATA_SOURCE_TEST_NOTES
=
DELETE_DATA_SOURCE_NOTES
=
VERIFY_DATA_SOURCE_NOTES
=
UNAUTHORIZED_DATA_SOURCE_NOTES
=
AUTHORIZED_DATA_SOURCE_NOTES
=
escheduler-api/src/main/resources/messages_en_US.properties
浏览文件 @
d9bf06d8
QUERY_SCHEDULE_LIST_NOTES
=
query schedule list
ACCESS_TOKEN_TAG
=
access token related operation
MONITOR_TAG
=
monitor related operation
MASTER_LIST_NOTES
=
master server list
WORKER_LIST_NOTES
=
worker server list
QUERY_DATABASE_STATE_NOTES
=
query database state
QUERY_ZOOKEEPER_STATE_NOTES
=
QUERY ZOOKEEPER STATE
TASK_STATE
=
task instance state
SOURCE_TABLE
=
SOURCE TABLE
DEST_TABLE
=
dest table
TASK_DATE
=
task date
QUERY_HISTORY_TASK_RECORD_LIST_PAGING_NOTES
=
query history task record list paging
DATA_SOURCE_TAG
=
data source related operation
CREATE_DATA_SOURCE_NOTES
=
create data source
DATA_SOURCE_NAME
=
data source name
DATA_SOURCE_NOTE
=
data source desc
DB_TYPE
=
database type
DATA_SOURCE_HOST
=
DATA SOURCE HOST
DATA_SOURCE_PORT
=
data source port
DATABASE_NAME
=
database name
QUEUE_TAG
=
queue related operation
QUERY_QUEUE_LIST_NOTES
=
query queue list
QUERY_QUEUE_LIST_PAGING_NOTES
=
query queue list paging
CREATE_QUEUE_NOTES
=
create queue
YARN_QUEUE_NAME
=
yarn(hadoop) queue name
QUEUE_ID
=
queue id
TENANT_DESC
=
tenant desc
QUERY_TENANT_LIST_PAGING_NOTES
=
query tenant list paging
QUERY_TENANT_LIST_NOTES
=
query tenant list
UPDATE_TENANT_NOTES
=
update tenant
DELETE_TENANT_NOTES
=
delete tenant
RESOURCES_TAG
=
resource center related operation
CREATE_RESOURCE_NOTES
=
create resource
RESOURCE_TYPE
=
resource file type
RESOURCE_NAME
=
resource name
RESOURCE_DESC
=
resource file desc
RESOURCE_FILE
=
resource file
RESOURCE_ID
=
resource id
QUERY_RESOURCE_LIST_NOTES
=
query resource list
DELETE_RESOURCE_BY_ID_NOTES
=
delete resource by id
VIEW_RESOURCE_BY_ID_NOTES
=
view resource by id
ONLINE_CREATE_RESOURCE_NOTES
=
online create resource
SUFFIX
=
resource file suffix
CONTENT
=
resource file content
UPDATE_RESOURCE_NOTES
=
edit resource file online
DOWNLOAD_RESOURCE_NOTES
=
download resource file
CREATE_UDF_FUNCTION_NOTES
=
create udf function
UDF_TYPE
=
UDF type
FUNC_NAME
=
function name
CLASS_NAME
=
package and class name
ARG_TYPES
=
arguments
UDF_DESC
=
udf desc
VIEW_UDF_FUNCTION_NOTES
=
view udf function
UPDATE_UDF_FUNCTION_NOTES
=
update udf function
QUERY_UDF_FUNCTION_LIST_PAGING_NOTES
=
query udf function list paging
VERIFY_UDF_FUNCTION_NAME_NOTES
=
verify udf function name
DELETE_UDF_FUNCTION_NOTES
=
delete udf function
AUTHORIZED_FILE_NOTES
=
authorized file
UNAUTHORIZED_FILE_NOTES
=
unauthorized file
AUTHORIZED_UDF_FUNC_NOTES
=
authorized udf func
UNAUTHORIZED_UDF_FUNC_NOTES
=
unauthorized udf func
VERIFY_QUEUE_NOTES
=
verify queue
TENANT_TAG
=
tenant related operation
CREATE_TENANT_NOTES
=
create tenant
TENANT_CODE
=
tenant code
TENANT_NAME
=
tenant name
QUEUE_NAME
=
queue name
PASSWORD
=
password
DATA_SOURCE_OTHER
=
jdbc connection params, format:{"key1":"value1",...}
PROJECT_TAG
=
project related operation
CREATE_PROJECT_NOTES
=
create project
PROJECT_DESC
=
project description
UPDATE_PROJECT_NOTES
=
update project
PROJECT_ID
=
project id
QUERY_PROJECT_BY_ID_NOTES
=
query project info by project id
QUERY_PROJECT_LIST_PAGING_NOTES
=
QUERY PROJECT LIST PAGING
DELETE_PROJECT_BY_ID_NOTES
=
delete project by id
QUERY_UNAUTHORIZED_PROJECT_NOTES
=
query unauthorized project
QUERY_AUTHORIZED_PROJECT_NOTES
=
query authorized project
TASK_RECORD_TAG
=
task record related operation
QUERY_TASK_RECORD_LIST_PAGING_NOTES
=
query task record list paging
CREATE_TOKEN_NOTES
=
create token ,note: please login first
QUERY_ACCESS_TOKEN_LIST_NOTES
=
query access token list paging
SCHEDULE
=
schedule
WARNING_TYPE
=
warning type(sending strategy)
WARNING_GROUP_ID
=
warning group id
...
...
@@ -50,16 +132,16 @@ PAGE_SIZE=page size
LIMIT
=
limit
VIEW_TREE_NOTES
=
view tree
GET_NODE_LIST_BY_DEFINITION_ID_NOTES
=
get task node list by process definition id
PROCESS_DEFINITION_ID_LIST
=
PROCESS DEFINITION ID LIST
PROCESS_DEFINITION_ID_LIST
=
process definition id list
QUERY_PROCESS_INSTANCE_BY_ID_NOTES
=
query process instance by process instance id
DELETE_PROCESS_INSTANCE_BY_ID_NOTES
=
delete process instance by process instance id
TASK_ID
=
TASK INSTANCE ID
TASK_ID
=
task instance id
SKIP_LINE_NUM
=
skip line num
QUERY_TASK_INSTANCE_LOG_NOTES
=
QUERY TASK INSTANCE LOG
QUERY_TASK_INSTANCE_LOG_NOTES
=
query task instance log
DOWNLOAD_TASK_INSTANCE_LOG_NOTES
=
download task instance log
USERS_TAG
=
users related operation
SCHEDULER_TAG
=
scheduler related operation
CREATE_SCHEDULE_NOTES
=
CREATE SCHEDULE
CREATE_SCHEDULE_NOTES
=
create schedule
CREATE_USER_NOTES
=
create user
TENANT_ID
=
tenant id
QUEUE
=
queue
...
...
@@ -80,7 +162,7 @@ ALERT_GROUP_ID=alert group id
AUTHORIZED_USER_NOTES
=
authorized user
GRANT_UDF_FUNC_NOTES
=
grant udf function
UDF_IDS
=
udf ids(string format, multiple udf functions separated by ",")
GRANT_DATASOURCE_NOTES
=
GRANT DATASOURCE
GRANT_DATASOURCE_NOTES
=
grant datasource
DATASOURCE_IDS
=
datasource ids(string format, multiple datasources separated by ",")
QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES
=
query subprocess instance by task instance id
QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES
=
query parent process instance info by sub process instance id
...
...
@@ -96,3 +178,14 @@ HOST=ip address of running task
START_DATE
=
start date
END_DATE
=
end date
QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES
=
query task list by process instance id
UPDATE_DATA_SOURCE_NOTES
=
update data source
DATA_SOURCE_ID
=
DATA SOURCE ID
QUERY_DATA_SOURCE_NOTES
=
query data source by id
QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES
=
query data source list by database type
QUERY_DATA_SOURCE_LIST_PAGING_NOTES
=
query data source list paging
CONNECT_DATA_SOURCE_NOTES
=
CONNECT DATA SOURCE
CONNECT_DATA_SOURCE_TEST_NOTES
=
connect data source test
DELETE_DATA_SOURCE_NOTES
=
delete data source
VERIFY_DATA_SOURCE_NOTES
=
verify data source
UNAUTHORIZED_DATA_SOURCE_NOTES
=
unauthorized data source
AUTHORIZED_DATA_SOURCE_NOTES
=
authorized data source
escheduler-api/src/main/resources/messages_zh_CN.properties
浏览文件 @
d9bf06d8
QUERY_SCHEDULE_LIST_NOTES
=
查询定时列表
ACCESS_TOKEN_TAG
=
access token相关操作,需要先登录
MONITOR_TAG
=
监控相关操作
MASTER_LIST_NOTES
=
master服务列表
WORKER_LIST_NOTES
=
worker服务列表
QUERY_DATABASE_STATE_NOTES
=
查询数据库状态
QUERY_ZOOKEEPER_STATE_NOTES
=
查询Zookeeper状态
TASK_STATE
=
任务实例状态
SOURCE_TABLE
=
源表
DEST_TABLE
=
目标表
TASK_DATE
=
任务时间
QUERY_HISTORY_TASK_RECORD_LIST_PAGING_NOTES
=
分页查询历史任务记录列表
DATA_SOURCE_TAG
=
数据源相关操作
CREATE_DATA_SOURCE_NOTES
=
创建数据源
DATA_SOURCE_NAME
=
数据源名称
DATA_SOURCE_NOTE
=
数据源描述
DB_TYPE
=
数据源类型
DATA_SOURCE_HOST
=
IP主机名
DATA_SOURCE_PORT
=
数据源端口
DATABASE_NAME
=
数据库名
QUEUE_TAG
=
队列相关操作
QUERY_QUEUE_LIST_NOTES
=
查询队列列表
QUERY_QUEUE_LIST_PAGING_NOTES
=
分页查询队列列表
CREATE_QUEUE_NOTES
=
创建队列
YARN_QUEUE_NAME
=
hadoop yarn队列名
QUEUE_ID
=
队列ID
TENANT_DESC
=
租户描述
QUERY_TENANT_LIST_PAGING_NOTES
=
分页查询租户列表
QUERY_TENANT_LIST_NOTES
=
查询租户列表
UPDATE_TENANT_NOTES
=
更新租户
DELETE_TENANT_NOTES
=
删除租户
RESOURCES_TAG
=
资源中心相关操作
CREATE_RESOURCE_NOTES
=
创建资源
RESOURCE_TYPE
=
资源文件类型
RESOURCE_NAME
=
资源文件名称
RESOURCE_DESC
=
资源文件描述
RESOURCE_FILE
=
资源文件
RESOURCE_ID
=
资源ID
QUERY_RESOURCE_LIST_NOTES
=
查询资源列表
DELETE_RESOURCE_BY_ID_NOTES
=
删除资源通过ID
VIEW_RESOURCE_BY_ID_NOTES
=
浏览资源通通过ID
ONLINE_CREATE_RESOURCE_NOTES
=
在线创建资源
SUFFIX
=
资源文件后缀
CONTENT
=
资源文件内容
UPDATE_RESOURCE_NOTES
=
在线更新资源文件
DOWNLOAD_RESOURCE_NOTES
=
下载资源文件
CREATE_UDF_FUNCTION_NOTES
=
创建UDF函数
UDF_TYPE
=
UDF类型
FUNC_NAME
=
函数名称
CLASS_NAME
=
包名类名
ARG_TYPES
=
参数
UDF_DESC
=
udf描述,使用说明
VIEW_UDF_FUNCTION_NOTES
=
查看udf函数
UPDATE_UDF_FUNCTION_NOTES
=
更新udf函数
QUERY_UDF_FUNCTION_LIST_PAGING_NOTES
=
分页查询udf函数列表
VERIFY_UDF_FUNCTION_NAME_NOTES
=
验证udf函数名
DELETE_UDF_FUNCTION_NOTES
=
删除UDF函数
AUTHORIZED_FILE_NOTES
=
授权文件
UNAUTHORIZED_FILE_NOTES
=
取消授权文件
AUTHORIZED_UDF_FUNC_NOTES
=
授权udf函数
UNAUTHORIZED_UDF_FUNC_NOTES
=
取消udf函数授权
VERIFY_QUEUE_NOTES
=
验证队列
TENANT_TAG
=
租户相关操作
CREATE_TENANT_NOTES
=
创建租户
TENANT_CODE
=
租户编码
TENANT_NAME
=
租户名称
QUEUE_NAME
=
队列名
PASSWORD
=
密码
DATA_SOURCE_OTHER
=
jdbc连接参数,格式为:{"key1":"value1",...}
PROJECT_TAG
=
项目相关操作
CREATE_PROJECT_NOTES
=
创建项目
PROJECT_DESC
=
项目描述
UPDATE_PROJECT_NOTES
=
更新项目
PROJECT_ID
=
项目ID
QUERY_PROJECT_BY_ID_NOTES
=
通过项目ID查询项目信息
QUERY_PROJECT_LIST_PAGING_NOTES
=
分页查询项目列表
DELETE_PROJECT_BY_ID_NOTES
=
删除项目通过ID
QUERY_UNAUTHORIZED_PROJECT_NOTES
=
查询未授权的项目
QUERY_AUTHORIZED_PROJECT_NOTES
=
查询授权项目
TASK_RECORD_TAG
=
任务记录相关操作
QUERY_TASK_RECORD_LIST_PAGING_NOTES
=
分页查询任务记录列表
CREATE_TOKEN_NOTES
=
创建token,注意需要先登录
QUERY_ACCESS_TOKEN_LIST_NOTES
=
分页查询access token列表
SCHEDULE
=
定时
WARNING_TYPE
=
发送策略
WARNING_GROUP_ID
=
发送组ID
...
...
@@ -95,3 +177,14 @@ HOST=运行任务的主机IP地址
START_DATE
=
开始时间
END_DATE
=
结束时间
QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES
=
通过流程实例ID查询任务列表
UPDATE_DATA_SOURCE_NOTES
=
更新数据源
DATA_SOURCE_ID
=
数据源ID
QUERY_DATA_SOURCE_NOTES
=
查询数据源通过ID
QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES
=
查询数据源列表通过数据源类型
QUERY_DATA_SOURCE_LIST_PAGING_NOTES
=
分页查询数据源列表
CONNECT_DATA_SOURCE_NOTES
=
连接数据源
CONNECT_DATA_SOURCE_TEST_NOTES
=
连接数据源测试
DELETE_DATA_SOURCE_NOTES
=
删除数据源
VERIFY_DATA_SOURCE_NOTES
=
验证数据源
UNAUTHORIZED_DATA_SOURCE_NOTES
=
未授权的数据源
AUTHORIZED_DATA_SOURCE_NOTES
=
授权的数据源
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录