|
@@ -2,6 +2,7 @@ package com.huaxu.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.huaxu.common.EasyExcelUtil;
|
|
import com.huaxu.dto.LoginLogDto;
|
|
import com.huaxu.dto.LoginLogDto;
|
|
import com.huaxu.entity.LoginLogEntity;
|
|
import com.huaxu.entity.LoginLogEntity;
|
|
import com.huaxu.model.AjaxMessage;
|
|
import com.huaxu.model.AjaxMessage;
|
|
@@ -12,6 +13,7 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -28,6 +30,8 @@ public class LoginLogController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private LoginLogService loginLogService;
|
|
private LoginLogService loginLogService;
|
|
|
|
+ @Value("${UMIS.sys_excel_path}")
|
|
|
|
+ private String baseDir;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 通过主键查询单条数据
|
|
* 通过主键查询单条数据
|
|
@@ -38,7 +42,7 @@ public class LoginLogController {
|
|
@RequestMapping(value = "get", method = RequestMethod.POST)
|
|
@RequestMapping(value = "get", method = RequestMethod.POST)
|
|
@ApiOperation(value = "根据id查询登录日志")
|
|
@ApiOperation(value = "根据id查询登录日志")
|
|
public AjaxMessage<LoginLogDto> selectOne(
|
|
public AjaxMessage<LoginLogDto> selectOne(
|
|
- @ApiParam(value = "登录日志信息", required = true) @RequestParam Integer id) {
|
|
|
|
|
|
+ @ApiParam(value = "登录日志信息", required = true) @RequestParam Long id) {
|
|
LoginLogDto result = loginLogService.selectById(id);
|
|
LoginLogDto result = loginLogService.selectById(id);
|
|
|
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
@@ -96,7 +100,7 @@ public class LoginLogController {
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "delete", method = RequestMethod.POST)
|
|
@RequestMapping(value = "delete", method = RequestMethod.POST)
|
|
@ApiOperation(value = "删除登录日志信息")
|
|
@ApiOperation(value = "删除登录日志信息")
|
|
- public AjaxMessage<Integer> delete(@ApiParam(value = "登录日志信息", required = true) @RequestParam Integer id) {
|
|
|
|
|
|
+ public AjaxMessage<Integer> delete(@ApiParam(value = "登录日志信息", required = true) @RequestParam Long id) {
|
|
int result = loginLogService.deleteById(id);
|
|
int result = loginLogService.deleteById(id);
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
}
|
|
}
|
|
@@ -113,8 +117,8 @@ public class LoginLogController {
|
|
@ApiOperation(value = "查询登录日志信息列表")
|
|
@ApiOperation(value = "查询登录日志信息列表")
|
|
public AjaxMessage<Pagination<LoginLogDto>> selectPage(
|
|
public AjaxMessage<Pagination<LoginLogDto>> selectPage(
|
|
@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto,
|
|
@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto,
|
|
- @ApiParam(value = "页数,非必传,默认第一页", defaultValue = "1") int pageNum,
|
|
|
|
- @ApiParam(value = "条数,非必传,默认15条", defaultValue = "30") int pageSize
|
|
|
|
|
|
+ @ApiParam(value = "页数,非必传,默认第一页", defaultValue = "1") int pageNum,
|
|
|
|
+ @ApiParam(value = "条数,非必传,默认15条", defaultValue = "30") int pageSize
|
|
|
|
|
|
) {
|
|
) {
|
|
IPage<LoginLogDto> iPage = new Page<>(pageNum, pageSize);
|
|
IPage<LoginLogDto> iPage = new Page<>(pageNum, pageSize);
|
|
@@ -125,4 +129,12 @@ public class LoginLogController {
|
|
|
|
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/exportExcel", method = RequestMethod.POST)
|
|
|
|
+ @ApiOperation(value = "登录日志导出")
|
|
|
|
+ public AjaxMessage<String> exportExcel(@ApiParam(value = "日志IDS", required = true) @RequestParam Long[] ids) {
|
|
|
|
+ List<LoginLogDto> result = loginLogService.selectListByIds(ids);
|
|
|
|
+ String filePath = EasyExcelUtil.excelWrite(baseDir, LoginLogDto.class, "登录日志", result);
|
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, filePath);
|
|
|
|
+ }
|
|
}
|
|
}
|