Commit 3f0ff363 authored by Quxl's avatar Quxl

完善影片详情接口

parent 0ee9b359
...@@ -11,9 +11,16 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -11,9 +11,16 @@ 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.member.MemberApplyController; import com.egolm.film.api.member.service.MemberService;
import com.egolm.film.api.user.service.UserReviewService; import com.egolm.film.api.user.service.UserReviewService;
import com.egolm.film.api.user.service.UserTokenService; import com.egolm.film.api.user.service.UserTokenService;
import com.egolm.film.bean.Fc_film;
import com.egolm.film.bean.Fc_film_doubtful_point;
import com.egolm.film.bean.Fc_film_review;
import com.egolm.film.bean.Fc_member_film_director;
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_show;
import com.egolm.film.model.LoginToken; import com.egolm.film.model.LoginToken;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -67,6 +74,9 @@ public class UserReviewController { ...@@ -67,6 +74,9 @@ public class UserReviewController {
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
@Autowired
private MemberService memberService;
@ResponseBody @ResponseBody
@PostMapping("allot_detail") @PostMapping("allot_detail")
@ApiOperation("影片信息详情") @ApiOperation("影片信息详情")
...@@ -74,19 +84,25 @@ public class UserReviewController { ...@@ -74,19 +84,25 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "film_id", value="影片ID"), @ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "film_id", value="影片ID"),
}) })
public Object getAllotDetail(Long film_id) { public Object getAllotDetail(Long film_id) {
LoginToken loginToken = tokenService.getToken();
Integer user_id = (Integer)loginToken.getId();
Fc_film film = reviewService.queryFilmById(film_id);
Map<String, Object> map = reviewService.queryAllotDetailByFilmId(film_id); Map<String, Object> map = reviewService.queryAllotDetailByFilmId(film_id);
Long member_film_id = reviewService.queryMemberFilmIdByFilmId(film_id); Long member_film_id = reviewService.queryMemberFilmIdByFilmId(film_id);
return Rjx.jsonOk().setData(map).set("member_film_id", member_film_id); List<Fc_member_film_director> directorList = memberService.queryMemberFilmDirectorList(member_film_id);
List<Fc_member_film_issuer> issuerList = memberService.queryMemberFilmIssuerList(member_film_id);
List<Fc_member_film_playactor> playactorList = memberService.queryMemberFilmPlayactorList(member_film_id);
List<Fc_member_film_show> showList = memberService.queryMemberFilmShowList(member_film_id);
List<Fc_film_review> reviewList = reviewService.queryRoundReviewListByUserId(user_id, film.getRound(), film_id);
List<Fc_film_doubtful_point> doubtfulList = reviewService.queryDoubtfulListByUserId(user_id, film_id);
return Rjx.jsonOk()
.setData(map)
.set("directorList", directorList)
.set("issuerList", issuerList)
.set("playactorList", playactorList)
.set("showList", showList)
.set("reviewList", reviewList)
.set("doubtfulList", doubtfulList);
} }
@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);
}
} }
...@@ -4,6 +4,9 @@ import java.util.List; ...@@ -4,6 +4,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.bean.Fc_film;
import com.egolm.film.bean.Fc_film_doubtful_point;
import com.egolm.film.bean.Fc_film_review;
public interface UserReviewService { public interface UserReviewService {
...@@ -15,4 +18,10 @@ public interface UserReviewService { ...@@ -15,4 +18,10 @@ public interface UserReviewService {
Long queryMemberFilmIdByFilmId(Long film_id); Long queryMemberFilmIdByFilmId(Long film_id);
List<Fc_film_review> queryRoundReviewListByUserId(Integer user_id, Integer round, Long film_id);
List<Fc_film_doubtful_point> queryDoubtfulListByUserId(Integer user_id, Long film_id);
Fc_film queryFilmById(Long film_id);
} }
...@@ -9,6 +9,9 @@ import org.springframework.stereotype.Service; ...@@ -9,6 +9,9 @@ import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.user.service.UserReviewService; import com.egolm.film.api.user.service.UserReviewService;
import com.egolm.film.bean.Fc_film;
import com.egolm.film.bean.Fc_film_doubtful_point;
import com.egolm.film.bean.Fc_film_review;
@Service @Service
public class UserReviewServiceImpl implements UserReviewService { public class UserReviewServiceImpl implements UserReviewService {
...@@ -90,4 +93,21 @@ public class UserReviewServiceImpl implements UserReviewService { ...@@ -90,4 +93,21 @@ public class UserReviewServiceImpl implements UserReviewService {
return jdbcTemplate.queryForLong(sql, film_id); return jdbcTemplate.queryForLong(sql, film_id);
} }
@Override
public List<Fc_film_review> queryRoundReviewListByUserId(Integer user_id, Integer round, Long film_id) {
String sql = "SELECT fc_film_review.* FROM fc_film_review WHERE film_id = ? AND uid = ? AND round = ?";
return jdbcTemplate.queryForBeans(sql, Fc_film_review.class, film_id, user_id, round);
}
@Override
public List<Fc_film_doubtful_point> queryDoubtfulListByUserId(Integer user_id, Long film_id) {
String sql = "SELECT * FROM fc_film_doubtful_point WHERE uid = ? AND film_id = ?";
return jdbcTemplate.queryForBeans(sql, Fc_film_doubtful_point.class, user_id, film_id);
}
@Override
public Fc_film queryFilmById(Long film_id) {
return jdbcTemplate.queryForBean("select * from fc_film where id = ?", Fc_film.class, film_id);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment