package com.sooka.system.service.impl;

import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import com.sooka.system.domain.TUInterfaceCrashLog;
import com.sooka.system.mapper.TUInterfaceCrashLogMapper;
import com.sooka.system.service.ITUInterfaceCrashLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 接口崩溃日志Service业务层处理
 */
@Service
public class TUInterfaceCrashLogServiceImpl implements ITUInterfaceCrashLogService
{
    @Autowired
    private TUInterfaceCrashLogMapper tUInterfaceCrashLogMapper;

    /**
     * 查询接口崩溃日志
     *
     * @param id 接口崩溃日志ID
     * @return 接口崩溃日志
     */
    @Override
    public TUInterfaceCrashLog selectTUInterfaceCrashLogById(String id)
    {
        return tUInterfaceCrashLogMapper.selectTUInterfaceCrashLogById(id);
    }

    /**
     * 查询接口崩溃日志列表
     *
     * @param tUInterfaceCrashLog 接口崩溃日志
     * @return 接口崩溃日志
     */
    @Override
    public List<TUInterfaceCrashLog> selectTUInterfaceCrashLogList(TUInterfaceCrashLog tUInterfaceCrashLog)
    {
        return tUInterfaceCrashLogMapper.selectTUInterfaceCrashLogList(tUInterfaceCrashLog);
    }

    /**
     * 新增接口崩溃日志
     *
     * @param tUInterfaceCrashLog 接口崩溃日志
     * @return 结果
     */
    @Override
    public int insertTUInterfaceCrashLog(TUInterfaceCrashLog tUInterfaceCrashLog)
    {
        tUInterfaceCrashLog.setCreateTime(DateUtils.getNowDate());
        return tUInterfaceCrashLogMapper.insertTUInterfaceCrashLog(tUInterfaceCrashLog);
    }

    /**
     * 修改接口崩溃日志
     *
     * @param tUInterfaceCrashLog 接口崩溃日志
     * @return 结果
     */
    @Override
    public int updateTUInterfaceCrashLog(TUInterfaceCrashLog tUInterfaceCrashLog)
    {
        tUInterfaceCrashLog.setUpdateTime(DateUtils.getNowDate());
        return tUInterfaceCrashLogMapper.updateTUInterfaceCrashLog(tUInterfaceCrashLog);
    }

    /**
     * 删除接口崩溃日志对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTUInterfaceCrashLogByIds(String ids)
    {
        return tUInterfaceCrashLogMapper.deleteTUInterfaceCrashLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除接口崩溃日志信息
     *
     * @param id 接口崩溃日志ID
     * @return 结果
     */
    @Override
    public int deleteTUInterfaceCrashLogById(String id)
    {
        return tUInterfaceCrashLogMapper.deleteTUInterfaceCrashLogById(id);
    }
}
