3
13693261870
2022-09-16 63ba114e70e380442fcbed4a5157ee52c9491216
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.landtool.lanbase.modules.log.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
 
import java.util.List;
import java.util.Map;
 
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.landtool.lanbase.modules.log.entity.LogLogininfo;
import com.landtool.lanbase.modules.log.service.LogLogininfoService;
import com.landtool.lanbase.modules.sys.controller.AbstractController;
import com.landtool.lanbase.common.annotation.LogAction;
import com.landtool.lanbase.common.utils.PageUtils;
import com.landtool.lanbase.common.utils.Query;
import com.landtool.lanbase.common.utils.Result;
 
/**
 * @author lanbase
 * @Description: TODO(登录及身份校验日志)
 * @date 2018-01-16 09:18:41
 */
@RestController
@RequestMapping("/log/logininfo")
@Api(value = "", tags = {"登录及身份校验日志"})
public class LogLogininfoController extends AbstractController{
 
    @Autowired
    private LogLogininfoService logininfoService;
    
    /**
     * 列表
     */
    @LogAction("运维监控,登录校验日志,登录校验日志查询,查询")
    @RequestMapping(value="/list", method ={RequestMethod.POST, RequestMethod.GET})
    @RequiresPermissions("org_user_admin")
    @ApiOperation(
            value = "登录及身份校验日志列表",
            notes = ""
            
            )
    public Result list(@ApiParam(name="params",value="",required=true)@RequestParam Map<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
 
        List<LogLogininfo> logininfoList = logininfoService.queryList(query);
        int total = logininfoService.queryTotal(query);
        
        PageUtils pageUtil = new PageUtils(logininfoList, total, query.getLimit(), query.getPage());
        
        return Result.ok().put("page", pageUtil);
    }
    
    
    /**
     * 信息
     */
    @GetMapping("/info/{loginid}")
    @ApiOperation(
            value = "登录及身份校验日志列表",
            notes = ""
            )
    public Result info(@ApiParam(name="loginid",value="loginid",required=true)@PathVariable("loginid") Long loginid){
        LogLogininfo logininfo = logininfoService.queryObject(loginid);
        
        return Result.ok().put("logininfo", logininfo);
    }
    
    /**
     * 保存
     */
    @PostMapping(value="/save")
    @ApiOperation(
            value = "",
            notes = ""
            )
    public Result save(@ApiParam(name="登录及身份校验日志对象",value="传入json格式",required=true)@RequestBody LogLogininfo logininfo){
        //logininfo.setAppfullname("国家海洋局应用系统整合集成后台管理");
        logininfoService.save(logininfo);
        
        return Result.ok();
    }
    
    /**
     * 修改
     */
    @PostMapping(value="/update")
    @ApiOperation(
            value = "",
            notes = ""
            )
    public Result update(@ApiParam(name="登录日志对象",value="传入json格式",required=true)@RequestBody LogLogininfo logininfo){
        logininfoService.update(logininfo);
        
        return Result.ok();
    }
    
    /**
     * 删除
     */
    @PostMapping("/delete")
    @ApiOperation(
            value = "删除登录日志",
            notes = ""
            )
    public Result delete(@ApiParam(name="loginid",value="loginid",required=true)@RequestBody Long[] loginids){
        logininfoService.deleteBatch(loginids);
        
        return Result.ok();
    }
    
}