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

import com.YuyeTech.HeartRate.common.service.CommonServiceImpl;
import com.YuyeTech.HeartRate.game.TP_AppleInfo.projo.AppleInfo;
import com.YuyeTech.HeartRate.game.TP_AppleInfo.repository.AppleInfoServiceRepository;
import com.YuyeTech.HeartRate.game.TP_AppleInfo.vo.AppleInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author:slambb
 * @date:2020/6/4
 */
@Service
@Transactional
public class AppleInfoServiceImpl extends CommonServiceImpl<AppleInfoVo, AppleInfo, String> implements AppleInfoService {

    @Autowired
    private AppleInfoServiceRepository appleInfoServiceRepository;

    @Override
    public AppleInfo findByAppleId(String appleId) {
        return appleInfoServiceRepository.findByAppleId(appleId).orElse(null);
    }

    @Override
    public AppleInfo addAppleInfo(AppleInfo appleInfo) {
        return appleInfoServiceRepository.save(appleInfo);
    }

}
