- Timestamp:
- 08/24/23 02:28:14 (15 months ago)
- Branches:
- master
- Children:
- bcb4acc
- Parents:
- 40935d3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java
r40935d3 r1e7126f 1 package com.example.moviezone.service.Impl;public class DiscountServiceImpl { 1 package com.example.moviezone.service.Impl; 2 3 import com.example.moviezone.model.Discount; 4 import com.example.moviezone.repository.DiscountRepository; 5 import com.example.moviezone.service.DiscountService; 6 import org.springframework.stereotype.Service; 7 8 import java.time.LocalDate; 9 import java.util.List; 10 11 @Service 12 public class DiscountServiceImpl implements DiscountService { 13 private final DiscountRepository discountRepository; 14 15 public DiscountServiceImpl(DiscountRepository discountRepository) { 16 this.discountRepository = discountRepository; 17 } 18 19 @Override 20 public Discount save(String code, String type, LocalDate validity, Integer percent) { 21 return discountRepository.save(new Discount(validity,code,type,percent)); 22 } 23 24 @Override 25 public List<Discount> getValidDiscounts() { 26 return discountRepository.getValidDiscounts(); 27 } 2 28 }
Note:
See TracChangeset
for help on using the changeset viewer.