package com.rehome.jpahefengweather.service.Impl;

import com.rehome.jpahefengweather.dao.TyphoonInfoRepository;
import com.rehome.jpahefengweather.dao.WztfStormInfoRepository;
import com.rehome.jpahefengweather.dao.WztfStormRepository;
import com.rehome.jpahefengweather.dao.ZjsltStormRepository;
import com.rehome.jpahefengweather.entity.WztfStorm;
import com.rehome.jpahefengweather.entity.WztfStormInfo;
import com.rehome.jpahefengweather.service.WztfStormService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class WztfStormServiceImpl implements WztfStormService {

    @Resource
    private WztfStormRepository wztfStormRepository;
    @Resource
    private WztfStormInfoRepository wztfStormInfoRepository;

    @Override
    public WztfStorm findByTfbh(String tfbh) {
        return this.wztfStormRepository.findByTfbh(tfbh);
    }

    @Override
    public List<WztfStorm> findByYear(String year) {
        return this.wztfStormRepository.findByYear(year);
    }

    @Override
    public void saveWztfStorm(WztfStorm wztfStorm) {
        this.wztfStormRepository.save(wztfStorm);
    }

    @Override
    public WztfStormInfo findWztfStormInfoByTfbh(String tfbh) {
        return this.wztfStormInfoRepository.findByTfbh(tfbh);
    }

    @Override
    public void saveWztfStormInfo(WztfStormInfo wztfStormInfo) {
        this.wztfStormInfoRepository.save(wztfStormInfo);
    }
}
