迁移登陆日志的代码
This commit is contained in:
@@ -1,4 +1,44 @@
|
||||
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 {
|
||||
|
||||
@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, "登录日志");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("操作日志 Response VO")
|
||||
@ApiModel("登陆日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
||||
Reference in New Issue
Block a user