| | |
| | | package com.ruoyi.web.controller.monitor;
|
| | |
|
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.core.page.TableDataInfo;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.system.domain.SysLogininfor;
|
| | | import com.ruoyi.system.service.ISysLogininforService;
|
| | |
|
| | | /**
|
| | | * 系统访问记录
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/logininfor")
|
| | | public class SysLogininforController extends BaseController
|
| | | {
|
| | | @Autowired
|
| | | private ISysLogininforService logininforService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysLogininfor logininfor)
|
| | | {
|
| | | startPage();
|
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysLogininfor logininfor)
|
| | | {
|
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
| | | return util.exportExcel(list, "登录日志");
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{infoIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] infoIds)
|
| | | {
|
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean()
|
| | | {
|
| | | logininforService.cleanLogininfor();
|
| | | return AjaxResult.success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统访问记录 |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Api(value = "系统访问记录", tags = {"系统访问记录管理"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController { |
| | | |
| | | private final ISysLogininforService logininforService; |
| | | |
| | | @ApiOperation("查询系统访问记录列表") |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | 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) { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response); |
| | | } |
| | | |
| | | @ApiOperation("删除系统访问记录") |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{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<Void> clean() { |
| | | logininforService.cleanLogininfor(); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |