first commit

This commit is contained in:
2026-03-06 14:01:32 +08:00
commit def60e21c7
1074 changed files with 119423 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.orionsec.ops</groupId>
<artifactId>orion-ops-api</artifactId>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>orion-ops-dao</artifactId>
<name>orion-ops-dao</name>
<dependencies>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<!-- aspectj -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<!-- mybatis plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!-- mybatis plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!-- orion-kit -->
<dependency>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-all</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,9 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.AlarmGroupDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AlarmGroupDAO extends BaseMapper<AlarmGroupDO> {
}

View File

@@ -0,0 +1,9 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.AlarmGroupNotifyDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AlarmGroupNotifyDAO extends BaseMapper<AlarmGroupNotifyDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.AlarmGroupUserDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AlarmGroupUserDAO extends BaseMapper<AlarmGroupUserDO> {
}

View File

@@ -0,0 +1,21 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationActionDO;
import cn.orionsec.ops.entity.dto.ApplicationActionConfigDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationActionDAO extends BaseMapper<ApplicationActionDO> {
/**
* 获取应用是否已配置
*
* @param profileId profileId
* @param appIdList appIdList
* @return rows
*/
List<ApplicationActionConfigDTO> getAppIsConfig(@Param("profileId") Long profileId, @Param("appIdList") List<Long> appIdList);
}

View File

@@ -0,0 +1,45 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationActionLogDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationActionLogDAO extends BaseMapper<ApplicationActionLogDO> {
/**
* 通过 id 查询状态信息
*
* @param id id
* @return row
*/
ApplicationActionLogDO selectStatusInfoById(@Param("id") Long id);
/**
* 通过 id 查询状态信息
*
* @param idList idList
* @return rows
*/
List<ApplicationActionLogDO> selectStatusInfoByIdList(@Param("idList") List<Long> idList);
/**
* 通过 relId 查询状态信息
*
* @param relId relId
* @param stageType stageType
* @return rows
*/
List<ApplicationActionLogDO> selectStatusInfoByRelId(@Param("relId") Long relId, @Param("stageType") Integer stageType);
/**
* 通过 relId 查询状态信息
*
* @param relIdList relIdList
* @param stageType stageType
* @return rows
*/
List<ApplicationActionLogDO> selectStatusInfoByRelIdList(@Param("relIdList") List<Long> relIdList, @Param("stageType") Integer stageType);
}

View File

@@ -0,0 +1,94 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationBuildDO;
import cn.orionsec.ops.entity.dto.ApplicationBuildStatisticsDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface ApplicationBuildDAO extends BaseMapper<ApplicationBuildDO> {
/**
* 通过 id 查询状态
*
* @param id id
* @return status
*/
Integer selectStatusById(@Param("id") Long id);
/**
* 通过 id 查询状态信息
*
* @param id id
* @return row
*/
ApplicationBuildDO selectStatusInfoById(@Param("id") Long id);
/**
* 通过 id 查询状态信息
*
* @param idList idList
* @return rows
*/
List<ApplicationBuildDO> selectStatusInfoByIdList(@Param("idList") List<Long> idList);
/**
* 查询上一次构建分支
*
* @param appId appId
* @param profileId profileId
* @param repoId repoId
* @return branch
*/
String selectLastBuildBranch(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("repoId") Long repoId);
/**
* 查询构建序列
*
* @param id id
* @return seq
*/
Integer selectBuildSeq(@Param("id") Long id);
/**
* 查询构建发布列表
*
* @param appId appId
* @param profileId profileId
* @param limit limit
* @return rows
*/
List<ApplicationBuildDO> selectBuildReleaseList(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("limit") Integer limit);
/**
* 查询构建发布列表
*
* @param appIdList appIdList
* @param profileId profileId
* @return rows
*/
List<ApplicationBuildDO> selectBuildReleaseGroupList(@Param("appIdList") List<Long> appIdList, @Param("profileId") Long profileId);
/**
* 获取构建统计
*
* @param appId appId
* @param profileId profileId
* @param rangeStartDate rangeStartDate
* @return 统计信息
*/
ApplicationBuildStatisticsDTO getBuildStatistics(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("rangeStartDate") Date rangeStartDate);
/**
* 获取构建时间线统计
*
* @param appId appId
* @param profileId profileId
* @param rangeStartDate rangeStartDate
* @return 时间线统计信息
*/
List<ApplicationBuildStatisticsDTO> getBuildDateStatistics(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("rangeStartDate") Date rangeStartDate);
}

View File

@@ -0,0 +1,28 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationEnvDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface ApplicationEnvDAO extends BaseMapper<ApplicationEnvDO> {
/**
* 查询一条数据
*
* @param appId appId
* @param profileId profileId
* @param key key
* @return env
*/
ApplicationEnvDO selectOneRel(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("key") String key);
/**
* 设置删除
*
* @param id id
* @param deleted deleted
* @return effect
*/
Integer setDeleted(@Param("id") Long id, @Param("deleted") Integer deleted);
}

View File

@@ -0,0 +1,43 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationInfoDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationInfoDAO extends BaseMapper<ApplicationInfoDO> {
/**
* 获取仓库数量
*
* @param repoId repoId
* @return count
*/
Integer selectRepoCount(@Param("repoId") Long repoId);
/**
* 清空仓库
*
* @param repoId repoId
* @return effect
*/
Integer cleanRepoCount(@Param("repoId") Long repoId);
/**
* 查询名称
*
* @param id id
* @return name
*/
String selectNameById(@Param("id") Long id);
/**
* 查询名称
*
* @param idList idList
* @return name
*/
List<ApplicationInfoDO> selectNameByIdList(@Param("idList") List<Long> idList);
}

View File

