Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
124e84c8
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
124e84c8
编写于
4月 16, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
多语言国际化3
上级
b9f11aad
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
117 addition
and
44 deletion
+117
-44
o2server/commons/language/platform.properties
o2server/commons/language/platform.properties
+7
-7
o2server/commons/language/platform_en.properties
o2server/commons/language/platform_en.properties
+7
-7
o2server/commons/language/platform_zh_CN.properties
o2server/commons/language/platform_zh_CN.properties
+7
-7
o2server/commons/language/platform_zh_TW.properties
o2server/commons/language/platform_zh_TW.properties
+0
-7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionAccessDenied.java
.../x/base/core/project/exception/ExceptionAccessDenied.java
+9
-5
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionAccessDeniedOrEntityNotExist.java
...ject/exception/ExceptionAccessDeniedOrEntityNotExist.java
+7
-4
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionEntityNotExist.java
.../base/core/project/exception/ExceptionEntityNotExist.java
+11
-7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/LanguagePromptException.java
.../base/core/project/exception/LanguagePromptException.java
+62
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/ResponseFactory.java
...n/java/com/x/base/core/project/jaxrs/ResponseFactory.java
+7
-0
未找到文件。
o2server/commons/language/platform.properties
浏览文件 @
124e84c8
exception_a
ccessDenied
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3.
com.x.base.core.project.exception.ExceptionA
ccessDenied
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3.
exception_a
ccessDenied_1
=
\u7528\u6237
:{}
\u
8BBF
\u
95EE
\u
5BF9
\u
8C61 class:{}, id:{},
\u6743\u9650\u
4E0D
\u
8DB3.
com.x.base.core.project.exception.ExceptionA
ccessDenied_1
=
\u7528\u6237
:{}
\u
8BBF
\u
95EE
\u
5BF9
\u
8C61 class:{}, id:{},
\u6743\u9650\u
4E0D
\u
8DB3.
exception_a
ccessDeniedOrEntityNotExist
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_a
ccessDeniedOrEntityNotExist_1
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
, {}.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist_1
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
, {}.
exception_e
ntityNotExist
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684
{}
\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684
{}
\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_e
ntityNotExist_1
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_1
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_e
ntityNotExist_2
=
\u
7C7B
\u
578B
\u
4E3A: {}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_2
=
\u
7C7B
\u
578B
\u
4E3A: {}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
o2server/commons/language/platform_en.properties
浏览文件 @
124e84c8
exception_a
ccessDenied
=
User :{} Insufficient permissions.
com.x.base.core.project.exception.ExceptionA
ccessDenied
=
User :{} Insufficient permissions.
exception_a
ccessDenied_1
=
User :{} access object class:{}, id:{}, insufficient permission.
com.x.base.core.project.exception.ExceptionA
ccessDenied_1
=
User :{} access object class:{}, id:{}, insufficient permission.
exception_a
ccessDeniedOrEntityNotExist
=
User :{} Insufficient permissions or the object does not exist.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist
=
User :{} Insufficient permissions or the object does not exist.
exception_a
ccessDeniedOrEntityNotExist_1
=
User :{} Insufficient permission or object does not exist, {}.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist_1
=
User :{} Insufficient permission or object does not exist, {}.
exception_e
ntityNotExist
=
The {2} object identified as :{1} does not exist.
com.x.base.core.project.exception.ExceptionE
ntityNotExist
=
The {2} object identified as :{1} does not exist.
exception_e
ntityNotExist_1
=
The object identified as :{} does not exist.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_1
=
The object identified as :{} does not exist.
exception_e
ntityNotExist_2
=
Object of type: {} does not exist.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_2
=
Object of type: {} does not exist.
o2server/commons/language/platform_zh_CN.properties
浏览文件 @
124e84c8
exception_a
ccessDenied
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3.
com.x.base.core.project.exception.ExceptionA
ccessDenied
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3.
exception_a
ccessDenied_1
=
\u7528\u6237
:{}
\u
8BBF
\u
95EE
\u
5BF9
\u
8C61 class:{}, id:{},
\u6743\u9650\u
4E0D
\u
8DB3.
com.x.base.core.project.exception.ExceptionA
ccessDenied_1
=
\u7528\u6237
:{}
\u
8BBF
\u
95EE
\u
5BF9
\u
8C61 class:{}, id:{},
\u6743\u9650\u
4E0D
\u
8DB3.
exception_a
ccessDeniedOrEntityNotExist
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_a
ccessDeniedOrEntityNotExist_1
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
, {}.
com.x.base.core.project.exception.ExceptionA
ccessDeniedOrEntityNotExist_1
=
\u7528\u6237
:{}
\u6743\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
, {}.
exception_e
ntityNotExist
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684
{}
\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684
{}
\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_e
ntityNotExist_1
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_1
=
\u6807\u
8BC6
\u
4E3A:{}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_e
ntityNotExist_2
=
\u
7C7B
\u
578B
\u
4E3A: {}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
com.x.base.core.project.exception.ExceptionE
ntityNotExist_2
=
\u
7C7B
\u
578B
\u
4E3A: {}
\u7684\u
5BF9
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
o2server/commons/language/platform_zh_TW.properties
已删除
100644 → 0
浏览文件 @
b9f11aad
exception_accessDenied
=
\u7528\u6236
:{}
\u
6B0A
\u9650\u
4E0D
\u
8DB3.
exception_accessDenied_1
=
\u7528\u6236
:{}
\u
8A2A
\u
554F
\u
5C0D
\u
8C61 class:{}, id:{},
\u
6B0A
\u9650\u
4E0D
\u
8DB3.
exception_accessDeniedOrEntityNotExist
=
\u7528\u6236
:{}
\u
6B0A
\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5C0D
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_accessDeniedOrEntityNotExist_1
=
\u7528\u6236
:{}
\u
6B0A
\u9650\u
4E0D
\u
8DB3
\u6216\u8005\u
5C0D
\u
8C61
\u
4E0D
\u
5B58
\u5728
, {}.
exception_entityNotExist
=
\u
6A19
\u
8B58
\u
70BA:{}
\u7684
{}
\u
5C0D
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_entityNotExist_1
=
\u
6A19
\u
8B58
\u
70BA:{}
\u7684\u
5C0D
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
exception_entityNotExist_2
=
\u
985E
\u
578B
\u
70BA: {}
\u7684\u
5C0D
\u
8C61
\u
4E0D
\u
5B58
\u5728
.
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionAccessDenied.java
浏览文件 @
124e84c8
...
@@ -6,25 +6,29 @@ import com.x.base.core.entity.JpaObject;
...
@@ -6,25 +6,29 @@ import com.x.base.core.entity.JpaObject;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.LanguageTools
;
import
com.x.base.core.project.tools.LanguageTools
;
public
class
ExceptionAccessDenied
extends
PromptException
{
public
class
ExceptionAccessDenied
extends
Language
PromptException
{
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
public
static
String
defaultMessage
=
"用户:{} 权限不足."
;
public
ExceptionAccessDenied
(
String
person
)
{
public
ExceptionAccessDenied
(
String
person
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDenied"
)
,
person
);
super
(
defaultMessage
,
person
);
}
}
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
)
{
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDenied"
),
effectivePerson
.
getDistinguishedName
());
super
(
defaultMessage
,
effectivePerson
.
getDistinguishedName
());
this
.
setLanguageKey
(
this
.
getClass
().
getName
());
}
}
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
,
JpaObject
jpa
)
{
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
,
JpaObject
jpa
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDenied_1"
)
,
effectivePerson
.
getDistinguishedName
(),
super
(
"用户:{} 访问对象 class:{}, id:{}, 权限不足."
,
effectivePerson
.
getDistinguishedName
(),
(
null
==
jpa
)
?
null
:
jpa
.
getClass
().
getName
(),
(
null
==
jpa
)
?
null
:
jpa
.
getId
());
(
null
==
jpa
)
?
null
:
jpa
.
getClass
().
getName
(),
(
null
==
jpa
)
?
null
:
jpa
.
getId
());
this
.
setLanguageKey
(
this
.
getClass
().
getName
()+
"_1"
);
}
}
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
,
String
message
)
{
public
ExceptionAccessDenied
(
EffectivePerson
effectivePerson
,
String
message
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDenied"
)
,
effectivePerson
.
getDistinguishedName
(),
Objects
.
toString
(
message
,
""
));
super
(
defaultMessage
,
effectivePerson
.
getDistinguishedName
(),
Objects
.
toString
(
message
,
""
));
}
}
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionAccessDeniedOrEntityNotExist.java
浏览文件 @
124e84c8
...
@@ -5,20 +5,23 @@ import java.util.Objects;
...
@@ -5,20 +5,23 @@ import java.util.Objects;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.LanguageTools
;
import
com.x.base.core.project.tools.LanguageTools
;
public
class
ExceptionAccessDeniedOrEntityNotExist
extends
PromptException
{
public
class
ExceptionAccessDeniedOrEntityNotExist
extends
Language
PromptException
{
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
public
static
String
defaultMessage
=
"用户:{} 权限不足或者对象不存在."
;
public
ExceptionAccessDeniedOrEntityNotExist
(
String
person
)
{
public
ExceptionAccessDeniedOrEntityNotExist
(
String
person
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDeniedOrEntityNotExist"
)
,
person
);
super
(
defaultMessage
,
person
);
}
}
public
ExceptionAccessDeniedOrEntityNotExist
(
EffectivePerson
effectivePerson
)
{
public
ExceptionAccessDeniedOrEntityNotExist
(
EffectivePerson
effectivePerson
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDeniedOrEntityNotExist"
)
,
effectivePerson
.
getDistinguishedName
());
super
(
defaultMessage
,
effectivePerson
.
getDistinguishedName
());
}
}
public
ExceptionAccessDeniedOrEntityNotExist
(
EffectivePerson
effectivePerson
,
String
message
)
{
public
ExceptionAccessDeniedOrEntityNotExist
(
EffectivePerson
effectivePerson
,
String
message
)
{
super
(
LanguageTools
.
getValue
(
"exception_accessDeniedOrEntityNotExist_1"
),
effectivePerson
.
getDistinguishedName
(),
Objects
.
toString
(
message
,
""
));
super
(
"用户:{} 权限不足或者对象不存在, {}."
,
effectivePerson
.
getDistinguishedName
(),
Objects
.
toString
(
message
,
""
));
this
.
setLanguageKey
(
this
.
getClass
().
getName
()+
"_1"
);
}
}
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionEntityNotExist.java
浏览文件 @
124e84c8
...
@@ -7,33 +7,37 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -7,33 +7,37 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.JpaObject
;
public
class
ExceptionEntityNotExist
extends
PromptException
{
public
class
ExceptionEntityNotExist
extends
Language
PromptException
{
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
public
static
String
defaultMessage
=
"标识为:{} 的 {} 对象不存在."
;
public
ExceptionEntityNotExist
(
String
flag
,
JpaObject
jpa
)
{
public
ExceptionEntityNotExist
(
String
flag
,
JpaObject
jpa
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist"
)
,
flag
,
(
null
==
jpa
)
?
null
:
jpa
.
nameOfEntity
());
super
(
defaultMessage
,
flag
,
(
null
==
jpa
)
?
null
:
jpa
.
nameOfEntity
());
}
}
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
,
Class
<
T
>
cls
)
{
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
,
Class
<
T
>
cls
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist"
)
,
flag
,
(
null
==
cls
)
?
null
:
cls
.
getSimpleName
());
super
(
defaultMessage
,
flag
,
(
null
==
cls
)
?
null
:
cls
.
getSimpleName
());
}
}
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
List
<
String
>
ids
,
Class
<
T
>
cls
)
{
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
List
<
String
>
ids
,
Class
<
T
>
cls
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist"
)
,
(
null
==
ids
)
?
null
:
StringUtils
.
join
(
ids
,
","
),
super
(
defaultMessage
,
(
null
==
ids
)
?
null
:
StringUtils
.
join
(
ids
,
","
),
(
null
==
cls
)
?
null
:
cls
.
getSimpleName
());
(
null
==
cls
)
?
null
:
cls
.
getSimpleName
());
}
}
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
,
String
name
)
{
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
,
String
name
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist"
)
,
flag
,
name
);
super
(
defaultMessage
,
flag
,
name
);
}
}
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
)
{
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
String
flag
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist_1"
),
flag
);
super
(
"标识为:{} 的对象不存在."
,
flag
);
this
.
setLanguageKey
(
this
.
getClass
().
getName
()+
"_1"
);
}
}
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
Class
<
T
>
cls
)
{
public
<
T
extends
JpaObject
>
ExceptionEntityNotExist
(
Class
<
T
>
cls
)
{
super
(
LanguageTools
.
getValue
(
"exception_entityNotExist_2"
),
cls
.
getSimpleName
());
super
(
"类型为: {} 的对象不存在."
,
cls
.
getSimpleName
());
this
.
setLanguageKey
(
this
.
getClass
().
getName
()+
"_2"
);
}
}
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/LanguagePromptException.java
0 → 100644
浏览文件 @
124e84c8
package
com.x.base.core.project.exception
;
import
com.x.base.core.project.logger.MessageFormatter
;
import
com.x.base.core.project.tools.LanguageTools
;
import
org.apache.commons.lang3.StringUtils
;
public
abstract
class
LanguagePromptException
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
1212029031489695352L
;
private
Object
[]
argArray
=
null
;
private
String
languageKey
=
null
;
public
LanguagePromptException
()
{
super
();
}
public
LanguagePromptException
(
String
message
)
{
super
(
message
);
}
public
LanguagePromptException
(
String
message
,
Object
...
os
)
{
super
(
format
(
message
,
os
));
this
.
argArray
=
os
;
}
public
LanguagePromptException
(
Throwable
cause
)
{
super
(
cause
);
}
public
LanguagePromptException
(
Throwable
cause
,
String
message
)
{
super
(
message
,
cause
);
}
public
LanguagePromptException
(
Throwable
cause
,
String
message
,
Object
...
os
)
{
super
(
format
(
message
,
os
),
cause
);
this
.
argArray
=
os
;
}
public
String
getFormatMessage
(
String
key
,
String
language
){
if
(
StringUtils
.
isNotBlank
(
language
)){
language
=
StringUtils
.
split
(
language
,
","
)[
0
].
trim
();
}
if
(
StringUtils
.
isNotBlank
(
this
.
languageKey
)){
key
=
this
.
languageKey
;
}
String
languageString
=
LanguageTools
.
getValue
(
key
,
language
);
if
(
this
.
argArray
!=
null
&&
StringUtils
.
isNotBlank
(
languageString
)){
languageString
=
MessageFormatter
.
arrayFormat
(
languageString
,
this
.
argArray
).
getMessage
();
}
return
languageString
;
}
public
String
getLanguageKey
()
{
return
languageKey
;
}
public
void
setLanguageKey
(
String
languageKey
)
{
this
.
languageKey
=
languageKey
;
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/ResponseFactory.java
浏览文件 @
124e84c8
...
@@ -9,6 +9,7 @@ import javax.ws.rs.core.CacheControl;
...
@@ -9,6 +9,7 @@ import javax.ws.rs.core.CacheControl;
import
javax.ws.rs.core.EntityTag
;
import
javax.ws.rs.core.EntityTag
;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.Response
;
import
com.x.base.core.project.exception.LanguagePromptException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.jetty.http.HttpHeader
;
import
org.eclipse.jetty.http.HttpHeader
;
...
@@ -26,6 +27,8 @@ public class ResponseFactory {
...
@@ -26,6 +27,8 @@ public class ResponseFactory {
public
static
final
String
Accept_Ranges
=
"Accept-Ranges"
;
public
static
final
String
Accept_Ranges
=
"Accept-Ranges"
;
public
static
final
String
Content_Type
=
"Content-Type"
;
public
static
final
String
Content_Type
=
"Content-Type"
;
public
static
final
String
Content_Length
=
"Content-Length"
;
public
static
final
String
Content_Length
=
"Content-Length"
;
public
static
final
String
Accept_Language
=
"Accept-Language"
;
public
static
<
T
>
Response
getDefaultActionResultResponse
(
ActionResult
<
T
>
result
)
{
public
static
<
T
>
Response
getDefaultActionResultResponse
(
ActionResult
<
T
>
result
)
{
if
(
result
.
getType
().
equals
(
ActionResult
.
Type
.
error
))
{
if
(
result
.
getType
().
equals
(
ActionResult
.
Type
.
error
))
{
...
@@ -73,6 +76,10 @@ public class ResponseFactory {
...
@@ -73,6 +76,10 @@ public class ResponseFactory {
public
static
<
T
>
Response
getEntityTagActionResultResponse
(
HttpServletRequest
request
,
ActionResult
<
T
>
result
)
{
public
static
<
T
>
Response
getEntityTagActionResultResponse
(
HttpServletRequest
request
,
ActionResult
<
T
>
result
)
{
if
(
result
.
getType
().
equals
(
ActionResult
.
Type
.
error
))
{
if
(
result
.
getType
().
equals
(
ActionResult
.
Type
.
error
))
{
if
((
result
.
throwable
instanceof
LanguagePromptException
))
{
LanguagePromptException
e
=
(
LanguagePromptException
)
result
.
throwable
;
result
.
setMessage
((
e
.
getFormatMessage
(
result
.
getPrompt
(),
request
.
getHeader
(
Accept_Language
))));
}
if
((
result
.
throwable
instanceof
CallbackPromptException
))
{
if
((
result
.
throwable
instanceof
CallbackPromptException
))
{
return
Response
.
ok
(
callbackError
(
result
)).
build
();
return
Response
.
ok
(
callbackError
(
result
)).
build
();
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录