package com.sooka.system.service.impl;

import java.util.List;

import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sooka.system.mapper.TULogMapper;
import com.sooka.system.domain.TULog;
import com.sooka.system.service.ITULogService;


/**
 * 接口调用日志Service业务层处理
 *
 * @author lei
 * @date 2021-07-06
 */
@Service
public class TULogServiceImpl implements ITULogService
{
    @Autowired
    private TULogMapper tULogMapper;

    /**
     * 查询接口调用日志
     *
     * @param id 接口调用日志ID
     * @return 接口调用日志
     */
    @Override
    public TULog selectTULogById(String id)
    {
        return tULogMapper.selectTULogById(id);
    }

    /**
     * 查询接口调用日志列表
     *
     * @param tULog 接口调用日志
     * @return 接口调用日志
     */
    @Override
    public List<TULog> selectTULogList(TULog tULog)
    {
        return tULogMapper.selectTULogList(tULog);
    }

    /**
     * 新增接口调用日志
     *
     * @param tULog 接口调用日志
     * @return 结果
     */
    @Override
    public int insertTULog(TULog tULog)
    {
        tULog.setCreateTime(DateUtils.getNowDate());
        return tULogMapper.insertTULog(tULog);
    }

    /**
     * 修改接口调用日志
     *
     * @param tULog 接口调用日志
     * @return 结果
     */
    @Override
    public int updateTULog(TULog tULog)
    {
        tULog.setUpdateTime(DateUtils.getNowDate());
        return tULogMapper.updateTULog(tULog);
    }

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

    /**
     * 删除接口调用日志信息
     *
     * @param id 接口调用日志ID
     * @return 结果
     */
    @Override
    public int deleteTULogById(String id)
    {
        return tULogMapper.deleteTULogById(id);
    }
}
