操作时间大致结构
All checks were successful
local-test分支构建docker并发布运行 / Docker-Build (push) Successful in 1m29s

This commit is contained in:
tiger_zhou 2024-09-06 19:57:34 +08:00
parent 0d47e4af3c
commit 37267e56b8
9 changed files with 231 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package club.joylink.xiannccda.constants;
import club.joylink.xiannccda.ats.message.line3.device.ScheduleSubIdType;
import java.util.Arrays;
public enum EventLogType {
//登录
LOGIN,
//登出
LOGOUT,
;
}

View File

@ -0,0 +1,52 @@
package club.joylink.xiannccda.controller;
import club.joylink.xiannccda.dto.LoginInfoDTO;
import club.joylink.xiannccda.dto.event.EventLogPageDTO;
import club.joylink.xiannccda.dto.event.EventLogQueryDTO;
import club.joylink.xiannccda.dto.user.UserDetailDTO;
import club.joylink.xiannccda.dto.user.UserEditDTO;
import club.joylink.xiannccda.dto.user.UserQueryDTO;
import club.joylink.xiannccda.entity.User;
import club.joylink.xiannccda.entity.User.Register;
import club.joylink.xiannccda.repository.IEventLogRepository;
import club.joylink.xiannccda.repository.IUserRepository;
import club.joylink.xiannccda.service.UserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户管理接口
*
* @author walker-sheng
* @since 2023-06-01
*/
@RestController
@RequestMapping("/api/log")
@Tag(name = "事件查看")
public class EventLogController {
private IEventLogRepository eventLogRepository;
public EventLogController(IEventLogRepository eventLogRepository) {
this.eventLogRepository = eventLogRepository;
}
@GetMapping("/paging")
@Operation(summary = "分页数据")
@ApiResponse(description = "事件操作")
@SecurityRequirement(name = "jwt")
public Page<EventLogPageDTO> register(EventLogQueryDTO dto) {
return this.eventLogRepository.detailPage(dto);
}
}

View File

@ -0,0 +1,16 @@
package club.joylink.xiannccda.dto.event;
import club.joylink.xiannccda.constants.EventLogType;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class EventLogPageDTO {
private Long id;
private EventLogType eventType;
private String userName;
private Long fromUserId;
private String mobile;
private LocalDateTime createDateTime;
}

View File

@ -0,0 +1,8 @@
package club.joylink.xiannccda.dto.event;
import club.joylink.xiannccda.entity.EventLog;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
public class EventLogQueryDTO extends PageDTO<EventLog> {
}

View File

@ -0,0 +1,47 @@
package club.joylink.xiannccda.entity;
import club.joylink.xiannccda.alert.core.AlertDeviceType;
import club.joylink.xiannccda.constants.EventLogType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author walker-sheng
* @since 2023-10-19
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("event_log")
@Schema(name = "eventLog", description = "时间日志")
public class EventLog {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@Schema(description = "设备类型")
private EventLogType eventType;
@Schema(description = "设备告警")
private Long fromUserId;
@Schema(description = "开始时间(小时)")
private LocalDateTime createDateTime;
public static final String ID = "id";
public static final String EVENT_TYPE = "event_Type";
public static final String FROM_USER_ID = "from_User_Id";
public static final String CREATE_DATE_TIME = "create_Date_Time";
}

View File

@ -0,0 +1,25 @@
package club.joylink.xiannccda.mapper;
import club.joylink.xiannccda.dto.event.EventLogPageDTO;
import club.joylink.xiannccda.dto.event.EventLogQueryDTO;
import club.joylink.xiannccda.dto.user.UserDetailDTO;
import club.joylink.xiannccda.dto.user.UserQueryDTO;
import club.joylink.xiannccda.entity.EventLog;
import club.joylink.xiannccda.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 用户 Mapper 接口
* </p>
*
* @author walker-sheng
* @since 2023-06-01
*/
@Mapper
public interface EventLogMapper extends BaseMapper<EventLog> {
Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto);
}

View File

@ -0,0 +1,23 @@
package club.joylink.xiannccda.repository;
import club.joylink.xiannccda.dto.event.EventLogPageDTO;
import club.joylink.xiannccda.dto.event.EventLogQueryDTO;
import club.joylink.xiannccda.dto.user.UserDetailDTO;
import club.joylink.xiannccda.dto.user.UserQueryDTO;
import club.joylink.xiannccda.entity.EventLog;
import club.joylink.xiannccda.entity.User;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 用户 服务类
* </p>
*
* @author walker-sheng
* @since 2023-06-01
*/
public interface IEventLogRepository extends IService<EventLog> {
Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto);
}

View File

@ -0,0 +1,35 @@
package club.joylink.xiannccda.repository.impl;
import club.joylink.xiannccda.dto.LineInfoQueryDTO;
import club.joylink.xiannccda.dto.event.EventLogPageDTO;
import club.joylink.xiannccda.dto.event.EventLogQueryDTO;
import club.joylink.xiannccda.entity.EventLog;
import club.joylink.xiannccda.entity.LineInfo;
import club.joylink.xiannccda.mapper.EventLogMapper;
import club.joylink.xiannccda.mapper.LineInfoMapper;
import club.joylink.xiannccda.repository.IEventLogRepository;
import club.joylink.xiannccda.repository.ILineInfoRepository;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author walker-sheng
* @since 2023-06-06
*/
@Service
public class EventLogRepository extends ServiceImpl<EventLogMapper, EventLog> implements IEventLogRepository {
@Override
public Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto) {
return this.baseMapper.detailPage(dto);
}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.xiannccda.mapper.EventLogMapper">
<select id="detailPage" resultType="club.joylink.xiannccda.dto.event.EventLogPageDTO">
select A.id, A.event_type, A.create_date_time, A.from_user_id, B.`name` as user_name, B.mobile
from event_log A
left join user B on A.from_user_id = B.id
where 1 = 1
</select>
</mapper>