package com.ruoyi.rocketmq.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rocketmq.mapper.InitialHeartbeatListenMapper;
import com.ruoyi.rocketmq.domain.InitialHeartbeatListen;
import com.ruoyi.rocketmq.service.IInitialHeartbeatListenService;

/**
 * 心跳信息Service业务层处理
 * 
 * @author gyt
 * @date 2025-09-08
 */
@Service
public class InitialHeartbeatListenServiceImpl implements IInitialHeartbeatListenService 
{
    @Autowired
    private InitialHeartbeatListenMapper initialHeartbeatListenMapper;

    /**
     * 查询心跳信息
     * 
     * @param clientId 心跳信息主键
     * @return 心跳信息
     */
    @Override
    public InitialHeartbeatListen selectInitialHeartbeatListenByClientId(String clientId)
    {
        return initialHeartbeatListenMapper.selectInitialHeartbeatListenByClientId(clientId);
    }

    /**
     * 查询心跳信息列表
     * 
     * @param initialHeartbeatListen 心跳信息
     * @return 心跳信息
     */
    @Override
    public List<InitialHeartbeatListen> selectInitialHeartbeatListenList(InitialHeartbeatListen initialHeartbeatListen)
    {
        return initialHeartbeatListenMapper.selectInitialHeartbeatListenList(initialHeartbeatListen);
    }

    /**
     * 新增心跳信息
     * 
     * @param initialHeartbeatListen 心跳信息
     * @return 结果
     */
    @Override
    public int insertInitialHeartbeatListen(InitialHeartbeatListen initialHeartbeatListen)
    {
        initialHeartbeatListen.setCreateTime(DateUtils.getNowDate());
        return initialHeartbeatListenMapper.insertInitialHeartbeatListen(initialHeartbeatListen);
    }

    /**
     * 修改心跳信息
     * 
     * @param initialHeartbeatListen 心跳信息
     * @return 结果
     */
    @Override
    public int updateInitialHeartbeatListen(InitialHeartbeatListen initialHeartbeatListen)
    {
        initialHeartbeatListen.setUpdateTime(DateUtils.getNowDate());
        return initialHeartbeatListenMapper.updateInitialHeartbeatListen(initialHeartbeatListen);
    }

    /**
     * 批量删除心跳信息
     * 
     * @param clientIds 需要删除的心跳信息主键
     * @return 结果
     */
    @Override
    public int deleteInitialHeartbeatListenByClientIds(String[] clientIds)
    {
        return initialHeartbeatListenMapper.deleteInitialHeartbeatListenByClientIds(clientIds);
    }

    /**
     * 删除心跳信息信息
     * 
     * @param clientId 心跳信息主键
     * @return 结果
     */
    @Override
    public int deleteInitialHeartbeatListenByClientId(String clientId)
    {
        return initialHeartbeatListenMapper.deleteInitialHeartbeatListenByClientId(clientId);
    }
}
