| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | /** |
| | | * 系统访问记录 |
| | | * |
| | | * @author ruoyi |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Api(value = "系统访问记录", tags = {"系统访问记录管理"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | public class SysLogininforController extends BaseController { |
| | | |
| | | private final ISysLogininforService logininforService; |
| | | |
| | | @ApiOperation("查询系统访问记录列表") |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) |
| | | { |
| | | public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor) { |
| | | return logininforService.selectPageLogininforList(logininfor); |
| | | } |
| | | |
| | | @ApiOperation("导出系统访问记录列表") |
| | | @Log(title = "登录日志", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | @GetMapping("/export") |
| | | public void export(SysLogininfor logininfor, HttpServletResponse response) |
| | | { |
| | | public void export(SysLogininfor logininfor, HttpServletResponse response) { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response); |
| | | ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response); |
| | | } |
| | | |
| | | @ApiOperation("删除系统访问记录") |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) |
| | | { |
| | | public AjaxResult<Void> remove(@PathVariable Long[] infoIds) { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @ApiOperation("清空系统访问记录") |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | public AjaxResult<Void> clean() { |
| | | logininforService.cleanLogininfor(); |
| | | return AjaxResult.success(); |
| | | } |