package com.ff.game.service.impl;

import java.util.List;
import com.ff.base.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.game.mapper.GameFreeRecordMapper;
import com.ff.game.domain.GameFreeRecord;
import com.ff.game.service.IGameFreeRecordService;

/**
 * 免费赠送游戏记录Service业务层处理
 *
 * @author shi
 * @date 2025-02-10
 */
@Service
public class GameFreeRecordServiceImpl implements IGameFreeRecordService
{
    @Autowired
    private GameFreeRecordMapper gameFreeRecordMapper;

    /**
     * 查询免费赠送游戏记录
     *
     * @param id 免费赠送游戏记录主键
     * @return 免费赠送游戏记录
     */
    @Override
    public GameFreeRecord selectGameFreeRecordById(Long id)
    {
        return gameFreeRecordMapper.selectGameFreeRecordById(id);
    }

    /**
     * 查询免费赠送游戏记录列表
     *
     * @param gameFreeRecord 免费赠送游戏记录
     * @return 免费赠送游戏记录
     */
    @Override
    public List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord)
    {
        return gameFreeRecordMapper.selectGameFreeRecordList(gameFreeRecord);
    }

    /**
     * 新增免费赠送游戏记录
     *
     * @param gameFreeRecord 免费赠送游戏记录
     * @return 结果
     */
    @Override
    public int insertGameFreeRecord(GameFreeRecord gameFreeRecord)
    {
        gameFreeRecord.setCreateTime(DateUtils.getNowDate());
        return gameFreeRecordMapper.insertGameFreeRecord(gameFreeRecord);
    }

    /**
     * 修改免费赠送游戏记录
     *
     * @param gameFreeRecord 免费赠送游戏记录
     * @return 结果
     */
    @Override
    public int updateGameFreeRecord(GameFreeRecord gameFreeRecord)
    {
        gameFreeRecord.setUpdateTime(DateUtils.getNowDate());
        return gameFreeRecordMapper.updateGameFreeRecord(gameFreeRecord);
    }

    /**
     * 批量删除免费赠送游戏记录
     *
     * @param ids 需要删除的免费赠送游戏记录主键
     * @return 结果
     */
    @Override
    public int deleteGameFreeRecordByIds(Long[] ids)
    {
        return gameFreeRecordMapper.deleteGameFreeRecordByIds(ids);
    }

    /**
     * 删除免费赠送游戏记录信息
     *
     * @param id 免费赠送游戏记录主键
     * @return 结果
     */
    @Override
    public int deleteGameFreeRecordById(Long id)
    {
        return gameFreeRecordMapper.deleteGameFreeRecordById(id);
    }
}
