licailing 5 yıl önce
ebeveyn
işleme
b5706fad82

+ 2 - 2
src/main/java/com/izouma/dingdong/domain/Coupon.java

@@ -59,8 +59,8 @@ public class Coupon extends BaseEntity implements Serializable {
 //    @Convert(converter = LongArrayConverter.class)
 //    private Set<Long> categoryIds = new HashSet<>();
 
-    @ApiModelProperty(value = "是否过期", name = "isExpired")
-    private Boolean isExpired;
+//    @ApiModelProperty(value = "是否过期", name = "isExpired")
+//    private Boolean isExpired;
 
     @Column(nullable = false)
     private Boolean enabled = true;

+ 2 - 2
src/main/java/com/izouma/dingdong/service/CouponService.java

@@ -18,11 +18,11 @@ public class CouponService {
     private CouponRepo couponRepo;
     private MerchantService merchantService;
 
-    public List<Coupon> my(Long userId,Boolean isAll) {
+    public List<Coupon> my(Long userId, Boolean isAll) {
         Long merchantId = merchantService.findMerchantId(userId);
         List<Coupon> coupons = couponRepo.findAllByMerchantIdAndEnabledTrue(merchantId);
         if (isAll) {
-            return coupons;
+            return coupons.stream().filter(c -> !c.getStartDate().isBefore(LocalDate.now())).collect(Collectors.toList());
         }
         return coupons.stream().filter(c -> !c.getEndDate().isBefore(LocalDate.now())).collect(Collectors.toList());
     }