package org.springblade.modules.externalLog.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.externalLog.entity.ExternalLogEntity;
import org.springblade.modules.externalLog.excel.ExternalLogExcel;
import org.springblade.modules.externalLog.mapper.ExternalLogMapper;
import org.springblade.modules.externalLog.service.IExternalLogService;
import org.springblade.modules.externalLog.vo.ExternalLogVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 对外日志 服务实现类
 *
 * @author BladeX
 * @since 2024-01-10
 */
@Service
public class ExternalLogServiceImpl extends BaseServiceImpl<ExternalLogMapper, ExternalLogEntity> implements IExternalLogService {

	@Override
	public IPage<ExternalLogVO> selectExtemalLogPage(IPage<ExternalLogVO> page, ExternalLogVO extemalLog) {
		return page.setRecords(baseMapper.selectExtemalLogPage(page, extemalLog));
	}

	@Override
	public List<ExternalLogExcel> exportExtemalLog(Wrapper<ExternalLogEntity> queryWrapper) {
		List<ExternalLogExcel> extemalLogList = baseMapper.exportExtemalLog(queryWrapper);
		//extemalLogList.forEach(extemalLog -> {
		//	extemalLog.setTypeName(DictCache.getValue(DictEnum.YES_NO, ExtemalLog.getType()));
		//});
		return extemalLogList;
	}

}
