基于javaweb+mysql的springboot+mybatis电影院售票购票电影票管理系统(前台、后台)(java+springboot+ssm+thymeleaf+html+mysql)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
前台用户:查看电影列表、查看排版、选座购票、查看个人信息
后台管理员:管理电影排版,活动,会员,退票,影院,统计等
前台:
后台:
技术框架
SpringBoot SpringMVC MyBatis Thymeleaf HTML JavaScript Ajax
基于javaweb+mysql的SpringBoot+MyBatis电影院售票购票电影票管理系统(前台、后台)(java+springboot+ssm+thymeleaf+html+mysql)
@PostMapping("/add")
public ResponseVO addVIP(@RequestParam int userId){
return vipService.addVIPCard(userId);
}
@GetMapping("{userId}/get")
public ResponseVO getVIP(@PathVariable int userId){
return vipService.getCardByUserId(userId);
}
@GetMapping("/getVIPInfo")
public ResponseVO getVIPInfo(){
return vipService.getVIPInfo();
}
@PostMapping("/charge")
public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return vipService.getAllVip_Strategy();
}
@PostMapping("/add/strategy")
public ResponseVO addStrategy(@RequestParam int chargeLimit ,int giftAmount)
{return vipService.issueVIP_Strategy(chargeLimit,giftAmount);}
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
@GetMapping("/get/all/user")
public ResponseVO getAllUser(){return accountService.getAllUser();}
@PostMapping("/delete/user")
public ResponseVO deleteUser(@RequestParam int userId){return accountService.deleteUser(userId);}
}
package com.demo.controller.promotion;
/**
*/
@RestController()
@RequestMapping("/vip")
public class VIPCardController {
@Autowired
VIPService vipService;
@Autowired
AccountService accountService;
@PostMapping("/add")
public ResponseVO addVIP(@RequestParam int userId){
return vipService.addVIPCard(userId);
}
@GetMapping("{userId}/get")
public ResponseVO getVIP(@PathVariable int userId){
return vipService.getCardByUserId(userId);
}
@GetMapping("/getVIPInfo")
public ResponseVO getVIPInfo(){
return vipService.getVIPInfo();
}
@PostMapping("/charge")
public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);
}
@RequestMapping(value = "/schedule/{id}", method = RequestMethod.GET)
public ResponseVO getScheduleById(@PathVariable int id){
return scheduleService.getScheduleById(id);
}
}
package com.demo.controller.user;
*/
@Controller
public class ViewController {
@RequestMapping(value = "/index")
public String getIndex() {
return "index";
}
@RequestMapping(value = "/signUp")
public String getSignUp() {
return "signUp";
}
@RequestMapping(value = "/admin/movie/manage")
public String getAdminMovieManage() {
return "adminMovieManage";
}
@RequestMapping(value = "/admin/session/manage")
public String getAdminSessionManage() {
return "adminScheduleManage";
}
@RequestMapping(value = "/admin/cinema/manage")
public String getAdminCinemaManage() {
return "adminCinemaManage";
}
@RequestMapping(value = "/admin/promotion/manage")
public String getAdminPromotionManage() {
return "adminPromotionManage";
}
@RequestMapping(value = "/admin/cinema/statistic")
public String getAdminCinemaStatistic() {
return "adminCinemaStatistic";
}
@RequestMapping(value = "/admin/movieDetail")
public String getAdminMovieDetail(@RequestParam int id) { return "adminMovieDetail"; }
@RequestMapping(value = "/user/home")
public String getUserHome() {
@PostMapping("/charge")
public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return vipService.getAllVip_Strategy();
}
@PostMapping("/add/strategy")
public ResponseVO addStrategy(@RequestParam int chargeLimit ,int giftAmount)
{return vipService.issueVIP_Strategy(chargeLimit,giftAmount);}
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
}
package com.demo.controller.sales;
/**
*/
@RestController
@RequestMapping("/ticket")
public class MovieController {
@Autowired
private MovieService movieService;
@Autowired
private MovieLikeService movieLikeService;
@RequestMapping(value = "/movie/add", method = RequestMethod.POST)
public ResponseVO addMovie(@RequestBody MovieForm addMovieForm){
return movieService.addMovie(addMovieForm);
}
@RequestMapping(value = "/movie/{id}/{userId}", method = RequestMethod.GET)
public ResponseVO searchOneMovieByIdAndUserId(@PathVariable int id, @PathVariable int userId){
return movieService.searchOneMovieByIdAndUserId(id, userId);
}
@RequestMapping(value = "/movie/all", method = RequestMethod.GET)
public ResponseVO searchAllMovie(){
//返回结果中包括已经下架的电影
return movieService.searchAllMovie();
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);
}
@RequestMapping(value = "/schedule/{id}", method = RequestMethod.GET)
public ResponseVO getScheduleById(@PathVariable int id){
return scheduleService.getScheduleById(id);
}
}
package com.demo.controller.user;
}
@GetMapping("/get/{userId}")
public ResponseVO getTicketByUserId(@PathVariable int userId){
return ticketService.getTicketByUser(userId);
}
@GetMapping("/get/occupiedSeats")
public ResponseVO getOccupiedSeats(@RequestParam int scheduleId){
return ticketService.getBySchedule(scheduleId);
}
@PostMapping("/cancel")
public ResponseVO cancelTicket(@RequestParam List<Integer> ticketId){
return ticketService.cancelTicket(ticketId);
}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
}
package com.demo.controller.statistics;
/**
*/
@RestController
public class StatisticsController {
@Autowired
private StatisticsService statisticsService;
@RequestMapping(value = "statistics/scheduleRate", method = RequestMethod.GET)
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return vipService.getAllVip_Strategy();
}
@PostMapping("/add/strategy")
public ResponseVO addStrategy(@RequestParam int chargeLimit ,int giftAmount)
{return vipService.issueVIP_Strategy(chargeLimit,giftAmount);}
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
}
package com.demo.controller.sales;
/**
*/
@RestController
return ticketService.getBySchedule(scheduleId);
}
@PostMapping("/cancel")
public ResponseVO cancelTicket(@RequestParam List<Integer> ticketId){
return ticketService.cancelTicket(ticketId);
}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
}
package com.demo.controller.statistics;
/**
*/
@RestController
public class StatisticsController {
@Autowired
private StatisticsService statisticsService;
@RequestMapping(value = "statistics/scheduleRate", method = RequestMethod.GET)
public ResponseVO getScheduleRateByDate(@RequestParam(required = false) Date date){
//此处date为非必填参数,若不填则默认为当天
return statisticsService.getScheduleRateByDate(date);
}
@RequestMapping(value = "statistics/boxOffice/total", method = RequestMethod.GET)
public ResponseVO getTotalBoxOffice(){
return statisticsService.getTotalBoxOffice();
}
@RequestMapping(value = "statistics/audience/price", method = RequestMethod.GET)
@RequestMapping(value = "/movie/add", method = RequestMethod.POST)
public ResponseVO addMovie(@RequestBody MovieForm addMovieForm){
return movieService.addMovie(addMovieForm);
}
@RequestMapping(value = "/movie/{id}/{userId}", method = RequestMethod.GET)
public ResponseVO searchOneMovieByIdAndUserId(@PathVariable int id, @PathVariable int userId){
return movieService.searchOneMovieByIdAndUserId(id, userId);
}
@RequestMapping(value = "/movie/all", method = RequestMethod.GET)
public ResponseVO searchAllMovie(){
//返回结果中包括已经下架的电影
return movieService.searchAllMovie();
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);
}
private HallService hallService;
@RequestMapping(value = "hall/all", method = RequestMethod.GET)
public ResponseVO searchAllHall(){
return hallService.searchAllHall();
}
@RequestMapping(value = "hall/add", method = RequestMethod.POST)
public ResponseVO addHall(@RequestBody Hall addHallForm){return hallService.addHall( addHallForm);}
@RequestMapping(value = "hall/update", method = RequestMethod.POST)
public ResponseVO updateHall(@RequestBody Hall updateHallForm){return hallService.updateHall( updateHallForm);}
}
package com.demo.commmon.interceptor;
/**
*/
public class SessionInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception{
HttpSession session=httpServletRequest.getSession();
if(null!=session && null!=session.getAttribute(InterceptorConfiguration.SESSION_KEY)){
return true;
}
httpServletResponse.sendRedirect("/index");
return false;
}
}
package com.demo.controller.promotion;
/**
*/
@RestController
@RequestMapping("/coupon")
public class CouponController {
@Autowired
@PostMapping("/add")
public ResponseVO addVIP(@RequestParam int userId){
return vipService.addVIPCard(userId);
}
@GetMapping("{userId}/get")
public ResponseVO getVIP(@PathVariable int userId){
return vipService.getCardByUserId(userId);
}
@GetMapping("/getVIPInfo")
public ResponseVO getVIPInfo(){
return vipService.getVIPInfo();
}
@PostMapping("/charge")
public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return vipService.getAllVip_Strategy();
}
@PostMapping("/add/strategy")
public ResponseVO addStrategy(@RequestParam int chargeLimit ,int giftAmount)
{return vipService.issueVIP_Strategy(chargeLimit,giftAmount);}
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
}
package com.demo.controller.sales;
@Autowired
AccountService accountService;
@PostMapping("/add")
public ResponseVO addVIP(@RequestParam int userId){
return vipService.addVIPCard(userId);
}
@GetMapping("{userId}/get")
public ResponseVO getVIP(@PathVariable int userId){
return vipService.getCardByUserId(userId);
}
@GetMapping("/getVIPInfo")
public ResponseVO getVIPInfo(){
return vipService.getVIPInfo();
}
@PostMapping("/charge")
public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
return vipService.charge(vipCardForm);
}
@GetMapping("/get/all/strategy")
public ResponseVO getAllStrategy(){
return vipService.getAllVip_Strategy();
}
@PostMapping("/add/strategy")
public ResponseVO addStrategy(@RequestParam int chargeLimit ,int giftAmount)
{return vipService.issueVIP_Strategy(chargeLimit,giftAmount);}
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
}
package com.demo.controller.sales;
public ResponseVO getMoviePlacingRateByDate(@RequestParam Date date){
return statisticsService.getMoviePlacingRateByDate(date);
}
@RequestMapping(value = "statistics/popular/movie", method = RequestMethod.GET)
public ResponseVO getPopularMovies(@RequestParam int days, @RequestParam int movieNum){
return statisticsService.getPopularMovies(days, movieNum);
}
}
package com.demo.controller.sales;
/**
*/
@RestController
public class RefundController {
@Autowired
RefundService refundService;
@PostMapping("/refund")
public ResponseVO refundTicket(@RequestParam int ticketId){//System.out.println("refundController ticketId:"+ticketId);
return refundService.refundTicket(ticketId);
}
@GetMapping("/get/all/refund")
public ResponseVO getAllPolicy(){
return refundService.getAllPolicy();
}
public String getUserBuy() {
return "userBuy";
}
@RequestMapping(value = "/user/movieDetail")
public String getUserMovieDetail(@RequestParam int id) {
return "userMovieDetail";
}
@RequestMapping(value = "/user/movieDetail/buy")
public String getUserMovieBuy(@RequestParam int id) {
return "userMovieBuy";
}
@RequestMapping(value = "/user/cost")
public String getUserCost() {
return "userCost";
}
@RequestMapping(value = "/user/movie")
public String getUserMovie() {
return "userMovie";
}
@RequestMapping(value = "/user/member")
public String getUserMember() {
return "userMember";
}
@RequestMapping(value = "/admin/vip/manage")
public String getAdminVipManage() { return "adminVipManage"; }
@RequestMapping(value = "/admin/refund/manage")
public String getAdminRefundManage() { return "adminRefundManage"; }
@RequestMapping(value="/user/info")
public String getUserInfo(){return "userInfo";}
@RequestMapping(value="/boss/manage")
public String getBossManage(){return "bossManage";}
}
package com.demo.controller.management;
return movieService.addMovie(addMovieForm);
}
@RequestMapping(value = "/movie/{id}/{userId}", method = RequestMethod.GET)
public ResponseVO searchOneMovieByIdAndUserId(@PathVariable int id, @PathVariable int userId){
return movieService.searchOneMovieByIdAndUserId(id, userId);
}
@RequestMapping(value = "/movie/all", method = RequestMethod.GET)
public ResponseVO searchAllMovie(){
//返回结果中包括已经下架的电影
return movieService.searchAllMovie();
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
/**电影管理
*/
@RestController
public class MovieController {
@Autowired
private MovieService movieService;
@Autowired
private MovieLikeService movieLikeService;
@RequestMapping(value = "/movie/add", method = RequestMethod.POST)
public ResponseVO addMovie(@RequestBody MovieForm addMovieForm){
return movieService.addMovie(addMovieForm);
}
@RequestMapping(value = "/movie/{id}/{userId}", method = RequestMethod.GET)
public ResponseVO searchOneMovieByIdAndUserId(@PathVariable int id, @PathVariable int userId){
return movieService.searchOneMovieByIdAndUserId(id, userId);
}
@RequestMapping(value = "/movie/all", method = RequestMethod.GET)
public ResponseVO searchAllMovie(){
//返回结果中包括已经下架的电影
return movieService.searchAllMovie();
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
public ResponseVO addRefundPolicy(@RequestBody RefundPolicy policy){
return refundService.addRefundPolicy(policy);
}
@PostMapping("/update/refund")
public ResponseVO updateRefundPolicy(@RequestBody RefundPolicy policy){
return refundService.updateRefundPolicy(policy);
}
@PostMapping("/delete/refund")
public ResponseVO deleteRefundPolicy(@RequestParam int target_id){
return refundService.deleteRefundPolicy(target_id);
}
}
package com.demo.controller.management;
/**影厅管理
*/
@RestController
public class HallController {
@Autowired
private HallService hallService;
@RequestMapping(value = "hall/all", method = RequestMethod.GET)
public ResponseVO searchAllHall(){
return hallService.searchAllHall();
}
@RequestMapping(value = "hall/add", method = RequestMethod.POST)
public ResponseVO addHall(@RequestBody Hall addHallForm){return hallService.addHall( addHallForm);}
@RequestMapping(value = "hall/update", method = RequestMethod.POST)
public ResponseVO updateHall(@RequestBody Hall updateHallForm){return hallService.updateHall( updateHallForm);}
}
package com.demo.commmon.interceptor;
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
public ResponseVO updateMovie(@RequestBody MovieForm updateMovieForm){
return movieService.updateMovie(updateMovieForm);
}
}
package com.demo.controller.router;
/**
*/
@Controller
public class ViewController {
@RequestMapping(value = "/index")
public String getIndex() {
return "index";
}
@RequestMapping(value = "/signUp")
public String getSignUp() {
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
public ResponseVO updateMovie(@RequestBody MovieForm updateMovieForm){
return movieService.updateMovie(updateMovieForm);
}
}
package com.demo.controller.router;
*/
@RestController
public class HallController {
@Autowired
private HallService hallService;
@RequestMapping(value = "hall/all", method = RequestMethod.GET)
public ResponseVO searchAllHall(){
return hallService.searchAllHall();
}
@RequestMapping(value = "hall/add", method = RequestMethod.POST)
public ResponseVO addHall(@RequestBody Hall addHallForm){return hallService.addHall( addHallForm);}
@RequestMapping(value = "hall/update", method = RequestMethod.POST)
public ResponseVO updateHall(@RequestBody Hall updateHallForm){return hallService.updateHall( updateHallForm);}
}
package com.demo.commmon.interceptor;
/**
*/
public class SessionInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception{
HttpSession session=httpServletRequest.getSession();
if(null!=session && null!=session.getAttribute(InterceptorConfiguration.SESSION_KEY)){
return true;
}
httpServletResponse.sendRedirect("/index");
return false;
}
}
package com.demo.controller.promotion;
/**
*/
public class SessionInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception{
HttpSession session=httpServletRequest.getSession();
if(null!=session && null!=session.getAttribute(InterceptorConfiguration.SESSION_KEY)){
return true;
}
httpServletResponse.sendRedirect("/index");
return false;
}
}
package com.demo.controller.promotion;
/**
*/
@RestController
@RequestMapping("/coupon")
public class CouponController {
@Autowired
CouponService couponService;
@GetMapping("{userId}/get")
public ResponseVO getCoupons(@PathVariable int userId){
return couponService.getCouponsByUser(userId);
}
@GetMapping("/get/all")
public ResponseVO getAllCoupon(){return couponService.getAllCoupon();}
@PostMapping("/send")
public ResponseVO sendCoupon(@RequestParam int couponId,@RequestParam int[] userId){return couponService.sendCoupon(couponId,userId);}
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
AccountService accountService;
@PostMapping("/vip/buy")
public ResponseVO buyTicketByVIPCard(@RequestParam List<Integer> ticketId, @RequestParam int couponId){
return ticketService.completeByVIPCard(ticketId,couponId);
}
@PostMapping("/lockSeat")
public ResponseVO lockSeat(@RequestBody TicketForm ticketForm){
return ticketService.addTicket(ticketForm);
}
@PostMapping("/buy")
public ResponseVO buyTicket(@RequestParam List<Integer> ticketId,@RequestParam int couponId){
return ticketService.completeTicket(ticketId,couponId);
}
@GetMapping("/get/{userId}")
public ResponseVO getTicketByUserId(@PathVariable int userId){
return ticketService.getTicketByUser(userId);
}
@GetMapping("/get/occupiedSeats")
public ResponseVO getOccupiedSeats(@RequestParam int scheduleId){
return ticketService.getBySchedule(scheduleId);
}
@PostMapping("/cancel")
public ResponseVO cancelTicket(@RequestParam List<Integer> ticketId){
return ticketService.cancelTicket(ticketId);
}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
}
package com.demo.controller.statistics;
/**
*/
@RestController
public class StatisticsController {
@Autowired