@@ -0,0 +1,16 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationMachineDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ApplicationMachineDAO extends BaseMapper<ApplicationMachineDO> {
/**
* 更新版本
*
* @param update update
* @return effect
*/
Integer updateAppVersion(ApplicationMachineDO update);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationPipelineDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ApplicationPipelineDAO extends BaseMapper<ApplicationPipelineDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationPipelineDetailDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ApplicationPipelineDetailDAO extends BaseMapper<ApplicationPipelineDetailDO> {
}

View File

@@ -0,0 +1,55 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationPipelineTaskDO;
import cn.orionsec.ops.entity.dto.ApplicationPipelineTaskStatisticsDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface ApplicationPipelineTaskDAO extends BaseMapper<ApplicationPipelineTaskDO> {
/**
* 设置定时执行时间为空
*
* @param id id
* @return effect
*/
Integer setTimedExecTimeNull(@Param("id") Long id);
/**
* 查询任务状态
*
* @param id id
* @return row
*/
ApplicationPipelineTaskDO selectStatusById(@Param("id") Long id);
/**
* 查询任务状态
*
* @param idList idList
* @return rows
*/
List<ApplicationPipelineTaskDO> selectStatusByIdList(@Param("idList") List<Long> idList);
/**
* 获取流水线任务统计
*
* @param pipelineId pipelineId
* @param rangeStartDate rangeStartDate
* @return 统计信息
*/
ApplicationPipelineTaskStatisticsDTO getPipelineTaskStatistics(@Param("pipelineId") Long pipelineId, @Param("rangeStartDate") Date rangeStartDate);
/**
* 获取流水线任务时间线统计
*
* @param pipelineId pipelineId
* @param rangeStartDate rangeStartDate
* @return 时间线统计信息
*/
List<ApplicationPipelineTaskStatisticsDTO> getPipelineTaskDateStatistics(@Param("pipelineId") Long pipelineId, @Param("rangeStartDate") Date rangeStartDate);
}

View File

@@ -0,0 +1,27 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationPipelineTaskDetailDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationPipelineTaskDetailDAO extends BaseMapper<ApplicationPipelineTaskDetailDO> {
/**
* 查询任务详情状态
*
* @param taskId taskId
* @return rows
*/
List<ApplicationPipelineTaskDetailDO> selectStatusByTaskId(@Param("taskId") Long taskId);
/**
* 查询任务详情状态
*
* @param idList idList
* @return rows
*/
List<ApplicationPipelineTaskDetailDO> selectStatusByIdList(@Param("idList") List<Long> idList);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationPipelineTaskLogDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ApplicationPipelineTaskLogDAO extends BaseMapper<ApplicationPipelineTaskLogDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationProfileDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ApplicationProfileDAO extends BaseMapper<ApplicationProfileDO> {
}

View File

@@ -0,0 +1,57 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationReleaseDO;
import cn.orionsec.ops.entity.dto.ApplicationReleaseStatisticsDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface ApplicationReleaseDAO extends BaseMapper<ApplicationReleaseDO> {
/**
* 查询状态
*
* @param id id
* @return row
*/
ApplicationReleaseDO selectStatusById(@Param("id") Long id);
/**
* 查询状态列表
*
* @param idList idList
* @return rows
*/
List<ApplicationReleaseDO> selectStatusByIdList(@Param("idList") List<Long> idList);
/**
* 设置定时时间为 null
*
* @param id id
* @return effect
*/
Integer setTimedReleaseTimeNull(@Param("id") Long id);
/**
* 获取发布统计
*
* @param appId appId
* @param profileId profileId
* @param rangeStartDate rangeStartDate
* @return 统计信息
*/
ApplicationReleaseStatisticsDTO getReleaseStatistics(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("rangeStartDate") Date rangeStartDate);
/**
* 获取发布时间线统计
*
* @param appId appId
* @param profileId profileId
* @param rangeStartDate rangeStartDate
* @return 时间线统计信息
*/
List<ApplicationReleaseStatisticsDTO> getReleaseDateStatistics(@Param("appId") Long appId, @Param("profileId") Long profileId, @Param("rangeStartDate") Date rangeStartDate);
}

View File

@@ -0,0 +1,43 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationReleaseMachineDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationReleaseMachineDAO extends BaseMapper<ApplicationReleaseMachineDO> {
/**
* 查询发布机器状态
*
* @param releaseId releaseId
* @return rows
*/
List<ApplicationReleaseMachineDO> selectStatusByReleaseId(@Param("releaseId") Long releaseId);
/**
* 查询发布机器状态
*
* @param releaseIdList releaseIdList
* @return rows
*/
List<ApplicationReleaseMachineDO> selectStatusByReleaseIdList(@Param("releaseIdList") List<Long> releaseIdList);
/**
* 查询发布机器状态
*
* @param id id
* @return row
*/
ApplicationReleaseMachineDO selectStatusById(@Param("id") Long id);
/**
* 查询发布机器状态
*
* @param idList idList
* @return rows
*/
List<ApplicationReleaseMachineDO> selectStatusByIdList(@Param("idList") List<Long> idList);
}

View File

@@ -0,0 +1,27 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.ApplicationRepositoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApplicationRepositoryDAO extends BaseMapper<ApplicationRepositoryDO> {
/**
* 通过id查询名称
*
* @param idList idList
* @return rows
*/
List<ApplicationRepositoryDO> selectNameByIdList(@Param("idList") List<Long> idList);
/**
* 通过名称查询id
*
* @param nameList nameList
* @return rows
*/
List<ApplicationRepositoryDO> selectIdByNameList(@Param("nameList") List<String> nameList);
}

View File

@@ -0,0 +1,17 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.CommandExecDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface CommandExecDAO extends BaseMapper<CommandExecDO> {
/**
* 通过 id 查询 status
*
* @param id id
* @return status
*/
CommandExecDO selectStatusById(@Param("id") Long id);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.CommandTemplateDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface CommandTemplateDAO extends BaseMapper<CommandTemplateDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.FileTailListDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface FileTailListDAO extends BaseMapper<FileTailListDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.FileTransferLogDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface FileTransferLogDAO extends BaseMapper<FileTransferLogDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.HistoryValueSnapshotDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface HistoryValueSnapshotDAO extends BaseMapper<HistoryValueSnapshotDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineAlarmConfigDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineAlarmConfigDAO extends BaseMapper<MachineAlarmConfigDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineAlarmGroupDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineAlarmGroupDAO extends BaseMapper<MachineAlarmGroupDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineAlarmHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineAlarmHistoryDAO extends BaseMapper<MachineAlarmHistoryDO> {
}

View File

@@ -0,0 +1,27 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineEnvDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface MachineEnvDAO extends BaseMapper<MachineEnvDO> {
/**
* 查询一条数据
*
* @param machineId machineId
* @param key key
* @return env
*/
MachineEnvDO selectOneRel(@Param("machineId") Long machineId, @Param("key") String key);
/**
* 设置删除
*
* @param id id
* @param deleted deleted
* @return effect
*/
Integer setDeleted(@Param("id") Long id, @Param("deleted") Integer deleted);
}

View File

@@ -0,0 +1,26 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineGroupDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface MachineGroupDAO extends BaseMapper<MachineGroupDO> {
/**
* 增加排序值
*
* @param parentId parentId
* @param greaterSort > sort
* @return effect
*/
Integer incrementSort(@Param("parentId") Long parentId, @Param("greaterSort") Integer greaterSort);
/**
* 增加最大 sort
*
* @param parentId parentId
* @return sort
*/
Integer getMaxSort(@Param("parentId") Long parentId);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineGroupRelDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineGroupRelDAO extends BaseMapper<MachineGroupRelDO> {
}

View File

@@ -0,0 +1,58 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineInfoDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MachineInfoDAO extends BaseMapper<MachineInfoDO> {
/**
* 设置id
*
* @param oldId 原id
* @param newId 新id
*/
void setId(@Param("oldId") Long oldId, @Param("newId") Long newId);
/**
* 设置proxyId为null
*
* @param proxyId proxyId
*/
void setProxyIdWithNull(@Param("proxyId") Long proxyId);
/**
* 通过host查询id
*
* @param host host
* @return rows
*/
List<Long> selectIdByHost(@Param("host") String host);
/**
* 查询机器名称
*
* @param id id
* @return name
*/
String selectMachineName(@Param("id") Long id);
/**
* 查询机器名称
*
* @param idList idList
* @return rows
*/
List<MachineInfoDO> selectNameByIdList(@Param("idList") List<Long> idList);
/**
* 查询机器id
*
* @param tagList tagList
* @return rows
*/
List<MachineInfoDO> selectIdByTagList(@Param("tagList") List<String> tagList);
}

View File

@@ -0,0 +1,30 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineMonitorDO;
import cn.orionsec.ops.entity.dto.MachineMonitorDTO;
import cn.orionsec.ops.entity.query.MachineMonitorQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MachineMonitorDAO extends BaseMapper<MachineMonitorDO> {
/**
* 查询列表
*
* @param query query
* @param last last sql
* @return rows
*/
List<MachineMonitorDTO> selectMonitorList(@Param("query") MachineMonitorQuery query, @Param("last") String last);
/**
* 查询条数
*
* @param query query
* @return count
*/
Integer selectMonitorCount(@Param("query") MachineMonitorQuery query);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineProxyDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineProxyDAO extends BaseMapper<MachineProxyDO> {
}

View File

@@ -0,0 +1,19 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineSecretKeyDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MachineSecretKeyDAO extends BaseMapper<MachineSecretKeyDO> {
/**
* 通过名称查询id
*
* @param nameList nameList
* @return rows
*/
List<MachineSecretKeyDO> selectIdByNameList(@Param("nameList") List<String> nameList);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineTerminalDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineTerminalDAO extends BaseMapper<MachineTerminalDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.MachineTerminalLogDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MachineTerminalLogDAO extends BaseMapper<MachineTerminalLogDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.SchedulerTaskDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SchedulerTaskDAO extends BaseMapper<SchedulerTaskDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.SchedulerTaskMachineDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SchedulerTaskMachineDAO extends BaseMapper<SchedulerTaskMachineDO> {
}

View File

@@ -0,0 +1,43 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.SchedulerTaskMachineRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SchedulerTaskMachineRecordDAO extends BaseMapper<SchedulerTaskMachineRecordDO> {
/**
* 通过 recordId 查询状态
*
* @param recordId recordId
* @return rows
*/
List<SchedulerTaskMachineRecordDO> selectStatusByRecordId(@Param("recordId") Long recordId);
/**
* 通过 idList 查询状态
*
* @param idList idList
* @return rows
*/
List<SchedulerTaskMachineRecordDO> selectStatusByIdList(@Param("idList") List<Long> idList);
/**
* 通过 recordIdList 查询状态
*
* @param recordIdList recordIdList
* @return rows
*/
List<SchedulerTaskMachineRecordDO> selectStatusByRecordIdList(@Param("recordIdList") List<Long> recordIdList);
/**
* 通过 recordIdList 删除明细
*
* @param recordIdList recordIdList
* @return effect
*/
Integer deleteByRecordIdList(@Param("recordIdList") List<Long> recordIdList);
}

View File

@@ -0,0 +1,47 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.SchedulerTaskRecordDO;
import cn.orionsec.ops.entity.dto.SchedulerTaskRecordStatisticsDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface SchedulerTaskRecordDAO extends BaseMapper<SchedulerTaskRecordDO> {
/**
* 查询任务状态
*
* @param idList idList
* @return rows
*/
List<SchedulerTaskRecordDO> selectTaskStatusByIdList(@Param("idList") List<Long> idList);
/**
* 获取调度任务统计
*
* @param taskId taskId
* @param rangeStartDate 统计开始时间
* @return 统计信息
*/
SchedulerTaskRecordStatisticsDTO getTaskRecordStatistics(@Param("taskId") Long taskId, @Param("rangeStartDate") Date rangeStartDate);
/**
* 获取调度任务机器统计
*
* @param taskId taskId
* @return 统计信息
*/
List<SchedulerTaskRecordStatisticsDTO> getTaskMachineRecordStatistics(@Param("taskId") Long taskId);
/**
* 获取调度任务时间线统计
*
* @param taskId taskId
* @param rangeStartDate 统计开始时间
* @return 统计信息
*/
List<SchedulerTaskRecordStatisticsDTO> getTaskRecordDateStatistics(@Param("taskId") Long taskId, @Param("rangeStartDate") Date rangeStartDate);
}

View File

@@ -0,0 +1,26 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.SystemEnvDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface SystemEnvDAO extends BaseMapper<SystemEnvDO> {
/**
* 查询一条数据
*
* @param key key
* @return env
*/
SystemEnvDO selectOneRel(@Param("key") String key);
/**
* 设置删除
*
* @param id id
* @param deleted deleted
* @return effect
*/
Integer setDeleted(@Param("id") Long id, @Param("deleted") Integer deleted);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.UserEventLogDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface UserEventLogDAO extends BaseMapper<UserEventLogDO> {
}

View File

@@ -0,0 +1,17 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.UserInfoDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface UserInfoDAO extends BaseMapper<UserInfoDO> {
/**
* 更新最后登录时间
*
* @param userId userId
* @return effect
*/
Integer updateLastLoginTime(@Param("userId") Long userId);
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.WebSideMessageDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface WebSideMessageDAO extends BaseMapper<WebSideMessageDO> {
}

View File

@@ -0,0 +1,8 @@
package cn.orionsec.ops.dao;
import cn.orionsec.ops.entity.domain.WebhookConfigDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface WebhookConfigDAO extends BaseMapper<WebhookConfigDO> {
}

View File

@@ -0,0 +1,45 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("alarm_group")
@ApiModel(value = "AlarmGroupDO对象", description = "报警组")
public class AlarmGroupDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "报警组名称")
@TableField("group_name")
private String groupName;
@ApiModelProperty(value = "报警组描述")
@TableField("group_description")
private String groupDescription;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,48 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("alarm_group_notify")
@ApiModel(value = "AlarmGroupNotifyDO对象", description = "报警组通知方式")
public class AlarmGroupNotifyDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "报警组id")
@TableField("group_id")
private Long groupId;
@ApiModelProperty(value = "通知id")
@TableField("notify_id")
private Long notifyId;
@ApiModelProperty(value = "通知类型 10 webhook")
@TableField("notify_type")
private Integer notifyType;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,48 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("alarm_group_user")
@ApiModel(value = "AlarmGroupUserDO对象", description = "报警组成员")
public class AlarmGroupUserDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "报警组id")
@TableField("group_id")
private Long groupId;
@ApiModelProperty(value = "报警组成员id")
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "报警组成员用户名")
@TableField("username")
private String username;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,67 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用发布执行块")
@TableName("application_action")
@SuppressWarnings("ALL")
public class ApplicationActionDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "appId")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "profileId")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "名称")
@TableField("action_name")
private String actionName;
/**
* @see cn.orionsec.ops.constant.app.ActionType
*/
@ApiModelProperty(value = "类型")
@TableField("action_type")
private Integer actionType;
/**
* @see cn.orionsec.ops.constant.app.StageType
*/
@ApiModelProperty(value = "阶段类型")
@TableField("stage_type")
private Integer stageType;
@ApiModelProperty(value = "执行命令")
@TableField("action_command")
private String actionCommand;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,94 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用操作日志")
@TableName("application_action_log")
@SuppressWarnings("ALL")
public class ApplicationActionLogDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* @see cn.orionsec.ops.constant.app.StageType
*/
@ApiModelProperty(value = "阶段类型 10构建 20发布")
@TableField("stage_type")
private Integer stageType;
@ApiModelProperty(value = "引用id 构建id 发布机器id")
@TableField("rel_id")
private Long relId;
@ApiModelProperty(value = "执行机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "操作id")
@TableField("action_id")
private Long actionId;
@ApiModelProperty(value = "操作名称")
@TableField("action_name")
private String actionName;
/**
* @see cn.orionsec.ops.constant.app.ActionType
*/
@ApiModelProperty(value = "操作类型")
@TableField("action_type")
private Integer actionType;
@ApiModelProperty(value = "操作命令")
@TableField("action_command")
private String actionCommand;
@ApiModelProperty(value = "操作日志路径")
@TableField("log_path")
private String logPath;
/**
* @see cn.orionsec.ops.constant.app.ActionStatus
*/
@ApiModelProperty(value = "状态 10未开始 20进行中 30已完成 40执行失败 50已跳过 60已取消")
@TableField("run_status")
private Integer runStatus;
@ApiModelProperty(value = "退出码")
@TableField("exit_code")
private Integer exitCode;
@ApiModelProperty(value = "开始时间")
@TableField("start_time")
private Date startTime;
@ApiModelProperty(value = "结束时间")
@TableField("end_time")
private Date endTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,112 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用构建")
@TableName("application_build")
@SuppressWarnings("ALL")
public class ApplicationBuildDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "应用名称")
@TableField("app_name")
private String appName;
@ApiModelProperty(value = "应用唯一标识")
@TableField("app_tag")
private String appTag;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "环境名称")
@TableField("profile_name")
private String profileName;
@ApiModelProperty(value = "环境唯一标识")
@TableField("profile_tag")
private String profileTag;
@ApiModelProperty(value = "构建序列")
@TableField("build_seq")
private Integer buildSeq;
@ApiModelProperty(value = "构建分支")
@TableField("branch_name")
private String branchName;
@ApiModelProperty(value = "构建提交id")
@TableField("commit_id")
private String commitId;
@ApiModelProperty(value = "应用版本仓库id")
@TableField("repo_id")
private Long repoId;
@ApiModelProperty(value = "构建日志路径")
@TableField("log_path")
private String logPath;
@ApiModelProperty(value = "构建产物文件")
@TableField("bundle_path")
private String bundlePath;
/**
* @see cn.orionsec.ops.constant.app.BuildStatus
*/
@ApiModelProperty(value = "状态 10未开始 20执行中 30已完成 40执行失败 50已取消")
@TableField("build_status")
private Integer buildStatus;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "创建人id")
@TableField("create_user_id")
private Long createUserId;
@ApiModelProperty(value = "创建人名称")
@TableField("create_user_name")
private String createUserName;
@ApiModelProperty(value = "构建开始时间")
@TableField("build_start_time")
private Date buildStartTime;
@ApiModelProperty(value = "构建结束时间")
@TableField("build_end_time")
private Date buildEndTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,65 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用环境变量")
@TableName("application_env")
@SuppressWarnings("ALL")
public class ApplicationEnvDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "key")
@TableField("attr_key")
private String attrKey;
@ApiModelProperty(value = "value")
@TableField("attr_value")
private String attrValue;
/**
* @see cn.orionsec.ops.constant.Const#IS_SYSTEM
* @see cn.orionsec.ops.constant.Const#NOT_SYSTEM
*/
@ApiModelProperty(value = "是否为系统变量 1是 2否")
@TableField("system_env")
private Integer systemEnv;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,56 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用表")
@TableName("application_info")
public class ApplicationInfoDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "名称")
@TableField("app_name")
private String appName;
@ApiModelProperty(value = "应用唯一标识")
@TableField("app_tag")
private String appTag;
@ApiModelProperty(value = "排序")
@TableField("app_sort")
private Integer appSort;
@ApiModelProperty(value = "应用版本仓库id")
@TableField(value = "repo_id", updateStrategy = FieldStrategy.IGNORED)
private Long repoId;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,60 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用依赖机器表")
@TableName("application_machine")
public class ApplicationMachineDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "当前版本发布id")
@TableField("release_id")
private Long releaseId;
@ApiModelProperty(value = "当前版本构建id")
@TableField("build_id")
private Long buildId;
@ApiModelProperty(value = "当前版本构建序列")
@TableField("build_seq")
private Integer buildSeq;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,48 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用流水线")
@TableName("application_pipeline")
public class ApplicationPipelineDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "流水线名称")
@TableField("pipeline_name")
private String pipelineName;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "修改时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "创建时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,56 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用流水线详情")
@TableName("application_pipeline_detail")
@SuppressWarnings("ALL")
public class ApplicationPipelineDetailDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "流水线id")
@TableField("pipeline_id")
private Long pipelineId;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
/**
* @see cn.orionsec.ops.constant.app.StageType
*/
@ApiModelProperty(value = "阶段类型 10构建 20发布")
@TableField("stage_type")
private Integer stageType;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,120 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用流水线任务")
@TableName("application_pipeline_task")
@SuppressWarnings("ALL")
public class ApplicationPipelineTaskDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "流水线id")
@TableField("pipeline_id")
private Long pipelineId;
@ApiModelProperty(value = "流水线名称")
@TableField("pipeline_name")
private String pipelineName;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "环境名称")
@TableField("profile_name")
private String profileName;
@ApiModelProperty(value = "环境唯一标识")
@TableField("profile_tag")
private String profileTag;
@ApiModelProperty(value = "执行标题")
@TableField("exec_title")
private String execTitle;
@ApiModelProperty(value = "执行描述")
@TableField("exec_description")
private String execDescription;
/**
* @see cn.orionsec.ops.constant.app.PipelineStatus
*/
@ApiModelProperty(value = "执行状态 10待审核 20审核驳回 30待执行 35待调度 40执行中 50执行完成 60执行停止 70执行失败")
@TableField("exec_status")
private Integer execStatus;
@ApiModelProperty(value = "是否是定时执行 10普通执行 20定时执行")
@TableField("timed_exec")
private Integer timedExec;
@ApiModelProperty(value = "定时执行时间")
@TableField("timed_exec_time")
private Date timedExecTime;
@ApiModelProperty(value = "创建人id")
@TableField("create_user_id")
private Long createUserId;
@ApiModelProperty(value = "创建人名称")
@TableField("create_user_name")
private String createUserName;
@ApiModelProperty(value = "审核人id")
@TableField("audit_user_id")
private Long auditUserId;
@ApiModelProperty(value = "审核人名称")
@TableField("audit_user_name")
private String auditUserName;
@ApiModelProperty(value = "审核时间")
@TableField("audit_time")
private Date auditTime;
@ApiModelProperty(value = "审核备注")
@TableField("audit_reason")
private String auditReason;
@ApiModelProperty(value = "执行人id")
@TableField("exec_user_id")
private Long execUserId;
@ApiModelProperty(value = "执行人名称")
@TableField("exec_user_name")
private String execUserName;
@ApiModelProperty(value = "执行开始时间")
@TableField("exec_start_time")
private Date execStartTime;
@ApiModelProperty(value = "执行结束时间")
@TableField("exec_end_time")
private Date execEndTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,95 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用流水线任务详情")
@TableName("application_pipeline_task_detail")
@SuppressWarnings("ALL")
public class ApplicationPipelineTaskDetailDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "流水线id")
@TableField("pipeline_id")
private Long pipelineId;
@ApiModelProperty(value = "流水线详情id")
@TableField("pipeline_detail_id")
private Long pipelineDetailId;
@ApiModelProperty(value = "流水线操作任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty(value = "引用id")
@TableField("rel_id")
private Long relId;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "应用名称")
@TableField("app_name")
private String appName;
@ApiModelProperty(value = "应用唯一标识")
@TableField("app_tag")
private String appTag;
/**
* @see cn.orionsec.ops.constant.app.StageType
*/
@ApiModelProperty(value = "阶段类型 10构建 20发布")
@TableField("stage_type")
private Integer stageType;
/**
* @see cn.orionsec.ops.entity.dto.ApplicationPipelineStageConfigDTO
*/
@ApiModelProperty(value = "阶段操作配置")
@TableField("stage_config")
private String stageConfig;
/**
* @see cn.orionsec.ops.constant.app.PipelineDetailStatus
*/
@ApiModelProperty(value = "状态 10未开始 20进行中 30已完成 40执行失败 50已跳过 60已终止")
@TableField("exec_status")
private Integer execStatus;
@ApiModelProperty(value = "执行开始时间")
@TableField("exec_start_time")
private Date execStartTime;
@ApiModelProperty(value = "执行结束时间")
@TableField("exec_end_time")
private Date execEndTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,64 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用流水线任务日志")
@TableName("application_pipeline_task_log")
@SuppressWarnings("ALL")
public class ApplicationPipelineTaskLogDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "流水线任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty(value = "流水线任务详情id")
@TableField("task_detail_id")
private Long taskDetailId;
/**
* @see cn.orionsec.ops.constant.app.PipelineLogStatus
*/
@ApiModelProperty(value = "日志状态 10创建 20执行 30成功 40失败 50停止 60跳过")
@TableField("log_status")
private Integer logStatus;
/**
* @see cn.orionsec.ops.constant.app.StageType
*/
@ApiModelProperty(value = "阶段类型 10构建 20发布")
@TableField("stage_type")
private Integer stageType;
@ApiModelProperty(value = "日志详情")
@TableField("log_info")
private String logInfo;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,59 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用环境表")
@TableName("application_profile")
@SuppressWarnings("ALL")
public class ApplicationProfileDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "环境名称")
@TableField("profile_name")
private String profileName;
@ApiModelProperty(value = "环境唯一标识")
@TableField("profile_tag")
private String profileTag;
@ApiModelProperty(value = "环境描述")
@TableField("description")
private String description;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "发布是否需要审核 1需要 2无需")
@TableField("release_audit")
private Integer releaseAudit;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,181 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "发布任务")
@TableName("application_release")
@SuppressWarnings("ALL")
public class ApplicationReleaseDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "发布标题")
@TableField("release_title")
private String releaseTitle;
@ApiModelProperty(value = "发布描述")
@TableField("release_description")
private String releaseDescription;
@ApiModelProperty(value = "构建id")
@TableField("build_id")
private Long buildId;
@ApiModelProperty(value = "构建seq")
@TableField("build_seq")
private Integer buildSeq;
@ApiModelProperty(value = "应用id")
@TableField("app_id")
private Long appId;
@ApiModelProperty(value = "应用名称")
@TableField("app_name")
private String appName;
@ApiModelProperty(value = "应用唯一标识")
@TableField("app_tag")
private String appTag;
@ApiModelProperty(value = "环境id")
@TableField("profile_id")
private Long profileId;
@ApiModelProperty(value = "环境名称")
@TableField("profile_name")
private String profileName;
@ApiModelProperty(value = "环境唯一标识")
@TableField("profile_tag")
private String profileTag;
/**
* @see cn.orionsec.ops.constant.app.ReleaseType
*/
@ApiModelProperty(value = "发布类型 10正常发布 20回滚发布")
@TableField("release_type")
private Integer releaseType;
/**
* @see cn.orionsec.ops.constant.app.ReleaseStatus
*/
@ApiModelProperty(value = "发布状态 10待审核 20审核驳回 30待发布 35待调度 40发布中 50发布完成 60发布停止 70发布失败")
@TableField("release_status")
private Integer releaseStatus;
/**
* @see cn.orionsec.ops.constant.common.SerialType
*/
@ApiModelProperty(value = "发布序列 10串行 20并行")
@TableField("release_serialize")
private Integer releaseSerialize;
/**
* @see cn.orionsec.ops.constant.common.ExceptionHandlerType
*/
@ApiModelProperty(value = "异常处理 10跳过所有 20跳过错误")
@TableField("exception_handler")
private Integer exceptionHandler;
@ApiModelProperty(value = "构建产物文件")
@TableField("bundle_path")
private String bundlePath;
@ApiModelProperty(value = "产物传输路径")
@TableField("transfer_path")
private String transferPath;
/**
* @see cn.orionsec.ops.constant.app.TransferMode
*/
@ApiModelProperty(value = "产物传输方式")
@TableField("transfer_mode")
private String transferMode;
@ApiModelProperty(value = "回滚发布id")
@TableField("rollback_release_id")
private Long rollbackReleaseId;
/**
* @see cn.orionsec.ops.constant.app.TimedType
*/
@ApiModelProperty(value = "是否是定时发布 10普通发布 20定时发布")
@TableField("timed_release")
private Integer timedRelease;
@ApiModelProperty(value = "定时发布时间")
@TableField("timed_release_time")
private Date timedReleaseTime;
@ApiModelProperty(value = "创建人id")
@TableField("create_user_id")
private Long createUserId;
@ApiModelProperty(value = "创建人名称")
@TableField("create_user_name")
private String createUserName;
@ApiModelProperty(value = "审核人id")
@TableField("audit_user_id")
private Long auditUserId;
@ApiModelProperty(value = "审核人名称")
@TableField("audit_user_name")
private String auditUserName;
@ApiModelProperty(value = "审核时间")
@TableField("audit_time")
private Date auditTime;
@ApiModelProperty(value = "审核备注")
@TableField("audit_reason")
private String auditReason;
@ApiModelProperty(value = "发布开始时间")
@TableField("release_start_time")
private Date releaseStartTime;
@ApiModelProperty(value = "发布结束时间")
@TableField("release_end_time")
private Date releaseEndTime;
@ApiModelProperty(value = "发布人id")
@TableField("release_user_id")
private Long releaseUserId;
@ApiModelProperty(value = "发布人名称")
@TableField("release_user_name")
private String releaseUserName;
@ApiModelProperty(value = "发布操作json")
@TableField("action_config")
private String actionConfig;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,78 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "发布任务机器表")
@TableName("application_release_machine")
@SuppressWarnings("ALL")
public class ApplicationReleaseMachineDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "发布任务id")
@TableField("release_id")
private Long releaseId;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
@TableField("machine_name")
private String machineName;
@ApiModelProperty(value = "机器唯一标识")
@TableField("machine_tag")
private String machineTag;
@ApiModelProperty(value = "机器主机")
@TableField("machine_host")
private String machineHost;
/**
* @see cn.orionsec.ops.constant.app.ActionStatus
*/
@ApiModelProperty(value = "状态 10未开始 20进行中 30已完成 40执行失败 50已跳过 60已取消")
@TableField("run_status")
private Integer runStatus;
@ApiModelProperty(value = "日志路径")
@TableField("log_path")
private String logPath;
@ApiModelProperty(value = "开始时间")
@TableField("start_time")
private Date startTime;
@ApiModelProperty(value = "结束时间")
@TableField("end_time")
private Date endTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,91 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "应用版本仓库")
@TableName("application_repository")
@SuppressWarnings("ALL")
public class ApplicationRepositoryDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "名称")
@TableField("repo_name")
private String repoName;
@ApiModelProperty(value = "描述")
@TableField("repo_description")
private String repoDescription;
/**
* @see cn.orionsec.ops.constant.app.RepositoryType
*/
@ApiModelProperty(value = "类型 1git")
@TableField("repo_type")
private Integer repoType;
@ApiModelProperty(value = "url")
@TableField("repo_url")
private String repoUrl;
@ApiModelProperty(value = "用户名")
@TableField("repo_username")
private String repoUsername;
@ApiModelProperty(value = "密码")
@TableField("repo_password")
private String repoPassword;
@ApiModelProperty(value = "token")
@TableField("repo_private_token")
private String repoPrivateToken;
/**
* @see cn.orionsec.ops.constant.app.RepositoryStatus
*/
@ApiModelProperty(value = "状态 10未初始化 20初始化中 30正常 40失败")
@TableField("repo_status")
private Integer repoStatus;
/**
* @see cn.orionsec.ops.constant.app.RepositoryAuthType
*/
@ApiModelProperty(value = "认证类型 10密码 20令牌")
@TableField("repo_auth_type")
private Integer repoAuthType;
/**
* @see cn.orionsec.ops.constant.app.RepositoryTokenType
*/
@ApiModelProperty(value = "令牌类型 10github 20gitee 30gitlab")
@TableField("repo_token_type")
private Integer repoTokenType;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,101 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "命令执行表")
@TableName("command_exec")
@SuppressWarnings("ALL")
public class CommandExecDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户id")
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "用户名")
@TableField("user_name")
private String userName;
/**
* @see cn.orionsec.ops.constant.command.ExecType
*/
@ApiModelProperty(value = "执行类型 10批量执行")
@TableField("exec_type")
private Integer execType;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
@TableField("machine_name")
private String machineName;
@ApiModelProperty(value = "机器主机")
@TableField("machine_host")
private String machineHost;
@ApiModelProperty(value = "机器唯一标识")
@TableField("machine_tag")
private String machineTag;
/**
* @see cn.orionsec.ops.constant.command.ExecStatus
*/
@ApiModelProperty(value = "执行状态 10未开始 20执行中 30执行成功 40执行失败 50执行终止")
@TableField("exec_status")
private Integer execStatus;
@ApiModelProperty(value = "执行返回码")
@TableField("exit_code")
private Integer exitCode;
@ApiModelProperty(value = "命令")
@TableField("exec_command")
private String execCommand;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "日志目录")
@TableField("log_path")
private String logPath;
@ApiModelProperty(value = "执行开始时间")
@TableField("start_date")
private Date startDate;
@ApiModelProperty(value = "执行结束时间")
@TableField("end_date")
private Date endDate;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,66 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "命令模板表")
@TableName("command_template")
public class CommandTemplateDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "模板名称")
@TableField("template_name")
private String templateName;
@ApiModelProperty(value = "命令")
@TableField("template_value")
private String templateValue;
@ApiModelProperty(value = "命令描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "创建用户id")
@TableField("create_user_id")
private Long createUserId;
@ApiModelProperty(value = "创建用户名")
@TableField("create_user_name")
private String createUserName;
@ApiModelProperty(value = "修改用户id")
@TableField("update_user_id")
private Long updateUserId;
@ApiModelProperty(value = "修改用户名")
@TableField("update_user_name")
private String updateUserName;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,70 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "文件tail表")
@TableName("file_tail_list")
@SuppressWarnings("ALL")
public class FileTailListDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "别名")
@TableField("alias_name")
private String aliasName;
@ApiModelProperty(value = "文件路径")
@TableField("file_path")
private String filePath;
@ApiModelProperty(value = "文件编码")
@TableField("file_charset")
private String fileCharset;
@ApiModelProperty(value = "尾部文件偏移行数")
@TableField("file_offset")
private Integer fileOffset;
@ApiModelProperty(value = "tail 命令")
@TableField("tail_command")
private String tailCommand;
/**
* @see cn.orionsec.ops.constant.tail.FileTailMode
*/
@ApiModelProperty(value = "宿主机文件追踪类型 tracker/tail")
@TableField("tail_mode")
private String tailMode;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,89 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "sftp传输日志表")
@TableName("file_transfer_log")
@SuppressWarnings("ALL")
public class FileTransferLogDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户id")
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "用户名")
@TableField("user_name")
private String userName;
@ApiModelProperty(value = "文件token")
@TableField("file_token")
private String fileToken;
/**
* @see cn.orionsec.ops.constant.sftp.SftpTransferType
*/
@ApiModelProperty(value = "传输类型 10上传 20下载 30传输")
@TableField("transfer_type")
private Integer transferType;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "远程文件")
@TableField("remote_file")
private String remoteFile;
@ApiModelProperty(value = "本机文件")
@TableField("local_file")
private String localFile;
@ApiModelProperty(value = "当前大小")
@TableField("current_size")
private Long currentSize;
@ApiModelProperty(value = "文件大小")
@TableField("file_size")
private Long fileSize;
@ApiModelProperty(value = "当前进度")
@TableField("now_progress")
private Double nowProgress;
/**
* @see cn.orionsec.ops.constant.sftp.SftpTransferStatus
*/
@ApiModelProperty(value = "传输状态 10未开始 20进行中 30已暂停 40已完成 50已取消 60传输异常")
@TableField("transfer_status")
private Integer transferStatus;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,72 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "历史值快照表")
@TableName("history_value_snapshot")
@SuppressWarnings("ALL")
public class HistoryValueSnapshotDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "值id")
@TableField("value_id")
private Long valueId;
/**
* @see cn.orionsec.ops.constant.history.HistoryOperator
*/
@ApiModelProperty(value = "操作类型 1新增 2修改 3删除")
@TableField("operator_type")
private Integer operatorType;
/**
* @see cn.orionsec.ops.constant.history.HistoryValueType
*/
@ApiModelProperty(value = "值类型 10机器环境变量 20应用环境变量")
@TableField("value_type")
private Integer valueType;
@ApiModelProperty(value = "原始值")
@TableField("before_value")
private String beforeValue;
@ApiModelProperty(value = "新值")
@TableField("after_value")
private String afterValue;
@ApiModelProperty(value = "修改人id")
@TableField("update_user_id")
private Long updateUserId;
@ApiModelProperty(value = "修改人用户名")
@TableField("update_user_name")
private String updateUserName;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,61 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("machine_alarm_config")
@ApiModel(value = "MachineAlarmConfigDO对象", description = "机器报警配置")
@SuppressWarnings("ALL")
public class MachineAlarmConfigDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
/**
* @see cn.orionsec.ops.constant.machine.MachineAlarmType
*/
@ApiModelProperty(value = "报警类型 10: cpu使用率 20: 内存使用率")
@TableField("alarm_type")
private Integer alarmType;
@ApiModelProperty(value = "报警阈值")
@TableField("alarm_threshold")
private Double alarmThreshold;
@ApiModelProperty(value = "触发报警阈值 次")
@TableField("trigger_threshold")
private Integer triggerThreshold;
@ApiModelProperty(value = "报警通知沉默时间 分")
@TableField("notify_silence")
private Integer notifySilence;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,46 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("machine_alarm_group")
@ApiModel(value = "MachineAlarmGroupDO对象", description = "机器报警通知组")
public class MachineAlarmGroupDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = " 报警组id")
@TableField("group_id")
private Long groupId;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,55 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("machine_alarm_history")
@ApiModel(value = "MachineAlarmHistoryDO对象", description = "机器报警历史")
@SuppressWarnings("ALL")
public class MachineAlarmHistoryDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
/**
* @see cn.orionsec.ops.constant.machine.MachineAlarmType
*/
@ApiModelProperty(value = "报警类型 10: cpu使用率 20: 内存使用率")
@TableField("alarm_type")
private Integer alarmType;
@ApiModelProperty(value = "报警值")
@TableField("alarm_value")
private Double alarmValue;
@ApiModelProperty(value = "报警时间")
@TableField("alarm_time")
private Date alarmTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@TableField("create_time")
private Date createTime;
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,53 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器环境变量")
@TableName("machine_env")
public class MachineEnvDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "key")
@TableField("attr_key")
private String attrKey;
@ApiModelProperty(value = "value")
@TableField("attr_value")
private String attrValue;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,50 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("machine_group")
@ApiModel(value = "MachineGroupDO对象", description = "机器分组")
public class MachineGroupDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "父id")
@TableField("parent_id")
private Long parentId;
@ApiModelProperty(value = "组名称")
@TableField("group_name")
private String groupName;
@ApiModelProperty(value = "排序")
@TableField("sort")
private Integer sort;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,45 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("machine_group_rel")
@ApiModel(value = "MachineGroupRelDO对象", description = "机器分组关联表")
public class MachineGroupRelDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "组id")
@TableField("group_id")
private Long groupId;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,90 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器信息表")
@TableName("machine_info")
@SuppressWarnings("ALL")
public class MachineInfoDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "代理id")
@TableField(value = "proxy_id", updateStrategy = FieldStrategy.IGNORED)
private Long proxyId;
@ApiModelProperty(value = "密钥id")
@TableField(value = "key_id", updateStrategy = FieldStrategy.IGNORED)
private Long keyId;
@ApiModelProperty(value = "主机ip")
@TableField("machine_host")
private String machineHost;
@ApiModelProperty(value = "ssh端口")
@TableField("ssh_port")
private Integer sshPort;
@ApiModelProperty(value = "机器名称")
@TableField("machine_name")
private String machineName;
@ApiModelProperty(value = "机器唯一标识")
@TableField("machine_tag")
private String machineTag;
@ApiModelProperty(value = "机器描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "机器账号")
@TableField("username")
private String username;
@ApiModelProperty(value = "机器密码")
@TableField("password")
private String password;
/**
* @see cn.orionsec.ops.constant.machine.MachineAuthType
*/
@ApiModelProperty(value = "机器认证方式 1: 密码认证 2: 独立密钥")
@TableField("auth_type")
private Integer authType;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "机器状态 1有效 2无效")
@TableField("machine_status")
private Integer machineStatus;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,61 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器监控配置表")
@TableName("machine_monitor")
@SuppressWarnings("ALL")
public class MachineMonitorDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
/**
* @see cn.orionsec.ops.constant.monitor.MonitorStatus
*/
@ApiModelProperty(value = "插件状态 1未安装 2安装中 3未运行 4运行中")
@TableField("monitor_status")
private Integer monitorStatus;
@ApiModelProperty(value = "请求 api url")
@TableField("monitor_url")
private String monitorUrl;
@ApiModelProperty(value = "请求 api accessToken")
@TableField("access_token")
private String accessToken;
@ApiModelProperty(value = "插件版本")
@TableField("agent_version")
private String agentVersion;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,65 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器代理")
@TableName("machine_proxy")
@SuppressWarnings("ALL")
public class MachineProxyDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "代理主机")
@TableField("proxy_host")
private String proxyHost;
@ApiModelProperty(value = "代理端口")
@TableField("proxy_port")
private Integer proxyPort;
@ApiModelProperty(value = "代理用户名")
@TableField("proxy_username")
private String proxyUsername;
@ApiModelProperty(value = "代理密码")
@TableField("proxy_password")
private String proxyPassword;
/**
* @see cn.orionsec.ops.constant.machine.ProxyType
*/
@ApiModelProperty(value = "代理类型 1http代理 2socket4代理 3socket5代理")
@TableField("proxy_type")
private Integer proxyType;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,53 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器ssh登录密钥")
@TableName("machine_secret_key")
public class MachineSecretKeyDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "密钥名称")
@TableField("key_name")
private String keyName;
@ApiModelProperty(value = "密钥文件本地路径")
@TableField("secret_key_path")
private String secretKeyPath;
@ApiModelProperty(value = "密钥密码")
@TableField("password")
private String password;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,85 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器终端配置表")
@TableName("machine_terminal")
@SuppressWarnings("ALL")
public class MachineTerminalDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
/**
* @see cn.orionsec.kit.net.host.ssh.TerminalType#XTERM
*/
@ApiModelProperty(value = "终端类型")
@TableField("terminal_type")
private String terminalType;
/**
* @see cn.orionsec.ops.constant.terminal.TerminalConst#BACKGROUND_COLOR
*/
@ApiModelProperty(value = "背景色")
@TableField("background_color")
private String backgroundColor;
/**
* @see cn.orionsec.ops.constant.terminal.TerminalConst#FONT_COLOR
*/
@ApiModelProperty(value = "字体颜色")
@TableField("font_color")
private String fontColor;
/**
* @see cn.orionsec.ops.constant.terminal.TerminalConst#FONT_SIZE
*/
@ApiModelProperty(value = "字体大小")
@TableField("font_size")
private Integer fontSize;
/**
* @see cn.orionsec.ops.constant.terminal.TerminalConst#FONT_FAMILY
*/
@ApiModelProperty(value = "字体名称")
@TableField("font_family")
private String fontFamily;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "是否开启url link 1开启 2关闭")
@TableField("enable_web_link")
private Integer enableWebLink;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,84 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器终端操作日志")
@TableName("machine_terminal_log")
@SuppressWarnings("ALL")
public class MachineTerminalLogDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户id")
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "用户名")
@TableField("username")
private String username;
@ApiModelProperty(value = "机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
@TableField("machine_name")
private String machineName;
@ApiModelProperty(value = "机器唯一标识")
@TableField("machine_tag")
private String machineTag;
@ApiModelProperty(value = "机器host")
@TableField("machine_host")
private String machineHost;
@ApiModelProperty(value = "token")
@TableField("access_token")
private String accessToken;
@ApiModelProperty(value = "建立连接时间")
@TableField("connected_time")
private Date connectedTime;
@ApiModelProperty(value = "断开连接时间")
@TableField("disconnected_time")
private Date disconnectedTime;
/**
* @see cn.orionsec.ops.constant.ws.WsCloseCode
*/
@ApiModelProperty(value = "close code")
@TableField("close_code")
private Integer closeCode;
@ApiModelProperty(value = "录屏文件路径")
@TableField("screen_path")
private String screenPath;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,87 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "调度任务")
@TableName("scheduler_task")
@SuppressWarnings("ALL")
public class SchedulerTaskDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "任务名称")
@TableField("task_name")
private String taskName;
@ApiModelProperty(value = "任务描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "执行命令")
@TableField("task_command")
private String taskCommand;
@ApiModelProperty(value = "cron表达式")
@TableField("expression")
private String expression;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "启用状态 1启用 2停用")
@TableField("enable_status")
private Integer enableStatus;
/**
* @see cn.orionsec.ops.constant.scheduler.SchedulerTaskStatus
*/
@ApiModelProperty(value = "最近状态 10待调度 20调度中 30调度成功 40调度失败 50已停止")
@TableField("lately_status")
private Integer latelyStatus;
/**
* @see cn.orionsec.ops.constant.common.SerialType
*/
@ApiModelProperty(value = "调度序列 10串行 20并行")
@TableField("serialize_type")
private Integer serializeType;
/**
* @see cn.orionsec.ops.constant.common.ExceptionHandlerType
*/
@ApiModelProperty(value = "异常处理 10跳过所有 20跳过错误")
@TableField("exception_handler")
private Integer exceptionHandler;
@ApiModelProperty(value = "上次调度时间")
@TableField(value = "lately_schedule_time")
private Date latelyScheduleTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,45 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "调度任务机器")
@TableName("scheduler_task_machine")
public class SchedulerTaskMachineDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty(value = "调度机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,94 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "调度任务执行明细机器详情")
@TableName("scheduler_task_machine_record")
@SuppressWarnings("ALL")
public class SchedulerTaskMachineRecordDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty(value = "明细id")
@TableField("record_id")
private Long recordId;
@ApiModelProperty(value = "任务机器id")
@TableField("task_machine_id")
private Long taskMachineId;
@ApiModelProperty(value = "执行机器id")
@TableField("machine_id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
@TableField("machine_name")
private String machineName;
@ApiModelProperty(value = "机器主机")
@TableField("machine_host")
private String machineHost;
@ApiModelProperty(value = "机器唯一标识")
@TableField("machine_tag")
private String machineTag;
@ApiModelProperty(value = "执行命令")
@TableField("exec_command")
private String execCommand;
/**
* @see cn.orionsec.ops.constant.scheduler.SchedulerTaskMachineStatus
*/
@ApiModelProperty(value = "执行状态 10待调度 20调度中 30调度成功 40调度失败 50已跳过 60已停止")
@TableField("exec_status")
private Integer execStatus;
@ApiModelProperty(value = "退出码")
@TableField("exit_code")
private Integer exitCode;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "日志路径")
@TableField("log_path")
private String logPath;
@ApiModelProperty(value = "开始时间")
@TableField("start_time")
private Date startTime;
@ApiModelProperty(value = "结束时间")
@TableField("end_time")
private Date endTime;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,62 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "调度任务执行日志")
@TableName("scheduler_task_record")
@SuppressWarnings("ALL")
public class SchedulerTaskRecordDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty(value = "任务名称")
@TableField("task_name")
private String taskName;
/**
* @see cn.orionsec.ops.constant.scheduler.SchedulerTaskStatus
*/
@ApiModelProperty(value = "任务状态 10待调度 20调度中 30调度成功 40调度失败 50已停止")
@TableField("task_status")
private Integer taskStatus;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "开始时间")
@TableField("start_time")
private Date startTime;
@ApiModelProperty(value = "结束时间")
@TableField("end_time")
private Date endTime;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,59 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "系统环境变量")
@TableName("system_env")
@SuppressWarnings("ALL")
public class SystemEnvDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "key")
@TableField("attr_key")
private String attrKey;
@ApiModelProperty(value = "value")
@TableField("attr_value")
private String attrValue;
/**
* @see cn.orionsec.ops.constant.Const#IS_SYSTEM
* @see cn.orionsec.ops.constant.Const#NOT_SYSTEM
*/
@ApiModelProperty(value = "是否为系统变量 1是 2否")
@TableField("system_env")
private Integer systemEnv;
@ApiModelProperty(value = "描述")
@TableField("description")
private String description;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,73 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "用户事件日志")
@TableName("user_event_log")
@SuppressWarnings("ALL")
public class UserEventLogDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户id")
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "用户名")
@TableField("username")
private String username;
/**
* @see cn.orionsec.ops.constant.event.EventClassify
*/
@ApiModelProperty(value = "事件分类")
@TableField("event_classify")
private Integer eventClassify;
/**
* @see cn.orionsec.ops.constant.event.EventType
*/
@ApiModelProperty(value = "事件类型")
@TableField("event_type")
private Integer eventType;
@ApiModelProperty(value = "日志信息")
@TableField("log_info")
private String logInfo;
@ApiModelProperty(value = "日志参数")
@TableField("params_json")
private String paramsJson;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "是否执行成功 1成功 2失败")
@TableField("exec_result")
private Integer execResult;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
}

