package com.YuyeTech.HeartRate.game.cHistoricalCalorie.service;

import com.YuyeTech.HeartRate.common.service.*;
import com.YuyeTech.HeartRate.game.cHistoricalCalorie.projo.CHistoricalCalorie;
import com.YuyeTech.HeartRate.game.cHistoricalCalorie.vo.CHistoricalCalorieVo;
import com.YuyeTech.HeartRate.game.cHistoricalCalorie.repository.CHistoricalCalorieRepository;
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 CHistoricalCalorieServiceImpl extends CommonServiceImpl<CHistoricalCalorieVo, CHistoricalCalorie, Integer> implements CHistoricalCalorieService{

    @PersistenceContext
    private EntityManager em;
    @Autowired
    private CHistoricalCalorieRepository cHistoricalCalorieRepository;

    @Override
    public CHistoricalCalorie findByToday() {
        return cHistoricalCalorieRepository.findByCreateTime().orElse(null);
    }
}
