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.LogExceptionSelectDto;
import com.jy.log.model.vo.LogExceptionVo;
import com.jy.log.service.LogExceptionService;
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("/logException")
public class LogExceptionController {

    @Resource
    private LogExceptionService logExceptionService;

    /**
     * 异常日志分页
     */
    @GetMapping("/getPage")
    public Page<LogExceptionVo> getPage(LogExceptionSelectDto dto) {
        return logExceptionService.getPage(dto);
    }

    /**
     * 异常日志明细
     */
    @GetMapping("/getDetail")
    public LogExceptionVo getDetail(BaseSelectDto dto) {
        return logExceptionService.getDetail(dto.getId());
    }

    /**
     * 异常日志删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        logExceptionService.delete(dto.getIdList());
    }

}
