package cn.superdesk.uniorder.dubbo.provider.sys.logger;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.logger.SysUserOperationLog;
import cn.superdesk.uniorder.dto.param.system.logger.SysUserOperationLogParam;
import cn.superdesk.uniorder.dto.param.system.logger.SysUserOperationLogQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.sys.logger.DubboSysUserOperationLogService;
import cn.superdesk.uniorder.service.sys.logger.SysUserOperationLogService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @Description: 操作日志
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2020-12-10 17:17:34
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-12-10 17:17:34
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysUserOperationLogServiceImpl implements DubboSysUserOperationLogService {

	@Autowired
	private SysUserOperationLogService sysUserOperationLogService;


	/****************************************** extends BaseService 部分 start ******************************************/

	@Override
	public void addObj(SysUserOperationLogParam param) {

		SysUserOperationLog sysUserOperationLog = AnBeanUtils.copy(param, SysUserOperationLog.class);
		sysUserOperationLogService.insertSelective(sysUserOperationLog);

	}

	@Override
	public void updateObj(SysUserOperationLogParam param) {

		SysUserOperationLog sysUserOperationLog = AnBeanUtils.copy(param, SysUserOperationLog.class);
		sysUserOperationLogService.updateByPrimaryKeySelective(sysUserOperationLog);
	}

	@Override
	public void deleteObj(Long id) {
		sysUserOperationLogService.deleteObj(id);
	}

	@Override
	public SysUserOperationLog findById(Long id) {
		return sysUserOperationLogService.findById(id);
	}

	@Override
	public PageInfo<SysUserOperationLog> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return sysUserOperationLogService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<SysUserOperationLog> findAll(Map<String, Object> queryMap) {

		return sysUserOperationLogService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	@Override
	public void addSysUserOperationLog(SysUserOperationLogParam param) {

		SysUserOperationLog sysUserOperationLog = AnBeanUtils.copy(param, SysUserOperationLog.class);
		sysUserOperationLogService.addSysUserOperationLog(sysUserOperationLog);
	}

	@Override
	public void updateSysUserOperationLog(SysUserOperationLogParam param) {

		SysUserOperationLog sysUserOperationLog = AnBeanUtils.copy(param, SysUserOperationLog.class);
		sysUserOperationLogService.updateSysUserOperationLog(sysUserOperationLog);
	}

	@Override
	public void deleteSysUserOperationLog(Long id) {
		sysUserOperationLogService.deleteSysUserOperationLog(id);
	}

	@Override
	public SysUserOperationLog findSysUserOperationLogById(Long id) {
		return sysUserOperationLogService.findSysUserOperationLogById(id);
	}

	@Override
	public R<List<SysUserOperationLog>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return sysUserOperationLogService.pageQuery(conditions, pageNun, pageSize);

	}

	@Override
	public R<List<SysUserOperationLog>> pageQueryGenericParam(SysUserOperationLogQueryCriteria criteria) {
		return sysUserOperationLogService.pageQueryGenericParam(criteria);
	}
}
