jacksenma 7 years ago
parent
commit
0d87da19f2

+ 17 - 0
src/main/java/com/example/cinema/bl/StatisticsService.java

@@ -28,4 +28,21 @@ public interface StatisticsService {
      * @return
      */
     ResponseVO getAudiencePriceSevenDays();
+
+
+    /**
+     * 获取所有电影某天的某日上座率
+     * 上座率参考公式:假设某影城设有n 个电影厅、m 个座位数,相对上座率=观众人次÷放映场次÷m÷n×100%
+     * @param date
+     * @return
+     */
+    ResponseVO getMoviePlacingRateByDate(Date date);
+
+    /**
+     * 获取最近days天内,最受欢迎的movieNum个电影(可以简单理解为最近days内票房越高的电影越受欢迎)
+     * @param days
+     * @param movieNum
+     * @return
+     */
+    ResponseVO getPopularMovies(int days, int movieNum);
 }

+ 10 - 0
src/main/java/com/example/cinema/blImpl/StatisticsServiceImpl.java

@@ -77,6 +77,16 @@ public class StatisticsServiceImpl implements StatisticsService {
         }
     }
 
+    @Override
+    public ResponseVO getMoviePlacingRateByDate(Date date) {
+        return null;
+    }
+
+    @Override
+    public ResponseVO getPopularMovies(int days, int movieNum) {
+        return null;
+    }
+
 
     /**
      * 获得num天后的日期

+ 15 - 4
src/main/java/com/example/cinema/controller/StatisticsController.java

@@ -3,10 +3,7 @@ package com.example.cinema.controller;
 import com.example.cinema.bl.StatisticsService;
 import com.example.cinema.vo.ResponseVO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 
@@ -35,6 +32,20 @@ public class StatisticsController {
         return statisticsService.getAudiencePriceSevenDays();
     }
 
+    @RequestMapping(value = "statistics/PlacingRate", method = RequestMethod.GET)
+    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);
+    }
+
+
+
+
+