shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
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
package com.iplatform.base.controller;
 
import com.iplatform.base.SystemController;
import com.iplatform.base.pojo.log.LoginLogParam;
import com.iplatform.base.service.LogServiceImpl;
import com.iplatform.model.po.S_login_info;
import com.walker.db.page.GenericPager;
import com.walker.web.ResponseValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 登录日志查询。
 * @date 2023-01-04
 */
@RestController
@RequestMapping("/monitor/login_info")
public class LoginInfoController extends SystemController {
 
    private LogServiceImpl logService;
 
    @Autowired
    public LoginInfoController(LogServiceImpl logService){
        this.logService = logService;
    }
 
    @RequestMapping("/select/clean")
    public ResponseValue clear(){
        this.logService.execClearLoginLog();
        return ResponseValue.success();
    }
 
    @RequestMapping("/list")
    public ResponseValue list(LoginLogParam loginLogParam){
//        this.preparePageSearch();
        GenericPager<S_login_info> pager = null;
        if(loginLogParam == null){
            pager = this.logService.queryPageLoginLogList(null, null, null);
        } else {
            pager = this.logService.queryPageLoginLogList(loginLogParam.getIpaddr()
                    , loginLogParam.getUserName(), loginLogParam.getStatus());
        }
//        return this.acquireTablePage(pager.getDatas(), pager.getTotalRows());
        return ResponseValue.success(pager);
    }
}