View File

@@ -0,0 +1,98 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "用户表")
@TableName("user_info")
@SuppressWarnings("ALL")
public class UserInfoDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户名")
@TableField("username")
private String username;
@ApiModelProperty(value = "昵称")
@TableField("nickname")
private String nickname;
@ApiModelProperty(value = "密码")
@TableField("password")
private String password;
@ApiModelProperty(value = "盐值")
@TableField("salt")
private String salt;
/**
* @see cn.orionsec.ops.constant.user.RoleType
*/
@ApiModelProperty(value = "角色类型 10管理员 20开发 30运维")
@TableField("role_type")
private Integer roleType;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "用户状态 1启用 2禁用")
@TableField("user_status")
private Integer userStatus;
/**
* @see cn.orionsec.ops.constant.Const#ENABLE
* @see cn.orionsec.ops.constant.Const#DISABLE
*/
@ApiModelProperty(value = "锁定状态 1正常 2锁定")
@TableField("lock_status")
private Integer lockStatus;
@ApiModelProperty(value = "登录失败次数")
@TableField("failed_login_count")
private Integer failedLoginCount;
@ApiModelProperty(value = "头像地址")
@TableField("avatar_pic")
private String avatarPic;
@ApiModelProperty(value = "联系手机")
@TableField("contact_phone")
private String contactPhone;
@ApiModelProperty(value = "联系邮箱")
@TableField("contact_email")
private String contactEmail;
@ApiModelProperty(value = "最后登录时间")
@TableField("last_login_time")
private Date lastLoginTime;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,76 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "系统站内信")
@TableName("web_side_message")
@SuppressWarnings("ALL")
public class WebSideMessageDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* @see cn.orionsec.ops.constant.message.MessageClassify
*/
@ApiModelProperty(value = "消息分类")
@TableField("message_classify")
private Integer messageClassify;
/**
* @see cn.orionsec.ops.constant.message.MessageType
*/
@ApiModelProperty(value = "消息类型")
@TableField("message_type")
private Integer messageType;
/**
* @see cn.orionsec.ops.constant.message.ReadStatus
*/
@ApiModelProperty(value = "是否已读 1未读 2已读")
@TableField("read_status")
private Integer readStatus;
@ApiModelProperty(value = "收信人id")
@TableField("to_user_id")
private Long toUserId;
@ApiModelProperty(value = "收信人名称")
@TableField("to_user_name")
private String toUserName;
@ApiModelProperty(value = "消息")
@TableField("send_message")
private String sendMessage;
@ApiModelProperty(value = "消息关联id")
@TableField("rel_id")
private Long relId;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,57 @@
package cn.orionsec.ops.entity.domain;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("webhook_config")
@ApiModel(value = "WebhookConfigDO对象", description = "webhook 配置")
@SuppressWarnings("ALL")
public class WebhookConfigDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "名称")
@TableField("webhook_name")
private String webhookName;
@ApiModelProperty(value = "url")
@TableField("webhook_url")
private String webhookUrl;
/**
* @see cn.orionsec.ops.constant.webhook.WebhookType
*/
@ApiModelProperty(value = "类型 10: 钉钉机器人")
@TableField("webhook_type")
private Integer webhookType;
@ApiModelProperty(value = "配置项 json")
@TableField("webhook_config")
private String webhookConfig;
@ApiModelProperty(value = "是否删除 1未删除 2已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField("update_time")
private Date updateTime;
}

