package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.AllInterfaceName;
import com.ruoyi.system.mapper.AllInterfaceNameMapper;
import com.ruoyi.system.service.IAllInterfaceNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 所有接口名称Service业务层处理
 * 
 * @author gyt
 * @date 2025-08-25
 */
@Service
public class AllInterfaceNameServiceImpl implements IAllInterfaceNameService 
{
    @Autowired
    private AllInterfaceNameMapper allInterfaceNameMapper;

    /**
     * 查询所有接口名称
     * 
     * @param id 所有接口名称主键
     * @return 所有接口名称
     */
    @Override
    public AllInterfaceName selectAllInterfaceNameById(Long id)
    {
        return allInterfaceNameMapper.selectAllInterfaceNameById(id);
    }

    /**
     * 查询所有接口名称列表
     * 
     * @param allInterfaceName 所有接口名称
     * @return 所有接口名称
     */
    @Override
    public List<AllInterfaceName> selectAllInterfaceNameList(AllInterfaceName allInterfaceName)
    {
        return allInterfaceNameMapper.selectAllInterfaceNameList(allInterfaceName);
    }

    /**
     * 新增所有接口名称
     * 
     * @param allInterfaceName 所有接口名称
     * @return 结果
     */
    @Override
    public int insertAllInterfaceName(AllInterfaceName allInterfaceName)
    {
        allInterfaceName.setCreateTime(DateUtils.getNowDate());
        return allInterfaceNameMapper.insertAllInterfaceName(allInterfaceName);
    }

    /**
     * 修改所有接口名称
     * 
     * @param allInterfaceName 所有接口名称
     * @return 结果
     */
    @Override
    public int updateAllInterfaceName(AllInterfaceName allInterfaceName)
    {
        allInterfaceName.setUpdateTime(DateUtils.getNowDate());
        return allInterfaceNameMapper.updateAllInterfaceName(allInterfaceName);
    }

    /**
     * 批量删除所有接口名称
     * 
     * @param ids 需要删除的所有接口名称主键
     * @return 结果
     */
    @Override
    public int deleteAllInterfaceNameByIds(Long[] ids)
    {
        return allInterfaceNameMapper.deleteAllInterfaceNameByIds(ids);
    }

    /**
     * 删除所有接口名称信息
     * 
     * @param id 所有接口名称主键
     * @return 结果
     */
    @Override
    public int deleteAllInterfaceNameById(Long id)
    {
        return allInterfaceNameMapper.deleteAllInterfaceNameById(id);
    }

    @Override
    public List<AllInterfaceName> getAllDeviceSn(AllInterfaceName interfaceName) {
        return allInterfaceNameMapper.getAllDeviceSn(interfaceName);
    }
    @Override
    public List<AllInterfaceName> getAllSwitchSn(AllInterfaceName allInterfaceName){
        return allInterfaceNameMapper.getAllSwitchSn(allInterfaceName);
    }
}
