SysLoginLogServiceImpl.java 1.49 KB
package com.zteits.sys.biz;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.github.pagehelper.PageInfo;
import com.zteits.clouds.api.apibase.bean.BizResult;
import com.zteits.clouds.api.apibase.bean.PageBean;
import com.zteits.clouds.api.dto.sys.SysLoginLogDTO;
import com.zteits.clouds.api.dto.sys.param.SaveLoginLogRequest;
import com.zteits.clouds.api.dto.sys.param.SysLoginLogQueryRequest;
import com.zteits.clouds.api.service.sys.SysLoginLogService;
import com.zteits.sys.dao.SysLoginLogDao;
import com.zteits.sys.domain.SysLoginLog;
import com.zteits.sys.pagepaper.PageBeanUtil;

@Component("com.zteits.sys.biz.SysLoginLogServiceImpl")
public class SysLoginLogServiceImpl implements SysLoginLogService {
	@Autowired
	private SysLoginLogDao sysLoginLogDao; 
	
	@Override
	public BizResult<Boolean> saveLoginLog(SaveLoginLogRequest request) {
		SysLoginLog record = new SysLoginLog();
		BeanUtils.copyProperties(request, record);
		sysLoginLogDao.saveLoginLog(record );
		return new BizResult<Boolean>(true);
	}

	@Override
	public BizResult<PageBean<SysLoginLogDTO>> pageQuerySysLoginLog(SysLoginLogQueryRequest request) {
		PageInfo<SysLoginLog> pageInfo = sysLoginLogDao.pageQuerySysLoginLog(request);
		PageBean<SysLoginLogDTO> pageBean = new PageBean<>();
		PageBeanUtil.copyProperties(pageInfo, pageBean, SysLoginLogDTO.class);
		return new BizResult<PageBean<SysLoginLogDTO>>(pageBean);
	}

}