package com.backendsys.modules.system.controller;

import com.backendsys.modules.common.utils.Result;
import com.backendsys.modules.system.entity.SysLogEntity;
import com.backendsys.modules.system.service.SysLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
@Tag(name = "系统日志")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @Operation(summary = "获取系统日志列表")
    @PreAuthorize("@sr.hasPermission('5.1')")
    @GetMapping("/api/system/log/getLogList")
    public Result getLogList(SysLogEntity sysLogEntity) {
        return Result.success().put("data", sysLogService.selectLogList(sysLogEntity));
    }

}
