You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
774 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package com.gcc.communityHall.service.Impl;
  2. import java.util.Optional;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5. import com.gcc.communityHall.entity.DiscountRange;
  6. import com.gcc.communityHall.entity.Users;
  7. import com.gcc.communityHall.entity.Users.userType;
  8. import com.gcc.communityHall.repository.DiscountRangeRepository;
  9. import com.gcc.communityHall.service.DiscountRangeService;
  10. @Service
  11. public class DiscountRangeServiceImpl implements DiscountRangeService {
  12. @Autowired
  13. private DiscountRangeRepository discountRangeRepository;
  14. public Optional<DiscountRange> getDiscountByUserType(Users.userType userType) {
  15. return discountRangeRepository.findByUsertype(userType.name());
  16. }
  17. }