package com.foreverwin.mesnac.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.mapper.WebServiceLogMapper;
import com.foreverwin.mesnac.common.model.WebServiceLog;
import com.foreverwin.mesnac.common.service.WebServiceLogService;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * WebService日志 服务实现类
 * </p>
 *
 * @author Ervin Chen
 * @since 2021-01-11
 */
@Service
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public class WebServiceLogServiceImpl extends ServiceImpl<WebServiceLogMapper, WebServiceLog> implements WebServiceLogService {


    @Autowired
    private WebServiceLogMapper webServiceLogMapper;

    @Override
    public IPage<WebServiceLog> selectPage(FrontPage<WebServiceLog> frontPage, WebServiceLog webServiceLog) {
        QueryWrapper<WebServiceLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(webServiceLog);
        return super.page(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<WebServiceLog> selectList(WebServiceLog webServiceLog) {
        QueryWrapper<WebServiceLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(webServiceLog);
        return super.list(queryWrapper);
    }


}