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
af74dcae
Commit
af74dcae
authored
Nov 24, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初审成功邮件通知
parent
a7b37774
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
3 deletions
+49
-3
Messages.java
src/main/java/com/egolm/film/api/service/Messages.java
+3
-1
DefaultMessages.java
...java/com/egolm/film/api/service/impl/DefaultMessages.java
+7
-2
AdminFirstController.java
...va/com/egolm/film/api/web/admin/AdminFirstController.java
+26
-0
Common.java
src/main/java/com/egolm/film/util/Common.java
+7
-0
first_pass.txt
src/main/resources/doc/en/first_pass.txt
+3
-0
first_pass.txt
src/main/resources/doc/zh/first_pass.txt
+3
-0
No files found.
src/main/java/com/egolm/film/api/service/Messages.java
View file @
af74dcae
...
@@ -6,6 +6,8 @@ public interface Messages {
...
@@ -6,6 +6,8 @@ public interface Messages {
public
String
get
(
String
name
,
String
...
args
);
public
String
get
(
String
name
,
String
...
args
);
public
String
get
(
String
name
,
Locale
locale
,
String
...
args
);
public
Locale
getLocale
();
public
Locale
getLocale
();
}
}
src/main/java/com/egolm/film/api/service/impl/DefaultMessages.java
View file @
af74dcae
...
@@ -17,11 +17,16 @@ public class DefaultMessages implements Messages {
...
@@ -17,11 +17,16 @@ public class DefaultMessages implements Messages {
@Autowired
@Autowired
protected
MessageSource
messageSource
;
protected
MessageSource
messageSource
;
@Override
public
String
get
(
String
name
,
Locale
locale
,
String
...
args
)
{
return
messageSource
.
getMessage
(
name
,
args
,
locale
);
}
public
String
get
(
String
name
,
String
...
args
)
{
public
String
get
(
String
name
,
String
...
args
)
{
try
{
try
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
Locale
locale
=
LocaleContextHolder
.
getLocale
();
locale
=
locale
==
null
?
Locale
.
CHINA
:
locale
;
locale
=
locale
==
null
?
Locale
.
CHINA
:
locale
;
return
messageSource
.
getMessage
(
name
,
args
,
locale
);
return
this
.
get
(
name
,
locale
,
args
);
}
catch
(
NoSuchMessageException
e
)
{
}
catch
(
NoSuchMessageException
e
)
{
return
name
;
return
name
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/egolm/film/api/web/admin/AdminFirstController.java
View file @
af74dcae
package
com
.
egolm
.
film
.
api
.
web
.
admin
;
package
com
.
egolm
.
film
.
api
.
web
.
admin
;
import
java.text.MessageFormat
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -13,12 +15,17 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -13,12 +15,17 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.AdminTokenService
;
import
com.egolm.film.api.service.AdminTokenService
;
import
com.egolm.film.api.service.EmailService
;
import
com.egolm.film.api.service.FilmService
;
import
com.egolm.film.api.service.FilmService
;
import
com.egolm.film.api.service.MemberService
;
import
com.egolm.film.api.service.Messages
;
import
com.egolm.film.bean.Fc_member
;
import
com.egolm.film.bean.Fc_member_film
;
import
com.egolm.film.bean.Fc_member_film
;
import
com.egolm.film.bean.Fc_member_film_issuer
;
import
com.egolm.film.bean.Fc_member_film_issuer
;
import
com.egolm.film.bean.Fc_member_film_playactor
;
import
com.egolm.film.bean.Fc_member_film_playactor
;
import
com.egolm.film.bean.Fc_member_film_show
;
import
com.egolm.film.bean.Fc_member_film_show
;
import
com.egolm.film.bean.model.Fc_member_film_base_model
;
import
com.egolm.film.bean.model.Fc_member_film_base_model
;
import
com.egolm.film.util.Common
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -41,6 +48,15 @@ public class AdminFirstController {
...
@@ -41,6 +48,15 @@ public class AdminFirstController {
@Autowired
@Autowired
AdminTokenService
tokenService
;
AdminTokenService
tokenService
;
@Autowired
EmailService
emailService
;
@Autowired
MemberService
memberService
;
@Autowired
Messages
messages
;
@ResponseBody
@ResponseBody
@PostMapping
(
"list"
)
@PostMapping
(
"list"
)
@ApiOperation
(
"初审列表分页查询"
)
@ApiOperation
(
"初审列表分页查询"
)
...
@@ -96,6 +112,16 @@ public class AdminFirstController {
...
@@ -96,6 +112,16 @@ public class AdminFirstController {
film
.
setFilm_type_name_short
(
film_type_name_short
);
film
.
setFilm_type_name_short
(
film_type_name_short
);
memberFilmService
.
mergeMemberFilm
(
film
);
memberFilmService
.
mergeMemberFilm
(
film
);
memberFilmService
.
pass
(
member_film_id
);
memberFilmService
.
pass
(
member_film_id
);
Fc_member_film
memberFilm
=
memberFilmService
.
queryMemberFilmById
(
member_film_id
);
Fc_member
member
=
memberService
.
getMemberById
(
memberFilm
.
getMember_id
());
Locale
locale
=
new
Locale
(
"zh"
,
"CN"
);
if
(
"en"
.
equals
(
member
.
getLang
()))
{
locale
=
new
Locale
(
"en"
,
"US"
);
}
String
subject
=
messages
.
get
(
"email.getPassword.subject"
,
locale
);
String
content
=
Common
.
getStringAsStream
(
"classpath:/doc/"
+
member
.
getLang
()
+
"/first_pass.txt"
);
MessageFormat
.
format
(
content
,
member
.
getUsername
(),
memberFilm
.
getId
());
emailService
.
send
(
subject
,
content
,
member
.
getEmail
());
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
...
src/main/java/com/egolm/film/util/Common.java
View file @
af74dcae
package
com
.
egolm
.
film
.
util
;
package
com
.
egolm
.
film
.
util
;
import
java.io.InputStream
;
import
java.util.Random
;
import
java.util.Random
;
import
com.egolm.common.FileUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
public
class
Common
{
public
class
Common
{
...
@@ -21,6 +23,11 @@ public class Common {
...
@@ -21,6 +23,11 @@ public class Common {
return
StringUtil
.
toMD5HexString
(
StringUtil
.
toMD5HexString
(
password
+
salt
).
toLowerCase
().
substring
(
4
,
24
)).
toLowerCase
();
return
StringUtil
.
toMD5HexString
(
StringUtil
.
toMD5HexString
(
password
+
salt
).
toLowerCase
().
substring
(
4
,
24
)).
toLowerCase
();
}
}
public
static
String
getStringAsStream
(
String
filename
)
{
InputStream
stream
=
Common
.
class
.
getClassLoader
().
getResourceAsStream
(
filename
);
return
new
String
(
FileUtil
.
streamToBytes
(
stream
));
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
encodePassword
(
"123456"
,
"XPm3m5"
));
System
.
out
.
println
(
encodePassword
(
"123456"
,
"XPm3m5"
));
System
.
out
.
println
(
getGenerateString
(
6
));
System
.
out
.
println
(
getGenerateString
(
6
));
...
...
src/main/resources/doc/en/first_pass.txt
0 → 100644
View file @
af74dcae
The first trial pass
Username: {0}
Film NO: {1}
\ No newline at end of file
src/main/resources/doc/zh/first_pass.txt
0 → 100644
View file @
af74dcae
初审通过
用户 {0}
影片编号 {1}
\ 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