View File

@@ -0,0 +1,22 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "检查应用是否已配置")
public class ApplicationActionConfigDTO {
@ApiModelProperty(value = "appId")
private Long appId;
@ApiModelProperty(value = "构建阶段数量")
private Integer buildStageCount;
@ApiModelProperty(value = "发布阶段数量")
private Integer releaseStageCount;
}

View File

@@ -0,0 +1,29 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "应用构建统计")
public class ApplicationBuildStatisticsDTO {
@ApiModelProperty(value = "构建次数")
private Integer buildCount;
@ApiModelProperty(value = "成功次数")
private Integer successCount;
@ApiModelProperty(value = "失败次数")
private Integer failureCount;
@ApiModelProperty(value = "日期")
private Date date;
@ApiModelProperty(value = "平均构建时长ms (成功)")
private Long avgUsed;
}

View File

@@ -0,0 +1,30 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "应用流水线统计")
public class ApplicationPipelineTaskStatisticsDTO {
@ApiModelProperty(value = "执行次数")
private Integer execCount;
@ApiModelProperty(value = "成功次数")
private Integer successCount;
@ApiModelProperty(value = "失败次数")
private Integer failureCount;
@ApiModelProperty(value = "日期")
private Date date;
@ApiModelProperty(value = "平均执行时长ms (成功)")
private Long avgUsed;
}

