Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
5625c73b
Commit
5625c73b
authored
Oct 11, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化注册校验
parent
8d0cfc7f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
4 deletions
+26
-4
MemberOpenApiController.java
...main/java/com/egolm/film/api/MemberOpenApiController.java
+4
-0
ApplyModel.java
...main/java/com/egolm/film/api/member/model/ApplyModel.java
+13
-0
MemberService.java
...java/com/egolm/film/api/member/service/MemberService.java
+2
-0
MemberServiceImpl.java
...egolm/film/api/member/service/impl/MemberServiceImpl.java
+5
-0
Common.java
src/main/java/com/egolm/film/config/Common.java
+0
-4
messages_en_US.properties
src/main/resources/i18n/messages_en_US.properties
+1
-0
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+1
-0
No files found.
src/main/java/com/egolm/film/api/MemberOpenApiController.java
View file @
5625c73b
...
...
@@ -20,6 +20,7 @@ import com.egolm.film.bean.Fc_member;
import
com.egolm.film.common.EmailService
;
import
com.egolm.film.common.Messages
;
import
com.egolm.film.config.Common
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.interceptor.LocaleSessionInterceptor
;
import
io.swagger.annotations.Api
;
...
...
@@ -62,6 +63,9 @@ public class MemberOpenApiController {
member
.
setCreate_time
(
System
.
currentTimeMillis
());
member
.
setLang
(
locale
==
null
?
"zh"
:
locale
.
getLanguage
());
member
.
setState
(
1
);
if
(
memberService
.
exists
(
email
))
{
throw
new
XException
(
messages
.
get
(
"sys.err.user_exists"
));
}
memberService
.
saveMember
(
member
);
return
Rjx
.
jsonOk
();
}
...
...
src/main/java/com/egolm/film/api/member/model/ApplyModel.java
View file @
5625c73b
...
...
@@ -5,6 +5,11 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public
class
ApplyModel
{
/**
* 会员影片表主键
*/
private
String
id
;
/**
* 基本信息
...
...
@@ -519,4 +524,12 @@ public class ApplyModel {
this
.
film_apply_country
=
film_apply_country
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
}
src/main/java/com/egolm/film/api/member/service/MemberService.java
View file @
5625c73b
...
...
@@ -20,5 +20,7 @@ public interface MemberService {
void
updateMember
(
Integer
id
,
String
email
,
String
realname
,
String
address
,
String
company
,
String
tel
);
List
<
Map
<
String
,
Object
>>
queryListByMemberID
(
Integer
member_id
);
boolean
exists
(
String
email
);
}
src/main/java/com/egolm/film/api/member/service/impl/MemberServiceImpl.java
View file @
5625c73b
...
...
@@ -57,4 +57,9 @@ public class MemberServiceImpl implements MemberService {
return
jdbcTemplate
.
queryForList
(
sql
,
member_id
);
}
@Override
public
boolean
exists
(
String
email
)
{
return
jdbcTemplate
.
queryForInt
(
"select count(*) from fc_member where email = ?"
,
email
)
>
0
;
}
}
src/main/java/com/egolm/film/config/Common.java
View file @
5625c73b
...
...
@@ -17,10 +17,6 @@ public class Common {
return
new
String
(
text
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getGenerateString
(
8
));
}
public
static
String
encodePassword
(
String
password
,
String
salt
)
{
return
StringUtil
.
toMD5HexString
(
StringUtil
.
toMD5HexString
(
password
+
salt
).
toLowerCase
().
substring
(
4
,
24
)).
toLowerCase
();
}
...
...
src/main/resources/i18n/messages_en_US.properties
View file @
5625c73b
...
...
@@ -5,5 +5,6 @@ sys.err=System error
sys.err.user_disabled
=
User disabled
sys.err.user_pwd_err
=
User or password error
sys.err.user_pwd_null
=
User and passowrd can not be null
sys.err.user_exists
=
User already exists
msg.test
=
Test
\ No newline at end of file
src/main/resources/i18n/messages_zh_CN.properties
View file @
5625c73b
...
...
@@ -5,5 +5,6 @@ sys.err=\u7CFB\u7EDF\u9519\u8BEF
sys.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
sys.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
msg.test=
\u
6D4B
\u
8BD5
\ No newline at end of file
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