package com.gz.controller.system;

import com.github.pagehelper.PageInfo;
import com.gz.rvo.system.LogRVO;
import com.gz.service.system.LogService;
import com.gz.vo.system.LogVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author LiuchangLan
 * @date 2020/9/7 20:15
 */
@RestController
@RequestMapping("system/log")
public class LogController {

    @Resource
    private LogService logService;

    /**
     * @description 查询日志
     * @author LiuChangLan
     * @since 2020/9/7 20:44
     */
    @GetMapping("selectByPage")
    PageInfo<LogRVO> selectByPage(LogVO logVO){
        return logService.selectByPage(logVO);
    }

    /**
     * @description 查询日志模块
     * @author LiuChangLan
     * @since 2020/9/7 20:44
     */
    @GetMapping("selectLogModule")
    List<String> selectLogModule(){
        return logService.selectLogModule();
    }

    /**
     * @description 查询日志具体操作
     * @author LiuChangLan
     * @since 2020/9/7 20:45
     */
    @GetMapping("selectLogBusiness")
    List<String> selectLogBusiness(String module){
        return logService.selectLogBusiness(module);
    }


    /**
     * @description 查询日志具体操作
     * @author LiuChangLan
     * @since 2020/9/7 20:45
     */
    @GetMapping("clearAll")
    public Integer clearAll() {
        return logService.clearAll();
    }

    /**
     * @description 查询日志具体操作
     * @author LiuChangLan
     * @since 2020/9/7 20:45
     */
    @GetMapping("clearThirtyOut")
    public Integer clearThirtyOut() {
        return logService.clearThirtyOut();
    }
}