View File

@@ -0,0 +1,29 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "应用发布统计")
public class ApplicationReleaseStatisticsDTO {
@ApiModelProperty(value = "发布次数")
private Integer releaseCount;
@ApiModelProperty(value = "成功次数")
private Integer successCount;
@ApiModelProperty(value = "失败次数")
private Integer failureCount;
@ApiModelProperty(value = "日期")
private Date date;
@ApiModelProperty(value = "平均发布时长ms (成功)")
private Long avgUsed;
}

View File

@@ -0,0 +1,45 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "机器监控配置")
@SuppressWarnings("ALL")
public class MachineMonitorDTO implements Serializable {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "机器id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
private String machineName;
@ApiModelProperty(value = "机器主机")
private String machineHost;
/**
* @see cn.orionsec.ops.constant.monitor.MonitorStatus
*/
@ApiModelProperty(value = "监控状态 1未安装 2安装中 3未运行 4运行中")
private Integer monitorStatus;
@ApiModelProperty(value = "请求 api url")
private String monitorUrl;
@ApiModelProperty(value = "请求 api accessToken")
private String accessToken;
@ApiModelProperty(value = "插件版本")
private String agentVersion;
}

View File

@@ -0,0 +1,35 @@
package cn.orionsec.ops.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "调度任务机器执行统计")
public class SchedulerTaskRecordStatisticsDTO {
@ApiModelProperty(value = "调度次数")
private Integer scheduledCount;
@ApiModelProperty(value = "成功次数")
private Integer successCount;
@ApiModelProperty(value = "失败次数")
private Integer failureCount;
@ApiModelProperty(value = "日期")
private Date date;
@ApiModelProperty(value = "机器平均执行时长ms (成功)")
private Long avgUsed;
@ApiModelProperty(value = "机器id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
private String machineName;
}

View File

@@ -0,0 +1,25 @@
package cn.orionsec.ops.entity.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "机器监控查询参数")
@SuppressWarnings("ALL")
public class MachineMonitorQuery {
@ApiModelProperty(value = "机器id")
private Long machineId;
@ApiModelProperty(value = "机器名称")
private String machineName;
/**
* @see cn.orionsec.ops.constant.monitor.MonitorStatus
*/
@ApiModelProperty(value = "监控状态 1未安装 2安装中 3未运行 4运行中")
private Integer monitorStatus;
}

