package com.rehome.jpahefengweather.service.Impl;

import com.rehome.jpahefengweather.dao.NmcNowWeatherRepository;
import com.rehome.jpahefengweather.dao.NmcStormRepository;
import com.rehome.jpahefengweather.entity.NmcStorm;
import com.rehome.jpahefengweather.service.NmcStormService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class NmcStormServiceImpl implements NmcStormService {

    @Resource
    private NmcStormRepository nmcStormRepository;

    @Override
    public NmcStorm findById(Long code) {
        return this.nmcStormRepository.findByCode(code);
    }

    @Override
    public List<NmcStorm> findListByYear(String year) {
        return this.nmcStormRepository.findByYear(year);
    }

    @Override
    public void saveNmcStorm(NmcStorm nmcStorm) {
        this.nmcStormRepository.save(nmcStorm);
    }
}
