package com.itheima.service.impl;

import com.itheima.dao.MoneyPackageDao;
import com.itheima.domain.MoneyPackage;
import com.itheima.service.MoneyPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*****
 * @Author: http://www.itheima.com
 * @Description: com.itheima.service.impl.MoneyPackageServiceImpl
 ****/
@Service
public class MoneyPackageServiceImpl implements MoneyPackageService {

    @Autowired
    private MoneyPackageDao moneyPackageDao;

    /***
     * 加载所有延时发放的红包
     * @return
     */
    @Override
    public List<MoneyPackage> loadDelayData() {
        return moneyPackageDao.loadDelayData();
    }

    /***
     * 变更加载状态
     * @param id
     * @param type ：1 未加载，2 已加载 , 3已落Redis缓存库
     */
    @Override
    public int modifyHasload(Integer id, Integer type,Integer oldType) {
        return moneyPackageDao.modifyHasload(id,type,oldType);
    }
}
