package com.YuyeTech.HeartRate.service.impl;

import com.YuyeTech.HeartRate.dataobject.ClientInfo;
import com.YuyeTech.HeartRate.repository.ClientInfoRepository;
import com.YuyeTech.HeartRate.service.ClientInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:slambb
 * @date:2020/9/16
 */
@Service
public class ClientInfoServiceImpl implements ClientInfoService {

    @Autowired
    private ClientInfoRepository clientInfoRepository;

    @Override
    public ClientInfo AddClientInfo(ClientInfo clientInfo) {
        return clientInfoRepository.save(clientInfo);
    }

    @Override
    public ClientInfo findClientInfoByUserId(String userId) {
        return clientInfoRepository.findByUserId(userId).orElse(null);
    }
}
