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
cf745d8e
Commit
cf745d8e
authored
Oct 10, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询会员信息
parent
a7817ea3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
MemberInfoController.java
.../java/com/egolm/film/api/member/MemberInfoController.java
+15
-1
MemberService.java
src/main/java/com/egolm/film/common/MemberService.java
+2
-0
MemberServiceImpl.java
...in/java/com/egolm/film/common/impl/MemberServiceImpl.java
+6
-1
MemberTokenServiceImpl.java
...egolm/film/login/service/impl/MemberTokenServiceImpl.java
+2
-2
No files found.
src/main/java/com/egolm/film/api/member/MemberInfoController.java
View file @
cf745d8e
package
com
.
egolm
.
film
.
api
.
member
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.film.bean.Fc_member
;
import
com.egolm.film.common.MemberService
;
import
com.egolm.film.login.service.MemberTokenService
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -17,11 +22,20 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping
(
"member/info"
)
public
class
MemberInfoController
{
@Autowired
private
MemberTokenService
tokenService
;
@Autowired
private
MemberService
memberService
;
@ResponseBody
@PostMapping
(
"query"
)
@ApiOperation
(
"查询会员基本信息"
)
public
Object
query
()
{
return
Rjx
.
jsonOk
();
LoginToken
loginToken
=
tokenService
.
getToken
();
Integer
id
=
(
Integer
)
loginToken
.
getId
();
Fc_member
member
=
memberService
.
getMemberById
(
id
);
return
Rjx
.
jsonOk
().
setData
(
member
);
}
@ResponseBody
...
...
src/main/java/com/egolm/film/common/MemberService.java
View file @
cf745d8e
...
...
@@ -12,4 +12,6 @@ public interface MemberService {
void
saveMember
(
Fc_member
member
);
Fc_member
getMemberById
(
Integer
id
);
}
src/main/java/com/egolm/film/common/impl/MemberServiceImpl.java
View file @
cf745d8e
...
...
@@ -18,7 +18,6 @@ public class MemberServiceImpl implements MemberService {
@Override
public
void
changePassword
(
String
id
,
String
newPassword
)
{
String
sql
=
"update fc_member set password = ? where id = ?"
;
jdbcTemplate
.
executeUpdate
(
sql
,
this
.
encodePassword
(
newPassword
),
id
);
}
...
...
@@ -38,4 +37,10 @@ public class MemberServiceImpl implements MemberService {
jdbcTemplate
.
save
(
member
);
}
@Override
public
Fc_member
getMemberById
(
Integer
id
)
{
String
sql
=
"select * from fc_member where id = ?"
;
return
jdbcTemplate
.
queryForBean
(
sql
,
Fc_member
.
class
,
id
);
}
}
src/main/java/com/egolm/film/login/service/impl/MemberTokenServiceImpl.java
View file @
cf745d8e
...
...
@@ -36,8 +36,8 @@ public class MemberTokenServiceImpl implements MemberTokenService {
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
Integer
state
=
(
Integer
)
map
.
get
(
"state"
);
if
(
state
==
1
)
{
Integer
adminid
=
(
Integer
)
map
.
get
(
"admin
id"
);
LoginToken
token
=
new
LoginToken
(
admin
id
);
Integer
id
=
(
Integer
)
map
.
get
(
"
id"
);
LoginToken
token
=
new
LoginToken
(
id
);
session
.
setAttribute
(
TOKEN_NAME
,
token
);
return
token
;
}
else
if
(
state
==
2
)
{
...
...
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