xiaoyong931011
2021-06-16 2f8f4085cd854cdfc7d3a692c3f77138584141e1
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
package com.xcong.excoin.monitor.controller;
 
import com.xcong.excoin.common.annotation.ControllerEndpoint;
import com.xcong.excoin.common.controller.BaseController;
import com.xcong.excoin.common.entity.FebsResponse;
import com.xcong.excoin.common.entity.QueryRequest;
import com.xcong.excoin.monitor.entity.LoginLog;
import com.xcong.excoin.monitor.service.ILoginLogService;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.wuwenze.poi.ExcelKit;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
 
/**
 * @author MrBird
 */
@Slf4j
@RestController
@RequestMapping("loginLog")
@RequiredArgsConstructor
public class LoginLogController extends BaseController {
 
    private final ILoginLogService loginLogService;
 
    @GetMapping("list")
    @RequiresPermissions("loginlog:view")
    public FebsResponse loginLogList(LoginLog loginLog, QueryRequest request) {
        Map<String, Object> dataTable = getDataTable(this.loginLogService.findLoginLogs(loginLog, request));
        return new FebsResponse().success().data(dataTable);
    }
 
//    @GetMapping("delete/{ids}")
//    @RequiresPermissions("loginlog:delete")
//    @ControllerEndpoint(exceptionMessage = "删除日志失败")
//    public FebsResponse deleteLogss(@NotBlank(message = "{required}") @PathVariable String ids) {
//        String[] loginLogIds = ids.split(StringPool.COMMA);
//        this.loginLogService.deleteLoginLogs(loginLogIds);
//        return new FebsResponse().success();
//    }
 
//    @GetMapping("excel")
//    @RequiresPermissions("loginlog:export")
//    @ControllerEndpoint(exceptionMessage = "导出Excel失败")
//    public void export(QueryRequest request, LoginLog loginLog, HttpServletResponse response) {
//        List<LoginLog> loginLogs = this.loginLogService.findLoginLogs(loginLog, request).getRecords();
//        ExcelKit.$Export(LoginLog.class, response).downXlsx(loginLogs, false);
//    }
}