|
|
@@ -1,10 +1,12 @@
|
|
|
package com.example.cinema.po;
|
|
|
|
|
|
-import com.example.cinema.vo.CouponForm;
|
|
|
-import com.example.cinema.vo.MovieForm;
|
|
|
+import com.example.cinema.po.Coupon;
|
|
|
+import com.example.cinema.vo.ActivityVO;
|
|
|
+import com.example.cinema.vo.MovieVO;
|
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* Created by liying on 2019/4/20.
|
|
|
@@ -29,14 +31,50 @@ public class Activity {
|
|
|
*/
|
|
|
private Timestamp endTime;
|
|
|
/**
|
|
|
- * 优惠券id
|
|
|
+ * 优惠电影列表
|
|
|
*/
|
|
|
- private int couponId;
|
|
|
+ private List<Movie> movieList;
|
|
|
+ /**
|
|
|
+ * 优惠券规格
|
|
|
+ */
|
|
|
+ private Coupon coupon;
|
|
|
+
|
|
|
|
|
|
public Activity() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public ActivityVO getVO() {
|
|
|
+ ActivityVO vo = new ActivityVO();
|
|
|
+ vo.setId(id);
|
|
|
+ vo.setCoupon(coupon);
|
|
|
+ vo.setDescription(description);
|
|
|
+ vo.setEndTime(endTime);
|
|
|
+ vo.setStartTime(startTime);
|
|
|
+ vo.setName(name);
|
|
|
+ vo.setMovieList(movieList.stream().map(movie -> {
|
|
|
+ MovieVO mvo = new MovieVO();
|
|
|
+ mvo.setId(movie.getId());
|
|
|
+ mvo.setName(movie.getName());
|
|
|
+ mvo.setPosterUrl(movie.getPosterUrl());
|
|
|
+ mvo.setDirector(movie.getDirector());
|
|
|
+ mvo.setScreenWriter(movie.getScreenWriter());
|
|
|
+ mvo.setStarring(movie.getStarring());
|
|
|
+ mvo.setType(movie.getType());
|
|
|
+ mvo.setCountry(movie.getCountry());
|
|
|
+ mvo.setLanguage(movie.getLanguage());
|
|
|
+ mvo.setStartDate(movie.getStartDate());
|
|
|
+ mvo.setLength(movie.getLength());
|
|
|
+ mvo.setDescription(movie.getDescription());
|
|
|
+ mvo.setStatus(movie.getStatus());
|
|
|
+ mvo.setIslike(movie.getIslike());
|
|
|
+ mvo.setLikeCount(movie.getLikeCount());
|
|
|
+ return mvo;
|
|
|
+ } ).collect(Collectors.toList()));
|
|
|
+ return vo;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public int getId() {
|
|
|
return id;
|
|
|
}
|
|
|
@@ -45,14 +83,6 @@ public class Activity {
|
|
|
this.id = id;
|
|
|
}
|
|
|
|
|
|
- public int getCouponId() {
|
|
|
- return couponId;
|
|
|
- }
|
|
|
-
|
|
|
- public void setCouponId(int couponId) {
|
|
|
- this.couponId = couponId;
|
|
|
- }
|
|
|
-
|
|
|
public String getName() {
|
|
|
return name;
|
|
|
}
|
|
|
@@ -85,4 +115,19 @@ public class Activity {
|
|
|
this.endTime = endTime;
|
|
|
}
|
|
|
|
|
|
+ public List<Movie> getMovieList() {
|
|
|
+ return movieList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMovieList(List<Movie> movieList) {
|
|
|
+ this.movieList = movieList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Coupon getCoupon() {
|
|
|
+ return coupon;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCoupon(Coupon coupon) {
|
|
|
+ this.coupon = coupon;
|
|
|
+ }
|
|
|
}
|