package com.tongran.rocketmq.service.impl;

import com.tongran.common.core.utils.DateUtils;
import com.tongran.rocketmq.domain.RmNetworkInterfaceChild;
import com.tongran.rocketmq.mapper.RmNetworkInterfaceChildMapper;
import com.tongran.rocketmq.service.IRmNetworkInterfaceChildService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户端网络接口子接口信息Service业务层处理
 * 
 * @author tongran
 * @date 2025-12-15
 */
@Service
public class RmNetworkInterfaceChildServiceImpl implements IRmNetworkInterfaceChildService 
{
    @Autowired
    private RmNetworkInterfaceChildMapper rmNetworkInterfaceChildMapper;

    /**
     * 查询客户端网络接口子接口信息
     * 
     * @param id 客户端网络接口子接口信息主键
     * @return 客户端网络接口子接口信息
     */
    @Override
    public RmNetworkInterfaceChild selectRmNetworkInterfaceChildById(Long id)
    {
        return rmNetworkInterfaceChildMapper.selectRmNetworkInterfaceChildById(id);
    }

    /**
     * 查询客户端网络接口子接口信息列表
     * 
     * @param rmNetworkInterfaceChild 客户端网络接口子接口信息
     * @return 客户端网络接口子接口信息
     */
    @Override
    public List<RmNetworkInterfaceChild> selectRmNetworkInterfaceChildList(RmNetworkInterfaceChild rmNetworkInterfaceChild)
    {
        return rmNetworkInterfaceChildMapper.selectRmNetworkInterfaceChildList(rmNetworkInterfaceChild);
    }

    /**
     * 新增客户端网络接口子接口信息
     * 
     * @param rmNetworkInterfaceChild 客户端网络接口子接口信息
     * @return 结果
     */
    @Override
    public int insertRmNetworkInterfaceChild(RmNetworkInterfaceChild rmNetworkInterfaceChild)
    {
        rmNetworkInterfaceChild.setCreateTime(DateUtils.getNowDate());
        return rmNetworkInterfaceChildMapper.insertRmNetworkInterfaceChild(rmNetworkInterfaceChild);
    }

    /**
     * 修改客户端网络接口子接口信息
     * 
     * @param rmNetworkInterfaceChild 客户端网络接口子接口信息
     * @return 结果
     */
    @Override
    public int updateRmNetworkInterfaceChild(RmNetworkInterfaceChild rmNetworkInterfaceChild)
    {
        rmNetworkInterfaceChild.setUpdateTime(DateUtils.getNowDate());
        return rmNetworkInterfaceChildMapper.updateRmNetworkInterfaceChild(rmNetworkInterfaceChild);
    }

    /**
     * 批量删除客户端网络接口子接口信息
     * 
     * @param ids 需要删除的客户端网络接口子接口信息主键
     * @return 结果
     */
    @Override
    public int deleteRmNetworkInterfaceChildByIds(Long[] ids)
    {
        return rmNetworkInterfaceChildMapper.deleteRmNetworkInterfaceChildByIds(ids);
    }

    /**
     * 删除客户端网络接口子接口信息信息
     * 
     * @param id 客户端网络接口子接口信息主键
     * @return 结果
     */
    @Override
    public int deleteRmNetworkInterfaceChildById(Long id)
    {
        return rmNetworkInterfaceChildMapper.deleteRmNetworkInterfaceChildById(id);
    }

    @Override
    public void deleteRmNetworkInterfaceChildByClientId(String clientId) {
        rmNetworkInterfaceChildMapper.deleteRmNetworkInterfaceChildByClientId(clientId);
    }

    @Override
    public void deleteByParentInterfaceName(String clientId, String name) {
        rmNetworkInterfaceChildMapper.deleteByParentInterfaceName(clientId, name);
    }
}
