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

import com.YuyeTech.HeartRate.common.service.*;
import com.YuyeTech.HeartRate.game.cDietInfo.projo.CDietInfo;
import com.YuyeTech.HeartRate.game.cDietInfo.vo.CDietInfoVo;
import com.YuyeTech.HeartRate.game.cDietInfo.repository.CDietInfoRepository;
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 CDietInfoServiceImpl extends CommonServiceImpl<CDietInfoVo, CDietInfo, Integer> implements CDietInfoService{

    @PersistenceContext
    private EntityManager em;
    @Autowired
    private CDietInfoRepository cDietInfoRepository;


    @Override
    public CDietInfo findByUserId(String userId) {
        return cDietInfoRepository.findByUserId(userId).orElse(null);
    }
}
