package com.td.boss.game.comrewards.service;

import com.td.boss.common.service.*;
import com.td.boss.game.comrewards.pojo.ComRewards;
import com.td.boss.game.comrewards.vo.ComRewardsVo;
import com.td.boss.game.comrewards.repository.ComRewardsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Service
@Transactional
public class ComRewardsServiceImpl extends CommonServiceImpl<ComRewardsVo, ComRewards, Integer> implements ComRewardsService{

    @PersistenceContext
    private EntityManager em;
    @Autowired
    private ComRewardsRepository comRewardsRepository;

    @Override
    public ComRewards findByUserIdAndType(String userId, Integer type) {
        return comRewardsRepository.findByUserIdAndType(userId,type).orElse(null);
    }
}
