Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_44739061
DolphinScheduler
提交
5e107a8c
DolphinScheduler
项目概览
weixin_44739061
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
5e107a8c
编写于
4月 24, 2019
作者:
G
gongzijian
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415
上级
ceb45d9c
40216b34
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
25 addition
and
12 deletion
+25
-12
escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java
...in/java/cn/escheduler/api/service/AccessTokenService.java
+9
-8
escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java
...rc/main/java/cn/escheduler/api/service/TenantService.java
+4
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java
...main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java
+4
-2
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java
...a/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java
+6
-0
escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java
.../java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java
+2
-2
未找到文件。
escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java
浏览文件 @
5e107a8c
...
...
@@ -58,15 +58,16 @@ public class AccessTokenService extends BaseService {
public
Map
<
String
,
Object
>
queryAccessTokenList
(
User
loginUser
,
String
searchVal
,
Integer
pageNo
,
Integer
pageSize
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
if
(
check
(
result
,
!
isAdmin
(
loginUser
),
Status
.
USER_NO_OPERATION_PERM
,
Constants
.
STATUS
))
{
return
result
;
}
Integer
count
=
accessTokenMapper
.
countAccessTokenPaging
(
searchVal
);
PageInfo
<
AccessToken
>
pageInfo
=
new
PageInfo
<>(
pageNo
,
pageSize
);
List
<
AccessToken
>
accessTokenList
=
accessTokenMapper
.
queryAccessTokenPaging
(
searchVal
,
pageInfo
.
getStart
(),
pageSize
);
Integer
count
;
List
<
AccessToken
>
accessTokenList
;
if
(
loginUser
.
getUserType
()
==
UserType
.
ADMIN_USER
){
count
=
accessTokenMapper
.
countAccessTokenPaging
(
0
,
searchVal
);
accessTokenList
=
accessTokenMapper
.
queryAccessTokenPaging
(
0
,
searchVal
,
pageInfo
.
getStart
(),
pageSize
);
}
else
{
count
=
accessTokenMapper
.
countAccessTokenPaging
(
loginUser
.
getId
(),
searchVal
);
accessTokenList
=
accessTokenMapper
.
queryAccessTokenPaging
(
loginUser
.
getId
(),
searchVal
,
pageInfo
.
getStart
(),
pageSize
);
}
pageInfo
.
setTotalCount
(
count
);
pageInfo
.
setLists
(
accessTokenList
);
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java
浏览文件 @
5e107a8c
...
...
@@ -80,6 +80,10 @@ public class TenantService extends BaseService{
Tenant
tenant
=
new
Tenant
();
Date
now
=
new
Date
();
if
(!
tenantCode
.
matches
(
"^[0-9a-zA-Z_.]{1,}$"
)
||
tenantCode
.
startsWith
(
"-"
)){
putMsg
(
result
,
Status
.
VERIFY_TENANT_CODE_ERROR
);
return
result
;
}
tenant
.
setTenantCode
(
tenantCode
);
tenant
.
setTenantName
(
tenantName
);
tenant
.
setQueueId
(
queueId
);
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java
浏览文件 @
5e107a8c
...
...
@@ -74,7 +74,8 @@ public interface AccessTokenMapper {
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
,
javaType
=
Timestamp
.
class
,
jdbcType
=
JdbcType
.
DATE
)
})
@SelectProvider
(
type
=
AccessTokenMapperProvider
.
class
,
method
=
"queryAccessTokenPaging"
)
List
<
AccessToken
>
queryAccessTokenPaging
(
@Param
(
"searchVal"
)
String
searchVal
,
List
<
AccessToken
>
queryAccessTokenPaging
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"searchVal"
)
String
searchVal
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
...
...
@@ -84,5 +85,6 @@ public interface AccessTokenMapper {
* @return
*/
@SelectProvider
(
type
=
AccessTokenMapperProvider
.
class
,
method
=
"countAccessTokenPaging"
)
Integer
countAccessTokenPaging
(
@Param
(
"searchVal"
)
String
searchVal
);
Integer
countAccessTokenPaging
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"searchVal"
)
String
searchVal
);
}
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java
浏览文件 @
5e107a8c
...
...
@@ -97,6 +97,9 @@ public class AccessTokenMapperProvider {
FROM
(
TABLE_NAME
+
" t,t_escheduler_user u"
);
Object
searchVal
=
parameter
.
get
(
"searchVal"
);
WHERE
(
"u.id = t.user_id"
);
if
(
parameter
.
get
(
"userId"
)
!=
null
&&
(
int
)
parameter
.
get
(
"userId"
)
!=
0
){
WHERE
(
" u.id = #{userId}"
);
}
if
(
searchVal
!=
null
&&
StringUtils
.
isNotEmpty
(
searchVal
.
toString
())){
WHERE
(
" u.user_name like concat('%', #{searchVal}, '%')"
);
}
...
...
@@ -115,6 +118,9 @@ public class AccessTokenMapperProvider {
FROM
(
TABLE_NAME
+
" t,t_escheduler_user u"
);
Object
searchVal
=
parameter
.
get
(
"searchVal"
);
WHERE
(
"u.id = t.user_id"
);
if
(
parameter
.
get
(
"userId"
)
!=
null
&&
(
int
)
parameter
.
get
(
"userId"
)
!=
0
){
WHERE
(
" u.id = #{userId}"
);
}
if
(
searchVal
!=
null
&&
StringUtils
.
isNotEmpty
(
searchVal
.
toString
())){
WHERE
(
" u.user_name like concat('%', #{searchVal}, '%') "
);
}
...
...
escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java
浏览文件 @
5e107a8c
...
...
@@ -51,10 +51,10 @@ public class AccessTokenMapperTest {
@Test
public
void
testListPaging
(){
Integer
count
=
accessTokenMapper
.
countAccessTokenPaging
(
""
);
Integer
count
=
accessTokenMapper
.
countAccessTokenPaging
(
1
,
""
);
Assert
.
assertEquals
(
count
,
(
Integer
)
5
);
List
<
AccessToken
>
accessTokenList
=
accessTokenMapper
.
queryAccessTokenPaging
(
""
,
0
,
2
);
List
<
AccessToken
>
accessTokenList
=
accessTokenMapper
.
queryAccessTokenPaging
(
1
,
""
,
0
,
2
);
Assert
.
assertEquals
(
accessTokenList
.
size
(),
5
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录