View File

@@ -0,0 +1,190 @@
package cn.orionsec.ops.utils;
import cn.orionsec.kit.lang.constant.Const;
import cn.orionsec.kit.lang.utils.Strings;
import cn.orionsec.kit.lang.utils.Systems;
import cn.orionsec.kit.lang.utils.ext.PropertiesExt;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CodeGenerator {
private static final Pattern ENV_VAR_PATTERN = Pattern.compile("\\$\\{([^:]+):([^}]+)\\}");
public static void main(String[] args) {
runGenerator();
}
/**
* 代码生成器
*/
private static void runGenerator() {
// 获取配置文件
File file = new File("orion-ops-api/orion-ops-web/src/main/resources/application-dev.properties");
PropertiesExt ext = new PropertiesExt(file);
String url = resolveConfigValue(ext.getValue("spring.datasource.url"));
String username = resolveConfigValue(ext.getValue("spring.datasource.username"));
String password = resolveConfigValue(ext.getValue("spring.datasource.password"));
// 全局配置
GlobalConfig gbConfig = new GlobalConfig()
// 是否支持AR模式
.setActiveRecord(false)
// 设置作者
.setAuthor(Const.ORION_AUTHOR)
// 生成路径
.setOutputDir("D:/MP/")
// 文件是否覆盖
.setFileOverride(true)
// 主键策略
.setIdType(IdType.AUTO)
// Service名称
.setServiceName("%sService")
// 业务实现类名称
.setServiceImplName("%sServiceImpl")
// 实体对象名名称
.setEntityName("%sDO")
// 映射接口名称
.setMapperName("%sDAO")
// 映射文件名称
.setXmlName("%sMapper")
// web名称
.setControllerName("%sController")
// 生成 swagger2 注解
.setSwagger2(true)
// 开启 Kotlin 模式
.setKotlin(false)
// 是否生成ResultMap
.setBaseResultMap(true)
// 是否生成二级缓存
.setEnableCache(false)
// date类型
.setDateType(DateType.ONLY_DATE)
// 是否生成SQL片段
.setBaseColumnList(true);
// 数据源配置
DataSourceConfig dsConfig = new DataSourceConfig()
// 配置数据库类型
.setDbType(DbType.MYSQL)
// 配置驱动
.setDriverName("com.mysql.cj.jdbc.Driver")
// 配置路径
.setUrl(url)
// 配置账号
.setUsername(username)
// 配置密码
.setPassword(password)
// 转换器
.setTypeConvert(new MySqlTypeConvert() {
@Override
public IColumnType processTypeConvert(GlobalConfig globalConfig, String fieldType) {
if (fieldType.toLowerCase().contains("tinyint")) {
return DbColumnType.INTEGER;
}
return super.processTypeConvert(globalConfig, fieldType);
}
});
// 策略配置
StrategyConfig stConfig = new StrategyConfig()
// 全局大写命名
.setCapitalMode(true)
// 生成实体类注解
.setEntityTableFieldAnnotationEnable(true)
// 是否使用lombok写get set 方法
.setEntityLombokModel(true)
// 前端是否使用 @RestController
.setRestControllerStyle(true)
// 驼峰转连接字符
.setControllerMappingHyphenStyle(false)
// Boolean类型字段是否移除is前缀
.setEntityBooleanColumnRemoveIsPrefix(false)
// 下滑线转驼峰命名策略
.setNaming(NamingStrategy.underline_to_camel)
// 是否生成字段常量
.setEntityColumnConstant(false)
// 是否链式结构
.setChainModel(false)
// 配置表前缀
.setTablePrefix("")
// 配置字段前缀
.setFieldPrefix("")
// 生成的表
.setInclude("machine_group", "machine_group_rel");
// 包名策略配置
PackageConfig pkConfig = new PackageConfig()
// 声明父包
.setParent("cn.orionsec.ops")
// 映射接口的包
.setMapper("dao")
// service接口的包
.setService("service")
// serviceImpl接口的包
.setServiceImpl("service.impl")
// controller接口的包
.setController("controller")
// 实体类的包
.setEntity("entity.domain")
// 映射文件的包
.setXml("mapper");
// 整合配置
AutoGenerator ag = new AutoGenerator()
// 整合全局配置
.setGlobalConfig(gbConfig)
// 整合数据源配置
.setDataSource(dsConfig)
// 整合表名配置
.setStrategy(stConfig)
// 整合包名策略
.setPackageInfo(pkConfig);
// 执行
ag.execute();
}
/**
* 解析实际的配置
*
* @param value value
* @return value
*/
private static String resolveConfigValue(String value) {
if (Strings.isBlank(value)) {
return value;
}
Matcher matcher = ENV_VAR_PATTERN.matcher(value);
StringBuffer resultString = new StringBuffer();
while (matcher.find()) {
// 环境变量名
String envVar = matcher.group(1);
// 默认值
String defaultValue = matcher.group(2);
// 获取环境变量的值
String envValue = Systems.getEnv(envVar, defaultValue);
// 替换占位符
matcher.appendReplacement(resultString, Matcher.quoteReplacement(envValue));
}
// 处理结尾的剩余部分
matcher.appendTail(resultString);
return resultString.toString();
}
}

