package com.jy.log.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jy.framework.model.base.BaseSelectDto;
import com.jy.log.model.dto.LogOperateSelectDto;
import com.jy.log.model.vo.LogOperateVo;
import com.jy.log.service.LogOperateService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作日志 前端控制器
 * </p>
 *
 * @author
 * @since 2024-09-03
 */
@RestController
@RequestMapping("/logOperate")
public class LogOperateController {

    @Resource
    private LogOperateService logOperateService;

    /**
     * 操作日志分页
     */
    @GetMapping("/getPage")
    public Page<LogOperateVo> getPage(LogOperateSelectDto dto) {
        return logOperateService.getPage(dto);
    }

    /**
     * 操作日志明细
     */
    @GetMapping("/getDetail")
    public LogOperateVo getDetail(BaseSelectDto dto) {
        return logOperateService.getDetail(dto.getId());
    }

    /**
     * 操作日志删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        logOperateService.delete(dto.getIdList());
    }

}
