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.LogAccessSelectDto;
import com.jy.log.model.vo.LogAccessVo;
import com.jy.log.service.LogAccessService;
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("/logAccess")
public class LogAccessController {

    @Resource
    private LogAccessService logAccessService;

    /**
     * 访问日志分页
     */
    @GetMapping("/getPage")
    public Page<LogAccessVo> getPage(LogAccessSelectDto dto) {
        return logAccessService.getPage(dto);
    }

    /**
     * 访问日志删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        logAccessService.delete(dto.getIdList());
    }

}
