package com.YuyeTech.TPlat.service.impl;

import com.YuyeTech.TPlat.dataobject.AppleInfo;
import com.YuyeTech.TPlat.repository.AppleInfoServiceRepository;
import com.YuyeTech.TPlat.service.AppleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:slambb
 * @date:2020/6/4
 */
@Service
public class AppleInfoServiceImpl 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);
    }
}