View File

@@ -0,0 +1,99 @@
package cn.orionsec.ops.utils;
import cn.orionsec.kit.lang.define.wrapper.DataGrid;
import cn.orionsec.kit.lang.define.wrapper.PageRequest;
import cn.orionsec.kit.lang.define.wrapper.Pager;
import cn.orionsec.kit.lang.utils.Valid;
import cn.orionsec.kit.lang.utils.collect.Lists;
import cn.orionsec.kit.lang.utils.convert.Converts;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class DataQuery<T> {
private final BaseMapper<T> dao;
private PageRequest page;
private LambdaQueryWrapper<T> wrapper;
private DataQuery(BaseMapper<T> dao) {
this.dao = dao;
}
public static <T> DataQuery<T> of(BaseMapper<T> dao) {
Valid.notNull(dao, "dao is null");
return new DataQuery<>(dao);
}
public DataQuery<T> page(PageRequest page) {
this.page = Valid.notNull(page, "page is null");
return this;
}
public DataQuery<T> wrapper(LambdaQueryWrapper<T> wrapper) {
this.wrapper = Valid.notNull(wrapper, "wrapper is null");
return this;
}
public Optional<T> get() {
return Optional.ofNullable(dao.selectOne(wrapper));
}
public <R> Optional<R> get(Class<R> c) {
return Optional.ofNullable(dao.selectOne(wrapper))
.map(s -> Converts.to(s, c));
}
public Stream<T> list() {
return dao.selectList(wrapper).stream();
}
public <R> List<R> list(Class<R> c) {
return Converts.toList(dao.selectList(wrapper), c);
}
public Integer count() {
return dao.selectCount(wrapper);
}
public boolean present() {
return dao.selectCount(wrapper) > 0;
}
public DataGrid<T> dataGrid() {
return this.dataGrid(Function.identity());
}
public <R> DataGrid<R> dataGrid(Class<R> c) {
return this.dataGrid(t -> Converts.to(t, c));
}
public <R> DataGrid<R> dataGrid(Function<T, R> convert) {
Valid.notNull(convert, "convert is null");
Valid.notNull(page, "page is null");
Valid.notNull(wrapper, "wrapper is null");
Integer count = dao.selectCount(wrapper);
Pager<R> pager = new Pager<>(page);
pager.setTotal(count);
boolean next = pager.hasMoreData();
if (next) {
wrapper.last(pager.getSql());
List<R> rows = dao.selectList(wrapper).stream()
.map(convert)
.collect(Collectors.toList());
pager.setRows(rows);
} else {
pager.setRows(Lists.empty());
}
return DataGrid.of(pager);
}
}

View File

@@ -0,0 +1,21 @@
<?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="cn.orionsec.ops.dao.AlarmGroupDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.orionsec.ops.entity.domain.AlarmGroupDO">
<id column="id" property="id"/>
<result column="group_name" property="groupName"/>
<result column="group_description" property="groupDescription"/>
<result column="deleted" property="deleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id
, group_name, group_description, deleted, create_time, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,22 @@
<?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="cn.orionsec.ops.dao.AlarmGroupNotifyDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.orionsec.ops.entity.domain.AlarmGroupNotifyDO">
<id column="id" property="id"/>
<result column="group_id" property="groupId"/>
<result column="notify_id" property="notifyId"/>
<result column="notify_type" property="notifyType"/>
<result column="deleted" property="deleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id
, group_id, notify_id, notify_type, deleted, create_time, update_time
</sql>
</mapper>

Some files were not shown because too many files have changed in this diff Show More