迁移登陆日志的代码

This commit is contained in:
YunaiV 2021-01-18 21:07:14 +08:00
parent 083dac77e1
commit c95f540201
13 changed files with 336 additions and 318 deletions

View File

@ -1,50 +0,0 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
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 com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
/**
* 系统访问记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController {
@Autowired
private ISysLogininforService logininforService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor) {
startPage();
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@GetMapping("/export")
public AjaxResult export(SysLogininfor logininfor) {
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
return util.exportExcel(list, "登录日志");
}
}

View File

@ -1,35 +0,0 @@
import request from '@/utils/request'
// 查询登录日志列表
export function list(query) {
return request({
url: '/monitor/logininfor/list',
method: 'get',
params: query
})
}
// 删除登录日志
export function delLogininfor(infoId) {
return request({
url: '/monitor/logininfor/' + infoId,
method: 'delete'
})
}
// 清空登录日志
export function cleanLogininfor() {
return request({
url: '/monitor/logininfor/clean',
method: 'delete'
})
}
// 导出登录日志
export function exportLogininfor(query) {
return request({
url: '/monitor/logininfor/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,20 @@
import request from '@/utils/request'
// 查询登录日志列表
export function list(query) {
return request({
url: '/system/login-log/page',
method: 'get',
params: query
})
}
// 导出登录日志
export function exportLoginLog(query) {
return request({
url: '/system/login-log/export',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -12,7 +12,8 @@ export const DICT_TYPE = {
SYS_DATA_SCOPE: 'sys_data_scope', SYS_DATA_SCOPE: 'sys_data_scope',
SYS_USER_SEX: 'sys_user_sex', SYS_USER_SEX: 'sys_user_sex',
SYS_NOTICE_TYPE: 'sys_notice_type', SYS_NOTICE_TYPE: 'sys_notice_type',
SYS_OPERATE_TYPE: 'sys_operate_type' SYS_OPERATE_TYPE: 'sys_operate_type',
SYS_LOGIN_RESULT: 'sys_login_result'
} }
/** /**

View File

@ -1,230 +1,185 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr"> <el-form-item label="登录地址" prop="userIp">
<el-input <el-input
v-model="queryParams.ipaddr" v-model="queryParams.userIp"
placeholder="请输入登录地址" placeholder="请输入登录地址"
clearable clearable
style="width: 240px;" style="width: 240px;"
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="用户名称" prop="username">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.username"
placeholder="请输入用户名称" placeholder="请输入用户名称"
clearable clearable
style="width: 240px;" style="width: 240px;"
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="登录状态" placeholder="结果"
clearable clearable
size="small" size="small"
style="width: 240px" style="width: 240px"
> >
<el-option <el-option
v-for="dict in statusOptions" :key="true"
:key="dict.dictValue" label="成功"
:label="dict.dictLabel" :value="true"
:value="dict.dictValue" />
/> <el-option
</el-select> :key="false"
</el-form-item> label="失败"
<el-form-item label="登录时间"> :value="false"
<el-date-picker />
v-model="dateRange" </el-select>
size="small" </el-form-item>
style="width: 240px" <el-form-item label="登录时间">
value-format="yyyy-MM-dd" <el-date-picker
type="daterange" v-model="dateRange"
range-separator="-" size="small"
start-placeholder="开始日期" style="width: 240px"
end-placeholder="结束日期" value-format="yyyy-MM-dd"
></el-date-picker> type="daterange"
</el-form-item> range-separator="-"
<el-form-item> start-placeholder="开始日期"
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> end-placeholder="结束日期"
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> ></el-date-picker>
</el-form-item> </el-form-item>
</el-form> <el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-row :gutter="10" class="mb8"> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-col :span="1.5"> </el-form-item>
<el-button </el-form>
type="danger"
icon="el-icon-delete" <el-row :gutter="10" class="mb8">
size="mini" <el-col :span="1.5">
:disabled="multiple" <el-button
@click="handleDelete" type="warning"
v-hasPermi="['monitor:logininfor:remove']" icon="el-icon-download"
>删除</el-button> size="mini"
</el-col> @click="handleExport"
<el-col :span="1.5"> v-hasPermi="['system:login-log:export']"
<el-button >导出</el-button>
type="danger" </el-col>
icon="el-icon-delete" <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
size="mini" </el-row>
@click="handleClean"
v-hasPermi="['monitor:logininfor:remove']" <el-table v-loading="loading" :data="list">
>清空</el-button> <el-table-column label="访问编号" align="center" prop="id" />
</el-col> <el-table-column label="日志类型" align="center" prop="logType">
<el-col :span="1.5"> <template slot-scope="scope">
<el-button <span>{{ scope.row.logType === 1 ? '登录' : '退出' }}</span>
type="warning" </template>
icon="el-icon-download" </el-table-column>
size="mini" <el-table-column label="用户名称" align="center" prop="username" />
@click="handleExport" <el-table-column label="登录地址" align="center" prop="userIp" width="130" :show-overflow-tooltip="true" />
v-hasPermi="['system:logininfor:export']" <el-table-column label="userAgent" align="center" prop="userAgent" width="400" :show-overflow-tooltip="true" />
>导出</el-button> <el-table-column label="结果" align="center" prop="status">
</el-col> <template slot-scope="scope">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <span v-if="scope.row.result === 0">成功</span>
</el-row> <span v-if="scope.row.result > 0">失败{{ getDictDataLabel(DICT_TYPE.SYS_LOGIN_RESULT, scope.row.result) }} </span>
</template>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> </el-table-column>
<el-table-column type="selection" width="55" align="center" /> <el-table-column label="登录日期" align="center" prop="loginTime" width="180">
<el-table-column label="访问编号" align="center" prop="infoId" /> <template slot-scope="scope">
<el-table-column label="用户名称" align="center" prop="userName" /> <span>{{ parseTime(scope.row.createTime) }}</span>
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" /> </template>
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> </el-table-column>
<el-table-column label="浏览器" align="center" prop="browser" /> </el-table>
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" /> <pagination
<el-table-column label="操作信息" align="center" prop="msg" /> v-show="total>0"
<el-table-column label="登录日期" align="center" prop="loginTime" width="180"> :total="total"
<template slot-scope="scope"> :page.sync="queryParams.pageNo"
<span>{{ parseTime(scope.row.loginTime) }}</span> :limit.sync="queryParams.pageSize"
</template> @pagination="getList"
</el-table-column> />
</el-table> </div>
</template>
<pagination
v-show="total>0" <script>
:total="total" import { list, exportLoginLog } from "@/api/system/loginlog";
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" export default {
@pagination="getList" name: "Logininfor",
/> data() {
</div> return {
</template> //
loading: true,
<script> //
import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/monitor/logininfor"; showSearch: true,
//
export default { total: 0,
name: "Logininfor", //
data() { list: [],
return { //
// statusOptions: [],
loading: true, //
// dateRange: [],
ids: [], //
// queryParams: {
multiple: true, pageNo: 1,
// pageSize: 10,
showSearch: true, userIp: undefined,
// username: undefined,
total: 0, status: undefined
// }
list: [], };
// },
statusOptions: [], created() {
// this.getList();
dateRange: [], },
// methods: {
queryParams: { /** 查询登录日志列表 */
pageNum: 1, getList() {
pageSize: 10, this.loading = true;
ipaddr: undefined, list(this.addDateRange(this.queryParams, [
userName: undefined, this.dateRange[0] ? this.dateRange[0] + ' 00:00:00' : undefined,
status: undefined this.dateRange[1] ? this.dateRange[1] + ' 23:59:59' : undefined,
} ])).then(response => {
}; this.list = response.data.list;
}, this.total = response.data.total;
created() { this.loading = false;
this.getList(); }
this.getDicts("sys_common_status").then(response => { );
this.statusOptions = response.data; },
}); //
}, statusFormat(row, column) {
methods: { return this.selectDictLabel(this.statusOptions, row.status);
/** 查询登录日志列表 */ },
getList() { /** 搜索按钮操作 */
this.loading = true; handleQuery() {
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => { this.queryParams.pageNo = 1;
this.list = response.rows; this.getList();
this.total = response.total; },
this.loading = false; /** 重置按钮操作 */
} resetQuery() {
); this.dateRange = [];
}, this.resetForm("queryForm");
// this.handleQuery();
statusFormat(row, column) { },
return this.selectDictLabel(this.statusOptions, row.status); /** 导出按钮操作 */
}, handleExport() {
/** 搜索按钮操作 */ const queryParams = this.queryParams;
handleQuery() { this.$confirm('是否确认导出所有操作日志数据项?', "警告", {
this.queryParams.pageNum = 1; confirmButtonText: "确定",
this.getList(); cancelButtonText: "取消",
}, type: "warning"
/** 重置按钮操作 */ }).then(function() {
resetQuery() { return exportLoginLog(queryParams);
this.dateRange = []; }).then(response => {
this.resetForm("queryForm"); this.downloadExcel(response, '登陆日志.xls');
this.handleQuery(); })
}, }
// }
handleSelectionChange(selection) { };
this.ids = selection.map(item => item.infoId) </script>
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const infoIds = row.infoId || this.ids;
this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delLogininfor(infoIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 清空按钮操作 */
handleClean() {
this.$confirm('是否确认清空所有登录日志数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return cleanLogininfor();
}).then(() => {
this.getList();
this.msgSuccess("清空成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有操作日志数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportLogininfor(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>

View File

@ -1,4 +1,44 @@
package cn.iocoder.dashboard.modules.system.controller.logger; package cn.iocoder.dashboard.modules.system.controller.logger;
import cn.iocoder.dashboard.common.pojo.CommonResult;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO;
import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO;
import cn.iocoder.dashboard.modules.system.service.logger.SysLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "登陆日志 API")
@RestController
@RequestMapping("/system/login-log")
public class SysLoginLogController { public class SysLoginLogController {
@Resource
private SysLoginLogService loginLogService;
@ApiOperation("获得登陆日志分页列表")
@GetMapping("/page")
// @PreAuthorize("@ss.hasPermi('system:login-log:query')")
public CommonResult<PageResult<SysLoginLogRespVO>> getLoginLogPage(@Validated SysLoginLogPageReqVO reqVO) {
PageResult<SysLoginLogDO> page = loginLogService.getLoginLogPage(reqVO);
return CommonResult.success(SysLoginLogConvert.INSTANCE.convertPage(page));
}
// @GetMapping("/export")
//// @Log(title = "登录日志", businessType = BusinessType.EXPORT)
//// @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
// public void exportLoginLog(SysLogininfor logininfor) {
// List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
// ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
// return util.exportExcel(list, "登录日志");
// }
} }

View File

@ -0,0 +1,36 @@
package cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog;
import cn.iocoder.dashboard.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("登陆日志分页列表 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class SysLoginLogPageReqVO extends PageParam {
@ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配")
private String userIp;
@ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配")
private String username;
@ApiModelProperty(value = "操作状态", example = "true")
private Boolean status;
@ApiModelProperty(value = "开始时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginTime;
@ApiModelProperty(value = "结束时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime;
}

View File

@ -8,7 +8,7 @@ import lombok.ToString;
import java.util.Date; import java.util.Date;
@ApiModel("操作日志 Response VO") @ApiModel("登陆日志 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -1,6 +1,8 @@
package cn.iocoder.dashboard.modules.system.convert.logger; package cn.iocoder.dashboard.modules.system.convert.logger;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
@ -12,4 +14,6 @@ public interface SysLoginLogConvert {
SysLoginLogDO convert(SysLoginLogCreateReqVO bean); SysLoginLogDO convert(SysLoginLogCreateReqVO bean);
PageResult<SysLoginLogRespVO> convertPage(PageResult<SysLoginLogDO> page);
} }

View File

@ -1,9 +1,28 @@
package cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger; package cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO;
import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginResultEnum;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> {
default PageResult<SysLoginLogDO> selectPage(SysLoginLogPageReqVO reqVO) {
QueryWrapperX<SysLoginLogDO> query = new QueryWrapperX<SysLoginLogDO>()
.likeIfPresent("user_ip", reqVO.getUserIp())
.likeIfPresent("username", reqVO.getUsername())
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime());
if (Boolean.TRUE.equals(reqVO.getStatus())) {
query.eq("result", SysLoginResultEnum.SUCCESS.getResult());
} else if (Boolean.FALSE.equals(reqVO.getStatus())) {
query.gt("result", SysLoginResultEnum.SUCCESS.getResult());
}
query.orderByDesc("id"); // 降序
return selectPage(reqVO, query);
}
} }

View File

@ -12,7 +12,7 @@ public enum SysLoginResultEnum {
SUCCESS(0), // 成功 SUCCESS(0), // 成功
BAD_CREDENTIALS(10), // 账号或密码不正确 BAD_CREDENTIALS(10), // 账号或密码不正确
USER_DISABLED(20), // 账号或密码不正确 USER_DISABLED(20), // 用户被禁用
CAPTCHA_NOT_FOUND(30), // 验证码不存在 CAPTCHA_NOT_FOUND(30), // 验证码不存在
CAPTCHA_CODE_ERROR(31), // 验证码不正确 CAPTCHA_CODE_ERROR(31), // 验证码不正确

View File

@ -1,6 +1,9 @@
package cn.iocoder.dashboard.modules.system.service.logger; package cn.iocoder.dashboard.modules.system.service.logger;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO;
/** /**
* 登陆日志 Service 接口 * 登陆日志 Service 接口
@ -14,4 +17,12 @@ public interface SysLoginLogService {
*/ */
void createLoginLog(SysLoginLogCreateReqVO reqVO); void createLoginLog(SysLoginLogCreateReqVO reqVO);
/**
* 获得登陆日志分页
*
* @param reqVO 分页条件
* @return 登陆日志分页
*/
PageResult<SysLoginLogDO> getLoginLogPage(SysLoginLogPageReqVO reqVO);
} }

View File

@ -1,13 +1,22 @@
package cn.iocoder.dashboard.modules.system.service.logger.impl; package cn.iocoder.dashboard.modules.system.service.logger.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO;
import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert;
import cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger.SysLoginLogMapper; import cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger.SysLoginLogMapper;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.user.SysUserDO;
import cn.iocoder.dashboard.modules.system.service.logger.SysLoginLogService; import cn.iocoder.dashboard.modules.system.service.logger.SysLoginLogService;
import cn.iocoder.dashboard.modules.system.service.user.SysUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collection;
import static cn.iocoder.dashboard.util.collection.CollectionUtils.convertSet;
/** /**
* 登陆日志 Service 实现 * 登陆日志 Service 实现
@ -18,10 +27,18 @@ public class SysLoginLogServiceImpl implements SysLoginLogService {
@Resource @Resource
private SysLoginLogMapper loginLogMapper; private SysLoginLogMapper loginLogMapper;
@Resource
private SysUserService userService;
@Override @Override
public void createLoginLog(SysLoginLogCreateReqVO reqVO) { public void createLoginLog(SysLoginLogCreateReqVO reqVO) {
SysLoginLogDO loginLog = SysLoginLogConvert.INSTANCE.convert(reqVO); SysLoginLogDO loginLog = SysLoginLogConvert.INSTANCE.convert(reqVO);
loginLogMapper.insert(loginLog); loginLogMapper.insert(loginLog);
} }
@Override
public PageResult<SysLoginLogDO> getLoginLogPage(SysLoginLogPageReqVO reqVO) {
return loginLogMapper.selectPage(reqVO);
}
} }