Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
d3cbdf30
Commit
d3cbdf30
authored
Nov 19, 2019
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
ae2cf8b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
1 deletions
+104
-1
DataConstant.java
...core/src/main/java/cn/datax/common/core/DataConstant.java
+104
-1
No files found.
datax-common/datax-common-core/src/main/java/cn/datax/common/core/DataConstant.java
View file @
d3cbdf30
...
...
@@ -3,6 +3,110 @@ package cn.datax.common.core;
public
class
DataConstant
{
/**
* Oauth2安全相关常量
*/
public
enum
Security
{
//请求头TOKEN名称
TOKENHEADER
(
"tokenHeader"
,
"gatewayToken"
),
//请求头TOKEN值
TOKENVALUE
(
"tokenValue"
,
"datax:gateway:123456"
),
//OAUTH2令牌类型
TOKENTYPE
(
"tokenType"
,
"bearer "
),
//security授权角色前缀
ROLEPREFIX
(
"rolePrefix"
,
"ROLE_"
);
Security
(
String
key
,
String
val
){
this
.
key
=
key
;
this
.
val
=
val
;
}
private
final
String
key
;
private
final
String
val
;
public
String
getKey
()
{
return
key
;
}
public
String
getVal
()
{
return
val
;
}
}
/**
* 通用的是否
*/
public
enum
TrueOrFalse
{
FALSE
(
0
,
false
),
TRUE
(
1
,
true
);
TrueOrFalse
(
Integer
key
,
boolean
val
){
this
.
key
=
key
;
this
.
val
=
val
;
}
private
final
Integer
key
;
private
final
boolean
val
;
public
Integer
getKey
()
{
return
key
;
}
public
boolean
getVal
()
{
return
val
;
}
}
/**
* 用户认证返回额外信息
*/
public
enum
UserAdditionalInfo
{
LICENSE
(
"license"
,
"许可证"
),
USER
(
"user"
,
"用户"
),
USERID
(
"user_id"
,
"用户ID"
),
USERNAME
(
"username"
,
"用户名"
),
NICKNAME
(
"nickname"
,
"用户昵称"
),
DEPT
(
"user_dept"
,
"用户部门"
),
ROLE
(
"user_role"
,
"用户角色"
),
POST
(
"user_post"
,
"用户岗位"
);
UserAdditionalInfo
(
String
key
,
String
val
){
this
.
key
=
key
;
this
.
val
=
val
;
}
private
final
String
key
;
private
final
String
val
;
public
String
getKey
()
{
return
key
;
}
public
String
getVal
()
{
return
val
;
}
}
/**
* 通用的启用禁用状态
*/
public
enum
EnableState
{
DISABLE
(
0
,
"禁用"
),
ENABLE
(
1
,
"启用"
);
EnableState
(
Integer
key
,
String
val
){
this
.
key
=
key
;
this
.
val
=
val
;
}
private
final
Integer
key
;
private
final
String
val
;
public
Integer
getKey
()
{
return
key
;
}
public
String
getVal
()
{
return
val
;
}
}
/**
* Gateway请求头TOKEN名称(不要有空格)
*/
public
static
final
String
GATEWAY_TOKEN_HEADER
=
"GatewayToken"
;
...
...
@@ -31,5 +135,4 @@ public class DataConstant {
public
static
String
DETAILS_SECURITY_USER_DEPT
=
"user_dept"
;
public
static
String
DETAILS_SECURITY_USER_ROLE
=
"user_role"
;
public
static
String
DETAILS_SECURITY_USER_POST
=
"user_post"
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment