package com.YuyeTech.HeartRate.service.impl;

import com.YuyeTech.HeartRate.repository.FitnessProgramRepository;
import com.YuyeTech.HeartRate.service.FitnessProgramService;
import com.YuyeTech.HeartRate.dataobject.FitnessProgram;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:slambb
 * @date:2019/12/31
 */
@Service
public class FitnessProgramServiceImpl implements FitnessProgramService {

    @Autowired
    private FitnessProgramRepository fitnessProgramRepository;

    @Override
    public FitnessProgram findFitnessProgramById(String userId) {

        FitnessProgram mainInfo = fitnessProgramRepository.findById(userId).orElse(null);
        return mainInfo;
    }

    @Override
    public FitnessProgram addFitnessProgram(FitnessProgram fitnessProgram) {
        return fitnessProgramRepository.save(fitnessProgram);
    }
}
