Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
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
曲欣亮
sentinel
Commits
21eb10da
Commit
21eb10da
authored
Oct 11, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化国际化信息结构
parent
19d61645
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
MemberOpenApiController.java
...main/java/com/egolm/film/api/MemberOpenApiController.java
+5
-5
messages_en_US.properties
src/main/resources/i18n/messages_en_US.properties
+8
-8
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+8
-8
No files found.
src/main/java/com/egolm/film/api/MemberOpenApiController.java
View file @
21eb10da
...
@@ -51,9 +51,9 @@ public class MemberOpenApiController {
...
@@ -51,9 +51,9 @@ public class MemberOpenApiController {
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
),
})
})
public
Object
register
(
HttpServletRequest
request
,
String
username
,
String
password
,
String
email
)
{
public
Object
register
(
HttpServletRequest
request
,
String
username
,
String
password
,
String
email
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"
sys.
err.email_null"
),
email
);
XException
.
assertNotBlank
(
messages
.
get
(
"err.email_null"
),
email
);
XException
.
assertNotBlank
(
messages
.
get
(
"
sys.
err.name_null"
),
username
);
XException
.
assertNotBlank
(
messages
.
get
(
"err.name_null"
),
username
);
XException
.
assertNotBlank
(
messages
.
get
(
"
sys.
err.pwd_null"
),
password
);
XException
.
assertNotBlank
(
messages
.
get
(
"err.pwd_null"
),
password
);
Locale
locale
=
LocaleContextHolder
.
getLocale
();
Locale
locale
=
LocaleContextHolder
.
getLocale
();
String
salt
=
Common
.
getGenerateString
(
6
);
String
salt
=
Common
.
getGenerateString
(
6
);
String
encodePwd
=
Common
.
encodePassword
(
password
,
salt
);
String
encodePwd
=
Common
.
encodePassword
(
password
,
salt
);
...
@@ -67,7 +67,7 @@ public class MemberOpenApiController {
...
@@ -67,7 +67,7 @@ public class MemberOpenApiController {
member
.
setLang
(
locale
==
null
?
"zh"
:
locale
.
getLanguage
());
member
.
setLang
(
locale
==
null
?
"zh"
:
locale
.
getLanguage
());
member
.
setState
(
1
);
member
.
setState
(
1
);
if
(
memberService
.
exists
(
email
))
{
if
(
memberService
.
exists
(
email
))
{
throw
new
XException
(
messages
.
get
(
"
sys.
err.user_exists"
));
throw
new
XException
(
messages
.
get
(
"err.user_exists"
));
}
}
memberService
.
saveMember
(
member
);
memberService
.
saveMember
(
member
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
...
@@ -78,7 +78,7 @@ public class MemberOpenApiController {
...
@@ -78,7 +78,7 @@ public class MemberOpenApiController {
@ApiOperation
(
"找回密码"
)
@ApiOperation
(
"找回密码"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
)})
public
Object
resetPassword
(
String
email
)
{
public
Object
resetPassword
(
String
email
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"
sys.
err.email_null"
),
email
);
XException
.
assertNotBlank
(
messages
.
get
(
"err.email_null"
),
email
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
String
password
=
String
.
valueOf
(
code
);
String
password
=
String
.
valueOf
(
code
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
...
...
src/main/resources/i18n/messages_en_US.properties
View file @
21eb10da
...
@@ -2,12 +2,12 @@ msg.test=Test
...
@@ -2,12 +2,12 @@ msg.test=Test
email.getPassword.subject
=
China Film Festival [retrieve password] email
email.getPassword.subject
=
China Film Festival [retrieve password] email
email.getPassword.content
=
Hello {0}, Your password is: [{1}]
email.getPassword.content
=
Hello {0}, Your password is: [{1}]
sys.
err
=
System error
err
=
System error
sys.
err.user_disabled
=
User disabled
err.user_disabled
=
User disabled
sys.
err.user_pwd_err
=
User or password error
err.user_pwd_err
=
User or password error
sys.
err.user_pwd_null
=
User and passowrd can not be null
err.user_pwd_null
=
User and passowrd can not be null
sys.
err.user_exists
=
User already exists
err.user_exists
=
User already exists
sys.
err.email_null
=
The mailbox can not be empty
err.email_null
=
The mailbox can not be empty
sys.
err.name_null
=
The username can not be empty
err.name_null
=
The username can not be empty
sys.
err.pwd_null
=
The password can not be empty
err.pwd_null
=
The password can not be empty
src/main/resources/i18n/messages_zh_CN.properties
View file @
21eb10da
...
@@ -2,12 +2,12 @@ msg.test=\u6D4B\u8BD5
...
@@ -2,12 +2,12 @@ msg.test=\u6D4B\u8BD5
email.getPassword.subject
=
\u
4E2D
\u
56FD
\u7535\u
5F71
\u8282
[
\u
627E
\u
56DE
\u
5BC6
\u7801
]
\u
90AE
\u
4EF6
email.getPassword.subject
=
\u
4E2D
\u
56FD
\u7535\u
5F71
\u8282
[
\u
627E
\u
56DE
\u
5BC6
\u7801
]
\u
90AE
\u
4EF6
email.getPassword.content
=
{0}
\u
60A8
\u
597D,
\u
60A8
\u7684\u
65B0
\u
5BC6
\u7801\u
662F: [{1}]
email.getPassword.content
=
{0}
\u
60A8
\u
597D,
\u
60A8
\u7684\u
65B0
\u
5BC6
\u7801\u
662F: [{1}]
sys.
err
=
\u
7CFB
\u
7EDF
\u9519\u
8BEF
err
=
\u
7CFB
\u
7EDF
\u9519\u
8BEF
sys.
err.user_disabled
=
\u7528\u6237\u
5DF2
\u
7ECF
\u7981\u7528
err.user_disabled
=
\u7528\u6237\u
5DF2
\u
7ECF
\u7981\u7528
sys.
err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
sys.
err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.
err.user_exists
=
\u7528\u6237\u
5DF2
\u
5B58
\u5728
err.user_exists
=
\u7528\u6237\u
5DF2
\u
5B58
\u5728
sys.
err.email_null=
\u
90AE
\u
7BB1
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.email_null=
\u
90AE
\u
7BB1
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.
err.name_null
=
\u
59D3
\u
540D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.name_null
=
\u
59D3
\u
540D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.
err.pwd_null
=
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.pwd_null
=
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
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