heheng
5 days ago 3134991a6c9315421ff3d4b3b4f1bd76bb5dbdc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.gkhy.exam.admin.controller.monitor;
 
import com.gkhy.exam.common.annotation.Log;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.enums.BusinessType;
import com.gkhy.exam.framework.web.service.SysPasswordService;
import com.gkhy.exam.system.domain.SysLogininfor;
import com.gkhy.exam.system.service.SysLogininforService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * 系统访问记录
 *
 * @author ruoyi
 */
@Api(tags = "系统访问记录前端控制器")
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController {
    @Autowired
    private SysLogininforService logininforService;
 
    @Autowired
    private SysPasswordService passwordService;
 
    @ApiOperation(value = "系统访问记录列表")
    @GetMapping("/list")
    public CommonResult list(SysLogininfor logininfor)
    {
        return CommonResult.success(logininforService.selectLogininforList(logininfor));
    }
 
    @ApiOperation(value = "批量删除访问记录")
    @Log(title = "登录日志", businessType = BusinessType.DELETE)
    @DeleteMapping("/{infoIds}")
    public CommonResult remove(@PathVariable Long[] infoIds)
    {
        return CommonResult.success(logininforService.deleteLogininforByIds(infoIds));
    }
 
    @ApiOperation(value = "清空访问记录")
    @Log(title = "登录日志", businessType = BusinessType.CLEAN)
    @DeleteMapping("/clean")
    public CommonResult clean()
    {
        logininforService.cleanLogininfor();
        return CommonResult.success();
    }
 
    @ApiOperation(value = "账户解锁")
    @Log(title = "账户解锁", businessType = BusinessType.OTHER)
    @GetMapping("/unlock/{userName}")
    public CommonResult unlock(@PathVariable("userName") String userName)
    {
       // passwordService.clearLoginRecordCache(userName);
        return CommonResult.success();
    }
}