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
fc015f76
Commit
fc015f76
authored
Oct 29, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加部分审片接口
parent
7502085e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
205 additions
and
2 deletions
+205
-2
UserReviewController.java
...in/java/com/egolm/film/api/user/UserReviewController.java
+92
-0
UserReviewService.java
...va/com/egolm/film/api/user/service/UserReviewService.java
+18
-0
UserReviewServiceImpl.java
...olm/film/api/user/service/impl/UserReviewServiceImpl.java
+93
-0
UserTokenServiceImpl.java
...golm/film/api/user/service/impl/UserTokenServiceImpl.java
+2
-2
No files found.
src/main/java/com/egolm/film/api/user/UserReviewController.java
0 → 100644
View file @
fc015f76
package
com
.
egolm
.
film
.
api
.
user
;
import
java.util.List
;
import
java.util.Map
;
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.common.jdbc.Page
;
import
com.egolm.film.api.member.MemberApplyController
;
import
com.egolm.film.api.user.service.UserReviewService
;
import
com.egolm.film.api.user.service.UserTokenService
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
@Api
@Controller
@RequestMapping
(
"user/review"
)
public
class
UserReviewController
{
@Autowired
private
UserTokenService
tokenService
;
@Autowired
private
UserReviewService
reviewService
;
@ResponseBody
@PostMapping
(
"review_list"
)
@ApiOperation
(
"已审核列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
false
,
name
=
"index"
,
value
=
"分页页码"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
false
,
name
=
"limit"
,
value
=
"分页大小"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
false
,
name
=
"limitKey"
,
value
=
"分页排序"
,
allowMultiple
=
true
),
})
public
Object
getReviewList
(
Long
index
,
Long
limit
,
String
[]
limitKey
)
{
index
=
index
==
null
?
1
:
index
;
limit
=
limit
==
null
?
20
:
limit
;
LoginToken
loginToken
=
tokenService
.
getToken
();
Integer
user_id
=
(
Integer
)
loginToken
.
getId
();
Page
page
=
new
Page
(
index
,
limit
,
limitKey
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitReviewByUserId
(
user_id
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
@ResponseBody
@PostMapping
(
"unview_list"
)
@ApiOperation
(
"未审核列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
false
,
name
=
"index"
,
value
=
"分页页码"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
false
,
name
=
"limit"
,
value
=
"分页大小"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
false
,
name
=
"limitKey"
,
value
=
"分页排序"
,
allowMultiple
=
true
),
})
public
Object
getUnviewList
(
Long
index
,
Long
limit
,
String
[]
limitKey
)
{
LoginToken
loginToken
=
tokenService
.
getToken
();
Integer
user_id
=
(
Integer
)
loginToken
.
getId
();
Page
page
=
new
Page
(
index
,
limit
,
limitKey
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitUnviewByUserId
(
user_id
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
@ResponseBody
@PostMapping
(
"allot_detail"
)
@ApiOperation
(
"影片信息详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"film_id"
,
value
=
"影片ID"
),
})
public
Object
getAllotDetail
(
Long
film_id
)
{
Map
<
String
,
Object
>
map
=
reviewService
.
queryAllotDetailByFilmId
(
film_id
);
Long
member_film_id
=
reviewService
.
queryMemberFilmIdByFilmId
(
film_id
);
return
Rjx
.
jsonOk
().
setData
(
map
).
set
(
"member_film_id"
,
member_film_id
);
}
@Autowired
MemberApplyController
memberApplyController
;
@ResponseBody
@PostMapping
(
"member_film_detail"
)
@ApiOperation
(
"获取全部申报信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"member_film_id"
,
value
=
"申报影片ID"
)})
public
Object
getMemberFilmDetail
(
Long
member_film_id
)
{
return
memberApplyController
.
getDetail
(
member_film_id
);
}
}
src/main/java/com/egolm/film/api/user/service/UserReviewService.java
0 → 100644
View file @
fc015f76
package
com
.
egolm
.
film
.
api
.
user
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
UserReviewService
{
List
<
Map
<
String
,
Object
>>
limitReviewByUserId
(
Integer
user_id
,
Page
page
);
List
<
Map
<
String
,
Object
>>
limitUnviewByUserId
(
Integer
user_id
,
Page
page
);
Map
<
String
,
Object
>
queryAllotDetailByFilmId
(
Long
film_id
);
Long
queryMemberFilmIdByFilmId
(
Long
film_id
);
}
src/main/java/com/egolm/film/api/user/service/impl/UserReviewServiceImpl.java
0 → 100644
View file @
fc015f76
package
com
.
egolm
.
film
.
api
.
user
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.user.service.UserReviewService
;
@Service
public
class
UserReviewServiceImpl
implements
UserReviewService
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Override
public
List
<
Map
<
String
,
Object
>>
limitReviewByUserId
(
Integer
user_id
,
Page
page
)
{
String
sql
=
""
+
" select "
+
"film.*, "
+
"allot.uid, "
+
"allot.review_round, "
+
"allot.film_id, "
+
"review.is_save, "
+
"review.state review_state, "
+
"review.save_state "
+
"from "
+
"fc_film_allot allot "
+
"left join fc_film film on film.id = allot.film_id "
+
"left join fc_film_review review on review.film_id = allot.film_id and review.uid = allot.uid and review.round = allot.review_round "
+
"where "
+
"allot.uid = ? "
+
"and review.state > 0"
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
user_id
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
limitUnviewByUserId
(
Integer
user_id
,
Page
page
)
{
String
sql
=
""
+
" select "
+
"film.*, "
+
"allot.uid, "
+
"allot.review_round, "
+
"allot.film_id, "
+
"review.is_save, "
+
"review.state review_state, "
+
"review.save_state "
+
"from "
+
"fc_film_allot allot "
+
"left join fc_film film on film.id = allot.film_id "
+
"left join fc_film_review review on review.film_id = allot.film_id and review.uid = allot.uid and review.round = allot.review_round "
+
"where "
+
"allot.uid = ? "
+
"and review.state is null"
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
user_id
);
}
@Override
public
Map
<
String
,
Object
>
queryAllotDetailByFilmId
(
Long
film_id
)
{
String
sql
=
""
+
"SELECT "
+
"allot.*, "
+
"review.round, "
+
"review.review_time, "
+
"review.state, "
+
"review.veto, "
+
"review.video_intro, "
+
"review.video_features, "
+
"review.select_result, "
+
"review.award_1_score, "
+
"review.award_2_score, "
+
"review.award_3_score, "
+
"review.award_4_score, "
+
"review.award_5_score, "
+
"user.realname "
+
"FROM fc_film_allot as allot "
+
"LEFT JOIN fc_film_review as review on allot.film_id = review.film_id and allot.review_round = review.round and allot.uid = review.uid "
+
"LEFT JOIN fc_user as user on allot.uid = user.uid "
+
"WHERE "
+
"allot.film_id = '?'"
;
return
jdbcTemplate
.
queryForMap
(
sql
,
film_id
);
}
@Override
public
Long
queryMemberFilmIdByFilmId
(
Long
film_id
)
{
String
sql
=
"select mf.id from fc_member_film mf, fc_film f where mf.film_no = f.film_no and f.id = ?"
;
return
jdbcTemplate
.
queryForLong
(
sql
,
film_id
);
}
}
src/main/java/com/egolm/film/api/user/service/impl/UserTokenServiceImpl.java
View file @
fc015f76
...
...
@@ -32,8 +32,8 @@ public class UserTokenServiceImpl implements UserTokenService {
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
uid
=
(
Integer
)
map
.
get
(
"u
id"
);
LoginToken
token
=
new
LoginToken
(
u
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