package com.younike.admin.controller.system.monitor;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.younike.common.core.controller.BaseController;
import com.younike.common.core.page.PageDomain;
import com.younike.common.core.page.PageParam;
import com.younike.common.core.page.TableSupport;
import com.younike.service.pojo.SysOperLog;
import com.younike.service.service.ISysOperLogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenpengfei
 */
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperLogController extends BaseController {
    @Autowired
    private ISysOperLogService sysOperLogService;

    /**
     * 操作日志信息列表
     *
     * @param sysOperLog
     * @return
     */
    @GetMapping("/list")
    public Page list(SysOperLog sysOperLog) {
        PageDomain pageDomain = TableSupport.buildPageRequest();
        Integer pageNum = pageDomain.getPageNum();
        Integer pageSize = pageDomain.getPageSize();
        PageParam pageParam = new PageParam(pageNum,pageSize);

        Page<SysOperLog> sysOperLogs = sysOperLogService.selectOperLogList(pageParam,sysOperLog);
        return sysOperLogs;
    }
}
