package com.ruoyi.web.modules.industryservice.service.impl;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.modules.industryservice.domain.BizPasture;
import com.ruoyi.web.modules.industryservice.domain.vo.YakAssetSyncResultVo;
import com.ruoyi.web.modules.industryservice.mapper.BizPastureMapper;
import com.ruoyi.web.modules.industryservice.service.IBizPastureService;
import com.ruoyi.web.modules.industryservice.service.PastureSyncService;

/**
 * 牧场管理服务实现（列表/详情/第三方同步）。
 */
@Service
public class BizPastureServiceImpl implements IBizPastureService
{
    @Autowired
    private BizPastureMapper bizPastureMapper;

    @Autowired
    private PastureSyncService pastureSyncService;

    @Override
    public BizPasture selectBizPastureById(Long id)
    {
        return bizPastureMapper.selectBizPastureById(id);
    }

    @Override
    public List<BizPasture> selectBizPastureList(BizPasture query)
    {
        List<BizPasture> list = bizPastureMapper.selectBizPastureList(query);
        return list != null ? list : new ArrayList<>();
    }

    @Override
    public YakAssetSyncResultVo syncFromThirdParty()
    {
        return pastureSyncService.syncFromThirdParty();
    }
}
