多模块重构 5:infra 模块的修改~~~

This commit is contained in:
YunaiV 2022-01-31 17:57:45 +08:00
parent dc11dfc215
commit 9bc9b2ac6b
153 changed files with 1420 additions and 1742 deletions

View File

@ -99,12 +99,6 @@
<artifactId>yudao-spring-boot-starter-redis</artifactId> <artifactId>yudao-spring-boot-starter-redis</artifactId>
</dependency> </dependency>
<!-- Config 配置中心相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-config</artifactId>
</dependency>
<!-- Job 定时任务相关 --> <!-- Job 定时任务相关 -->
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
@ -152,11 +146,6 @@
<artifactId>velocity-engine-core</artifactId> <artifactId>velocity-engine-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId> <!-- 实现数据库文档 -->
</dependency>
<!-- 三方云服务相关 --> <!-- 三方云服务相关 -->
<dependency> <dependency>

View File

@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} ${yudao.core-service.base-package} @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} ${yudao.core-service.base-package}
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}", "${yudao.core-service.base-package}", @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}", "${yudao.core-service.base-package}",
"${yudao.info.member-package}", "${yudao.info.system-package}"}) // TODO 芋艿重构 "${yudao.info.base-package2}"}) // TODO 芋艿重构
public class AdminServerApplication { public class AdminServerApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -100,7 +100,7 @@ apollo:
eagerLoad: eagerLoad:
enabled: true # 设置 Apollo 在日志初始化前生效,可以实现日志的动态级别配置 enabled: true # 设置 Apollo 在日志初始化前生效,可以实现日志的动态级别配置
jdbc: # 自定义的 JDBC 配置项,用于数据库的地址 jdbc: # 自定义的 JDBC 配置项,用于数据库的地址
dao: cn.iocoder.yudao.coreservice.modules.infra.dal.mysql.config.InfConfigCoreDAOImpl dao: cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigCoreDAOImpl
url: ${spring.datasource.dynamic.datasource.master.url} url: ${spring.datasource.dynamic.datasource.master.url}
username: ${spring.datasource.dynamic.datasource.master.username} username: ${spring.datasource.dynamic.datasource.master.username}
password: ${spring.datasource.dynamic.datasource.master.password} password: ${spring.datasource.dynamic.datasource.master.password}

View File

@ -113,7 +113,7 @@ apollo:
eagerLoad: eagerLoad:
enabled: true # 设置 Apollo 在日志初始化前生效,可以实现日志的动态级别配置 enabled: true # 设置 Apollo 在日志初始化前生效,可以实现日志的动态级别配置
jdbc: # 自定义的 JDBC 配置项,用于数据库的地址 jdbc: # 自定义的 JDBC 配置项,用于数据库的地址
dao: cn.iocoder.yudao.coreservice.modules.infra.dal.mysql.config.InfConfigCoreDAOImpl dao: cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigCoreDAOImpl
url: ${spring.datasource.dynamic.datasource.master.url} url: ${spring.datasource.dynamic.datasource.master.url}
username: ${spring.datasource.dynamic.datasource.master.username} username: ${spring.datasource.dynamic.datasource.master.username}
password: ${spring.datasource.dynamic.datasource.master.password} password: ${spring.datasource.dynamic.datasource.master.password}

View File

@ -48,17 +48,16 @@ yudao:
info: info:
version: 1.0.0 version: 1.0.0
base-package: cn.iocoder.yudao.adminserver base-package: cn.iocoder.yudao.adminserver
member-package: cn.iocoder.yudao.module.member base-package2: cn.iocoder.yudao.module
system-package: cn.iocoder.yudao.module.system
core-service: core-service:
base-package: cn.iocoder.yudao.coreservice base-package: cn.iocoder.yudao.coreservice
web: web:
admin-api: admin-api:
prefix: /admin-api prefix: /admin-api
controller: cn.iocoder.yudao.module.system.controller.admin # TODO 芋艿:需要改造 controller: '**.controller.admin.**'
app-api: app-api:
prefix: /app-api prefix: /app-api
controller: cn.iocoder.yudao.module.member.controller.app # TODO 芋艿:需要改造 controller: '**.controller.app.**'
swagger: swagger:
title: 管理后台 title: 管理后台

View File

@ -1,10 +1,5 @@
-- inf 开头的 DB -- inf 开头的 DB
DELETE FROM "inf_config";
DELETE FROM "inf_file";
DELETE FROM "inf_job";
DELETE FROM "inf_job_log";
DELETE FROM "inf_api_access_log";
DELETE FROM "inf_api_error_log";
-- pay 开头的 DB -- pay 开头的 DB
DELETE FROM pay_merchant; DELETE FROM pay_merchant;

View File

@ -1,71 +1,5 @@
-- inf 开头的 DB -- inf 开头的 DB
CREATE TABLE IF NOT EXISTS "inf_config" (
"id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"group" varchar(50) NOT NULL,
"type" tinyint NOT NULL,
"name" varchar(100) NOT NULL DEFAULT '',
"key" varchar(100) NOT NULL DEFAULT '',
"value" varchar(500) NOT NULL DEFAULT '',
"sensitive" bit NOT NULL,
"remark" varchar(500) DEFAULT NULL,
"creator" varchar(64) DEFAULT '',
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updater" varchar(64) DEFAULT '',
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted" bit NOT NULL DEFAULT FALSE,
PRIMARY KEY ("id")
) COMMENT '参数配置表';
CREATE TABLE IF NOT EXISTS "inf_file" (
"id" varchar(188) NOT NULL,
"type" varchar(63) DEFAULT NULL,
"content" blob NOT NULL,
"creator" varchar(64) DEFAULT '',
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updater" varchar(64) DEFAULT '',
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted" bit NOT NULL DEFAULT FALSE,
"tenant_id" bigint not null default '0',
PRIMARY KEY ("id")
) COMMENT '文件表';
CREATE TABLE IF NOT EXISTS "inf_job" (
"id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY COMMENT '任务编号',
"name" varchar(32) NOT NULL COMMENT '任务名称',
"status" tinyint(4) NOT NULL COMMENT '任务状态',
"handler_name" varchar(64) NOT NULL COMMENT '处理器的名字',
"handler_param" varchar(255) DEFAULT NULL COMMENT '处理器的参数',
"cron_expression" varchar(32) NOT NULL COMMENT 'CRON 表达式',
"retry_count" int(11) NOT NULL DEFAULT '0' COMMENT '重试次数',
"retry_interval" int(11) NOT NULL DEFAULT '0' COMMENT '重试间隔',
"monitor_timeout" int(11) NOT NULL DEFAULT '0' COMMENT '监控超时时间',
"creator" varchar(64) DEFAULT '' COMMENT '创建者',
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
"updater" varchar(64) DEFAULT '' COMMENT '更新者',
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
"deleted" bit NOT NULL DEFAULT FALSE COMMENT '是否删除',
PRIMARY KEY ("id")
) COMMENT='定时任务表';
CREATE TABLE IF NOT EXISTS "inf_job_log" (
"id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY COMMENT '日志编号',
"job_id" bigint(20) NOT NULL COMMENT '任务编号',
"handler_name" varchar(64) NOT NULL COMMENT '处理器的名字',
"handler_param" varchar(255) DEFAULT NULL COMMENT '处理器的参数',
"execute_index" tinyint(4) NOT NULL DEFAULT '1' COMMENT '第几次执行',
"begin_time" datetime NOT NULL COMMENT '开始执行时间',
"end_time" datetime DEFAULT NULL COMMENT '结束执行时间',
"duration" int(11) DEFAULT NULL COMMENT '执行时长',
"status" tinyint(4) NOT NULL COMMENT '任务状态',
"result" varchar(4000) DEFAULT '' COMMENT '结果数据',
"creator" varchar(64) DEFAULT '' COMMENT '创建者',
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
"updater" varchar(64) DEFAULT '' COMMENT '更新者',
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
"deleted" bit(1) NOT NULL DEFAULT FALSE COMMENT '是否删除',
PRIMARY KEY ("id")
)COMMENT='定时任务日志表';
CREATE TABLE IF NOT EXISTS "pay_merchant" CREATE TABLE IF NOT EXISTS "pay_merchant"
( (

View File

@ -40,10 +40,6 @@
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId> <artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-social</artifactId>
</dependency>
<!-- Web 相关 --> <!-- Web 相关 -->
<dependency> <dependency>

View File

@ -1,48 +0,0 @@
package cn.iocoder.yudao.coreservice;
import cn.iocoder.yudao.coreservice.config.RedisTestConfiguration;
import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration;
import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration;
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import org.redisson.spring.starter.RedissonAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.jdbc.Sql;
/**
* 依赖内存 DB + Redis 的单元测试
*
* 相比 {@link BaseDbUnitTest} 来说额外增加了内存 Redis
*
* @author 芋道源码
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseDbAndRedisUnitTest.Application.class)
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) // 每个单元测试结束后清理 DB
public class BaseDbAndRedisUnitTest {
@Import({
// DB 配置类
YudaoDataSourceAutoConfiguration.class, // 自己的 DB 配置类
DataSourceAutoConfiguration.class, // Spring DB 自动配置类
DataSourceTransactionManagerAutoConfiguration.class, // Spring 事务自动配置类
DruidDataSourceAutoConfigure.class, // Druid 自动配置类
// MyBatis 配置类
YudaoMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类
// Redis 配置类
RedisTestConfiguration.class, // Redis 测试配置类用于启动 RedisServer
RedisAutoConfiguration.class, // Spring Redis 自动配置类
YudaoRedisAutoConfiguration.class, // 自己的 Redis 配置类
RedissonAutoConfiguration.class, // Redisson 自动高配置类
})
public static class Application {
}
}

View File

@ -1,39 +0,0 @@
package cn.iocoder.yudao.coreservice;
import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration;
import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.jdbc.Sql;
/**
* 依赖内存 DB 的单元测试
*
* 注意Service 层同样适用对于 Service 层的单元测试我们针对自己模块的 Mapper 走的是 H2 内存数据库针对别的模块的 Service 走的是 Mock 方法
*
* @author 芋道源码
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseDbUnitTest.Application.class)
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) // 每个单元测试结束后清理 DB
public class BaseDbUnitTest {
@Import({
// DB 配置类
YudaoDataSourceAutoConfiguration.class, // 自己的 DB 配置类
DataSourceAutoConfiguration.class, // Spring DB 自动配置类
DataSourceTransactionManagerAutoConfiguration.class, // Spring 事务自动配置类
DruidDataSourceAutoConfigure.class, // Druid 自动配置类
// MyBatis 配置类
YudaoMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类
})
public static class Application {
}
}

View File

@ -1,32 +0,0 @@
package cn.iocoder.yudao.coreservice;
import cn.iocoder.yudao.coreservice.config.RedisTestConfiguration;
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
import org.redisson.spring.starter.RedissonAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;
/**
* 依赖内存 Redis 的单元测试
*
* 相比 {@link BaseDbUnitTest} 来说从内存 DB 改成了内存 Redis
*
* @author 芋道源码
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseRedisUnitTest.Application.class)
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
public class BaseRedisUnitTest {
@Import({
// Redis 配置类
RedisTestConfiguration.class, // Redis 测试配置类用于启动 RedisServer
RedisAutoConfiguration.class, // Spring Redis 自动配置类
YudaoRedisAutoConfiguration.class, // 自己的 Redis 配置类
RedissonAutoConfiguration.class, // Redisson 自动高配置类
})
public static class Application {
}
}

View File

@ -1,30 +0,0 @@
package cn.iocoder.yudao.coreservice.config;
import com.github.fppt.jedismock.RedisServer;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import java.io.IOException;
@Configuration(proxyBeanMethods = false)
@Lazy(false) // 禁止延迟加载
@EnableConfigurationProperties(RedisProperties.class)
public class RedisTestConfiguration {
/**
* 创建模拟的 Redis Server 服务器
*/
@Bean
public RedisServer redisServer(RedisProperties properties) throws IOException {
RedisServer redisServer = new RedisServer(properties.getPort());
// TODO 芋艿一次执行多个单元测试时貌似创建多个 spring 容器导致不进行 stop这样就导致端口被占用无法启动
try {
redisServer.start();
} catch (Exception ignore) {}
return redisServer;
}
}

View File

@ -1,86 +0,0 @@
package cn.iocoder.yudao.coreservice.modules.infra.service.file;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.iocoder.yudao.coreservice.BaseDbUnitTest;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.mysql.file.InfFileCoreMapper;
import cn.iocoder.yudao.coreservice.modules.infra.framework.file.config.FileProperties;
import cn.iocoder.yudao.coreservice.modules.infra.service.file.impl.InfFileCoreServiceImpl;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
import javax.annotation.Resource;
import static cn.iocoder.yudao.coreservice.modules.infra.enums.SysErrorCodeConstants.*;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString;
import static org.junit.jupiter.api.Assertions.*;
@Import({InfFileCoreServiceImpl.class, FileProperties.class})
public class InfFileCoreServiceTest extends BaseDbUnitTest {
@Resource
private InfFileCoreService fileCoreService;
@MockBean
private FileProperties fileProperties;
@Resource
private InfFileCoreMapper fileMapper;
@Test
public void testCreateFile_success() {
// 准备参数
String path = randomString();
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
// 调用
String url = fileCoreService.createFile(path, content);
// 断言
assertEquals(fileProperties.getBasePath() + path, url);
// 校验数据
InfFileDO file = fileMapper.selectById(path);
assertEquals(path, file.getId());
assertEquals("jpg", file.getType());
assertArrayEquals(content, file.getContent());
}
@Test
public void testCreateFile_exists() {
// mock 数据
InfFileDO dbFile = randomPojo(InfFileDO.class);
fileMapper.insert(dbFile);
// 准备参数
String path = dbFile.getId(); // 模拟已存在
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
// 调用并断言异常
assertServiceException(() -> fileCoreService.createFile(path, content), FILE_PATH_EXISTS);
}
@Test
public void testDeleteFile_success() {
// mock 数据
InfFileDO dbFile = randomPojo(InfFileDO.class);
fileMapper.insert(dbFile);// @Sql: 先插入出一条存在的数据
// 准备参数
String id = dbFile.getId();
// 调用
fileCoreService.deleteFile(id);
// 校验数据不存在了
assertNull(fileMapper.selectById(id));
}
@Test
public void testDeleteFile_notExists() {
// 准备参数
String id = randomString();
// 调用, 并断言异常
assertServiceException(() -> fileCoreService.deleteFile(id), FILE_NOT_EXISTS);
}
}

View File

@ -1,45 +0,0 @@
package cn.iocoder.yudao.coreservice.modules.infra.service.logger;
import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.coreservice.BaseDbUnitTest;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.mysql.logger.InfApiAccessLogCoreMapper;
import cn.iocoder.yudao.coreservice.modules.infra.service.logger.impl.InfApiAccessLogCoreServiceImpl;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.test.core.util.RandomUtils;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Import;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* {@link InfApiAccessLogCoreServiceImpl} 单元测试
*/
@Import(InfApiAccessLogCoreServiceImpl.class)
public class InfApiAccessLogCoreServiceTest extends BaseDbUnitTest {
@Resource
private InfApiAccessLogCoreService apiAccessLogCoreService;
@Resource
private InfApiAccessLogCoreMapper apiAccessLogCoreMapper;
@Test
public void testCreateApiAccessLogAsync() {
// 准备参数
ApiAccessLogCreateReqDTO createDTO = RandomUtils.randomPojo(ApiAccessLogCreateReqDTO.class,
dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()));
// 调用
apiAccessLogCoreService.createApiAccessLogAsync(createDTO);
// 断言
InfApiAccessLogDO infApiAccessLogDO = apiAccessLogCoreMapper.selectOne(null);
assertNotNull(infApiAccessLogDO);
assertPojoEquals(createDTO, infApiAccessLogDO);
}
}

View File

@ -1,45 +0,0 @@
package cn.iocoder.yudao.coreservice.modules.infra.service.logger;
import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.coreservice.BaseDbUnitTest;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.mysql.logger.InfApiErrorLogCoreMapper;
import cn.iocoder.yudao.coreservice.modules.infra.service.logger.impl.InfApiErrorLogCoreServiceImpl;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.test.core.util.RandomUtils;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Import;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* {@link InfApiErrorLogCoreServiceImpl} 单元测试
*/
@Import(InfApiErrorLogCoreServiceImpl.class)
public class InfApiErrorLogCoreServiceTest extends BaseDbUnitTest {
@Resource
private InfApiErrorLogCoreService apiErrorLogCoreService;
@Resource
private InfApiErrorLogCoreMapper infApiErrorLogCoreMapper;
@Test
public void testCreateApiErrorLogAsync() {
// 准备参数
ApiErrorLogCreateReqDTO createDTO = RandomUtils.randomPojo(ApiErrorLogCreateReqDTO.class,
dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()));
// 调用
apiErrorLogCoreService.createApiErrorLogAsync(createDTO);
// 断言
InfApiErrorLogDO infApiErrorLogDO = infApiErrorLogCoreMapper.selectOne(null);
assertNotNull(infApiErrorLogDO);
assertPojoEquals(createDTO, infApiErrorLogDO);
}
}

View File

@ -1 +0,0 @@
package cn.iocoder.yudao.coreservice.modules.infra.service;

View File

@ -24,6 +24,7 @@ import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Predicate;
@Slf4j @Slf4j
public class DBConfigRepository extends AbstractConfigRepository { public class DBConfigRepository extends AbstractConfigRepository {
@ -135,7 +136,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
private Properties buildProperties(List<ConfigRespDTO> configs) { private Properties buildProperties(List<ConfigRespDTO> configs) {
Properties properties = propertiesFactory.getPropertiesInstance(); Properties properties = propertiesFactory.getPropertiesInstance();
configs.stream().filter(ConfigRespDTO::getDeleted) // 过滤掉被删除的配置 configs.stream().filter(config -> !config.getDeleted()) // 过滤掉被删除的配置
.forEach(config -> properties.put(config.getKey(), config.getValue())); .forEach(config -> properties.put(config.getKey(), config.getValue()));
return properties; return properties;
} }

View File

@ -16,7 +16,7 @@ import org.springframework.context.annotation.Configuration;
*/ */
@Configuration @Configuration
@MapperScan(value = {"${yudao.info.base-package}", "${yudao.core-service.base-package}", @MapperScan(value = {"${yudao.info.base-package}", "${yudao.core-service.base-package}",
"${yudao.info.member-package}", "${yudao.info.system-package}"}, "${yudao.info.base-package2}"},
annotationClass = Mapper.class, annotationClass = Mapper.class,
lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载目前仅用于单元测试 lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载目前仅用于单元测试
public class YudaoMybatisAutoConfiguration { public class YudaoMybatisAutoConfiguration {

View File

@ -36,11 +36,9 @@ public class WebProperties {
private String prefix; private String prefix;
/** /**
* Controller 所在包 * Controller 所在包 Ant 路径规则
* *
* 主要目的是给该 Controller 设置指定的 {@link #prefix} * 主要目的是给该 Controller 设置指定的 {@link #prefix}
*
* 因为我们有多个 modules 包里会包含 Controller所以只需要写到 cn.iocoder.yudao 这样的层级
*/ */
@NotEmpty(message = "Controller 所在包不能为空") @NotEmpty(message = "Controller 所在包不能为空")
private String controller; private String controller;

View File

@ -13,6 +13,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.PathMatcher; import org.springframework.util.PathMatcher;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfiguration;
@ -49,8 +50,9 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer {
* @param api API 配置 * @param api API 配置
*/ */
private void configurePathMatch(PathMatchConfigurer configurer, WebProperties.Api api) { private void configurePathMatch(PathMatchConfigurer configurer, WebProperties.Api api) {
AntPathMatcher antPathMatcher = new AntPathMatcher(".");
configurer.addPathPrefix(api.getPrefix(), clazz -> clazz.isAnnotationPresent(RestController.class) configurer.addPathPrefix(api.getPrefix(), clazz -> clazz.isAnnotationPresent(RestController.class)
&& clazz.getPackage().getName().startsWith(api.getController())); // 仅仅匹配 controller && antPathMatcher.match(api.getController(), clazz.getPackage().getName())); // 仅仅匹配 controller
} }
@Bean @Bean

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.infra.api.file;
import cn.hutool.core.util.IdUtil;
/**
* 文件 API 接口
*
* @author 芋道源码
*/
public interface FileApi {
/**
* 保存文件并返回文件的访问路径
*
* @param content 文件内容
* @return 文件路径
*/
default String createFile(byte[] content) {
return createFile(IdUtil.fastUUID(), content);
}
/**
* 保存文件并返回文件的访问路径
*
* @param path 文件路径
* @param content 文件内容
* @return 文件路径
*/
String createFile(String path, byte[] content);
}

View File

@ -0,0 +1,4 @@
/**
* infra API 定义暴露给其它模块的 API
*/
package cn.iocoder.yudao.module.infra.api;

View File

@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
* *
* infra 系统使用 1-001-000-000 * infra 系统使用 1-001-000-000
*/ */
public interface InfErrorCodeConstants { public interface ErrorCodeConstants {
// ========== 参数配置 1001000000 ========== // ========== 参数配置 1001000000 ==========
ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1001000001, "参数配置不存在"); ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1001000001, "参数配置不存在");
@ -27,4 +27,8 @@ public interface InfErrorCodeConstants {
ErrorCode API_ERROR_LOG_NOT_FOUND = new ErrorCode(1001002000, "API 错误日志不存在"); ErrorCode API_ERROR_LOG_NOT_FOUND = new ErrorCode(1001002000, "API 错误日志不存在");
ErrorCode API_ERROR_LOG_PROCESSED = new ErrorCode(1001002001, "API 错误日志已处理"); ErrorCode API_ERROR_LOG_PROCESSED = new ErrorCode(1001002001, "API 错误日志已处理");
// ========= 文件相关 1001003000=================
ErrorCode FILE_PATH_EXISTS = new ErrorCode(1001003000, "文件路径已存在");
ErrorCode FILE_NOT_EXISTS = new ErrorCode(1001003001, "文件不存在");
} }

View File

@ -23,19 +23,26 @@
<artifactId>yudao-module-member-api</artifactId> <artifactId>yudao-module-member-api</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-api</artifactId> <artifactId>yudao-module-system-api</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-infra-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务组件 --> <!-- 业务组件 -->
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId> <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- Web 相关 --> <!-- Web 相关 -->
<dependency> <dependency>
@ -54,6 +61,12 @@
<artifactId>yudao-spring-boot-starter-redis</artifactId> <artifactId>yudao-spring-boot-starter-redis</artifactId>
</dependency> </dependency>
<!-- Config 配置中心相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-config</artifactId>
</dependency>
<!-- 消息队列相关 --> <!-- 消息队列相关 -->
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
@ -73,6 +86,10 @@
<artifactId>yudao-spring-boot-starter-excel</artifactId> <artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId> <!-- 实现数据库文档 -->
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.infra.api.file;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
/**
* 文件 API 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class FileApiImpl implements FileApi {
@Resource
private FileService fileService;
@Override
public String createFile(String path, byte[] content) {
return fileService.createFile(path, content);
}
}

View File

@ -0,0 +1 @@
package cn.iocoder.yudao.module.infra.api;

View File

@ -1,17 +1,15 @@
package cn.iocoder.yudao.module.infra.controller.admin.config; package cn.iocoder.yudao.module.infra.controller.admin.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.*;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*;
import cn.iocoder.yudao.module.infra.convert.config.InfConfigConvert; import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert;
import cn.iocoder.yudao.module.infra.service.config.InfConfigService; import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
import cn.iocoder.yudao.module.infra.controller.config.vo.*; import cn.iocoder.yudao.module.infra.service.config.ConfigService;
import cn.iocoder.yudao.module.infra.enums.InfErrorCodeConstants; import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -25,18 +23,17 @@ import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "参数配置") @Api(tags = "管理后台 - 参数配置")
@RestController @RestController
@RequestMapping("/infra/config") @RequestMapping("/infra/config")
@Validated @Validated
public class ConfigController { public class ConfigController {
@Resource @Resource
private InfConfigService configService; private ConfigService configService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建参数配置") @ApiOperation("创建参数配置")
@ -67,19 +64,19 @@ public class ConfigController {
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('infra:config:query')") @PreAuthorize("@ss.hasPermission('infra:config:query')")
public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) { public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) {
return success(InfConfigConvert.INSTANCE.convert(configService.getConfig(id))); return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id)));
} }
@GetMapping(value = "/get-value-by-key") @GetMapping(value = "/get-value-by-key")
@ApiOperation(value = "根据参数键名查询参数值", notes = "敏感配置,不允许返回给前端") @ApiOperation(value = "根据参数键名查询参数值", notes = "敏感配置,不允许返回给前端")
@ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class) @ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class)
public CommonResult<String> getConfigKey(@RequestParam("key") String key) { public CommonResult<String> getConfigKey(@RequestParam("key") String key) {
InfConfigDO config = configService.getConfigByKey(key); ConfigDO config = configService.getConfigByKey(key);
if (config == null) { if (config == null) {
return null; return null;
} }
if (config.getSensitive()) { if (config.getSensitive()) {
throw ServiceExceptionUtil.exception(InfErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_SENSITIVE); throw ServiceExceptionUtil.exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_SENSITIVE);
} }
return success(config.getValue()); return success(config.getValue());
} }
@ -88,8 +85,8 @@ public class ConfigController {
@ApiOperation("获取参数配置分页") @ApiOperation("获取参数配置分页")
@PreAuthorize("@ss.hasPermission('infra:config:query')") @PreAuthorize("@ss.hasPermission('infra:config:query')")
public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) { public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) {
PageResult<InfConfigDO> page = configService.getConfigPage(reqVO); PageResult<ConfigDO> page = configService.getConfigPage(reqVO);
return success(InfConfigConvert.INSTANCE.convertPage(page)); return success(ConfigConvert.INSTANCE.convertPage(page));
} }
@GetMapping("/export") @GetMapping("/export")
@ -98,9 +95,9 @@ public class ConfigController {
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportSysConfig(@Valid ConfigExportReqVO reqVO, public void exportSysConfig(@Valid ConfigExportReqVO reqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<InfConfigDO> list = configService.getConfigList(reqVO); List<ConfigDO> list = configService.getConfigList(reqVO);
// 拼接数据 // 拼接数据
List<ConfigExcelVO> datas = InfConfigConvert.INSTANCE.convertList(list); List<ConfigExcelVO> datas = ConfigConvert.INSTANCE.convertList(list);
// 输出 // 输出
ExcelUtils.write(response, "参数配置.xls", "数据", ConfigExcelVO.class, datas); ExcelUtils.write(response, "参数配置.xls", "数据", ConfigExcelVO.class, datas);
} }

View File

@ -9,7 +9,7 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("参数配置导出 Request VO") @ApiModel("管理后台 - 参数配置导出 Request VO")
@Data @Data
public class ConfigExportReqVO { public class ConfigExportReqVO {

View File

@ -12,7 +12,7 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("参数配置分页 Request VO") @ApiModel("管理后台 - 参数配置分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -9,7 +9,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
@ApiModel("参数配置信息 Response VO") @ApiModel("管理后台 - 参数配置信息 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class ConfigRespVO extends ConfigBaseVO { public class ConfigRespVO extends ConfigBaseVO {

View File

@ -8,7 +8,7 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("参数配置创建 Request VO") @ApiModel("管理后台 - 参数配置创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -16,7 +16,6 @@ import com.zaxxer.hikari.HikariDataSource;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -28,10 +27,10 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
@Api(tags = "数据库文档") @Api(tags = "管理后台 - 数据库文档")
@RestController @RestController
@RequestMapping("/infra/db-doc") @RequestMapping("/infra/db-doc")
public class InfDbDocController { public class DbDocController {
@Resource @Resource
private DynamicDataSourceProperties dynamicDataSourceProperties; private DynamicDataSourceProperties dynamicDataSourceProperties;

View File

@ -1,16 +1,15 @@
package cn.iocoder.yudao.module.infra.controller.admin.file; package cn.iocoder.yudao.module.infra.controller.admin.file;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.module.infra.service.file.InfFileService;
import cn.iocoder.yudao.coreservice.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.convert.file.InfFileConvert;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.FilePageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.FileRespVO;
import cn.iocoder.yudao.module.infra.convert.file.FileConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -29,17 +28,15 @@ import java.io.IOException;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "文件存储") @Api(tags = "管理后台 - 文件存储")
@RestController @RestController
@RequestMapping("/infra/file") @RequestMapping("/infra/file")
@Validated @Validated
@Slf4j @Slf4j
public class InfFileController { public class FileController {
@Resource @Resource
private InfFileService fileService; private FileService fileService;
@Resource
private InfFileCoreService fileCoreService;
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation("上传文件") @ApiOperation("上传文件")
@ -49,7 +46,7 @@ public class InfFileController {
}) })
public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file, public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file,
@RequestParam("path") String path) throws IOException { @RequestParam("path") String path) throws IOException {
return success(fileCoreService.createFile(path, IoUtil.readBytes(file.getInputStream()))); return success(fileService.createFile(path, IoUtil.readBytes(file.getInputStream())));
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ -57,7 +54,7 @@ public class InfFileController {
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = String.class) @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = String.class)
@PreAuthorize("@ss.hasPermission('infra:file:delete')") @PreAuthorize("@ss.hasPermission('infra:file:delete')")
public CommonResult<Boolean> deleteFile(@RequestParam("id") String id) { public CommonResult<Boolean> deleteFile(@RequestParam("id") String id) {
fileCoreService.deleteFile(id); fileService.deleteFile(id);
return success(true); return success(true);
} }
@ -66,7 +63,7 @@ public class InfFileController {
@ApiImplicitParam(name = "path", value = "文件附件", required = true, dataTypeClass = MultipartFile.class) @ApiImplicitParam(name = "path", value = "文件附件", required = true, dataTypeClass = MultipartFile.class)
public void getFile(HttpServletResponse response, @PathVariable("path") String path) throws IOException { public void getFile(HttpServletResponse response, @PathVariable("path") String path) throws IOException {
TenantContextHolder.setNullTenantId(); TenantContextHolder.setNullTenantId();
InfFileDO file = fileCoreService.getFile(path); FileDO file = fileService.getFile(path);
if (file == null) { if (file == null) {
log.warn("[getFile][path({}) 文件不存在]", path); log.warn("[getFile][path({}) 文件不存在]", path);
response.setStatus(HttpStatus.NOT_FOUND.value()); response.setStatus(HttpStatus.NOT_FOUND.value());
@ -78,9 +75,9 @@ public class InfFileController {
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得文件分页") @ApiOperation("获得文件分页")
@PreAuthorize("@ss.hasPermission('infra:file:query')") @PreAuthorize("@ss.hasPermission('infra:file:query')")
public CommonResult<PageResult<InfFileRespVO>> getFilePage(@Valid InfFilePageReqVO pageVO) { public CommonResult<PageResult<FileRespVO>> getFilePage(@Valid FilePageReqVO pageVO) {
PageResult<InfFileDO> pageResult = fileService.getFilePage(pageVO); PageResult<FileDO> pageResult = fileService.getFilePage(pageVO);
return success(InfFileConvert.INSTANCE.convertPage(pageResult)); return success(FileConvert.INSTANCE.convertPage(pageResult));
} }
} }

View File

@ -12,11 +12,11 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("文件分页 Request VO") @ApiModel("管理后台 - 文件分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfFilePageReqVO extends PageParam { public class FilePageReqVO extends PageParam {
@ApiModelProperty(value = "文件路径", example = "yudao", notes = "模糊匹配") @ApiModelProperty(value = "文件路径", example = "yudao", notes = "模糊匹配")
private String id; private String id;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.infra.vo; package cn.iocoder.yudao.module.infra.controller.admin.file.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -6,9 +6,9 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
@ApiModel(value = "文件 Response VO", description = "不返回 content 字段,太大") @ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大")
@Data @Data
public class InfFileRespVO { public class FileRespVO {
@ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg") @ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg")
private String id; private String id;

View File

@ -5,12 +5,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; import cn.iocoder.yudao.framework.quartz.core.util.CronUtils;
import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.*; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.*;
import cn.iocoder.yudao.module.infra.convert.job.InfJobConvert; import cn.iocoder.yudao.module.infra.convert.job.JobConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobDO; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
import cn.iocoder.yudao.module.infra.service.job.InfJobService; import cn.iocoder.yudao.module.infra.service.job.JobService;
import cn.iocoder.yudao.module.infra.controller.job.vo.job.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -32,19 +30,19 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "定时任务") @Api(tags = "管理后台 - 定时任务")
@RestController @RestController
@RequestMapping("/infra/job") @RequestMapping("/infra/job")
@Validated @Validated
public class InfJobController { public class JobController {
@Resource @Resource
private InfJobService jobService; private JobService jobService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建定时任务") @ApiOperation("创建定时任务")
@PreAuthorize("@ss.hasPermission('infra:job:create')") @PreAuthorize("@ss.hasPermission('infra:job:create')")
public CommonResult<Long> createJob(@Valid @RequestBody InfJobCreateReqVO createReqVO) public CommonResult<Long> createJob(@Valid @RequestBody JobCreateReqVO createReqVO)
throws SchedulerException { throws SchedulerException {
return success(jobService.createJob(createReqVO)); return success(jobService.createJob(createReqVO));
} }
@ -52,7 +50,7 @@ public class InfJobController {
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新定时任务") @ApiOperation("更新定时任务")
@PreAuthorize("@ss.hasPermission('infra:job:update')") @PreAuthorize("@ss.hasPermission('infra:job:update')")
public CommonResult<Boolean> updateJob(@Valid @RequestBody InfJobUpdateReqVO updateReqVO) public CommonResult<Boolean> updateJob(@Valid @RequestBody JobUpdateReqVO updateReqVO)
throws SchedulerException { throws SchedulerException {
jobService.updateJob(updateReqVO); jobService.updateJob(updateReqVO);
return success(true); return success(true);
@ -94,38 +92,38 @@ public class InfJobController {
@ApiOperation("获得定时任务") @ApiOperation("获得定时任务")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<InfJobRespVO> getJob(@RequestParam("id") Long id) { public CommonResult<JobRespVO> getJob(@RequestParam("id") Long id) {
InfJobDO job = jobService.getJob(id); JobDO job = jobService.getJob(id);
return success(InfJobConvert.INSTANCE.convert(job)); return success(JobConvert.INSTANCE.convert(job));
} }
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获得定时任务列表") @ApiOperation("获得定时任务列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class) @ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<List<InfJobRespVO>> getJobList(@RequestParam("ids") Collection<Long> ids) { public CommonResult<List<JobRespVO>> getJobList(@RequestParam("ids") Collection<Long> ids) {
List<InfJobDO> list = jobService.getJobList(ids); List<JobDO> list = jobService.getJobList(ids);
return success(InfJobConvert.INSTANCE.convertList(list)); return success(JobConvert.INSTANCE.convertList(list));
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得定时任务分页") @ApiOperation("获得定时任务分页")
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<PageResult<InfJobRespVO>> getJobPage(@Valid InfJobPageReqVO pageVO) { public CommonResult<PageResult<JobRespVO>> getJobPage(@Valid JobPageReqVO pageVO) {
PageResult<InfJobDO> pageResult = jobService.getJobPage(pageVO); PageResult<JobDO> pageResult = jobService.getJobPage(pageVO);
return success(InfJobConvert.INSTANCE.convertPage(pageResult)); return success(JobConvert.INSTANCE.convertPage(pageResult));
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@ApiOperation("导出定时任务 Excel") @ApiOperation("导出定时任务 Excel")
@PreAuthorize("@ss.hasPermission('infra:job:export')") @PreAuthorize("@ss.hasPermission('infra:job:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportJobExcel(@Valid InfJobExportReqVO exportReqVO, public void exportJobExcel(@Valid JobExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<InfJobDO> list = jobService.getJobList(exportReqVO); List<JobDO> list = jobService.getJobList(exportReqVO);
// 导出 Excel // 导出 Excel
List<InfJobExcelVO> datas = InfJobConvert.INSTANCE.convertList02(list); List<JobExcelVO> datas = JobConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "定时任务.xls", "数据", InfJobExcelVO.class, datas); ExcelUtils.write(response, "定时任务.xls", "数据", JobExcelVO.class, datas);
} }
@GetMapping("/get_next_times") @GetMapping("/get_next_times")
@ -137,7 +135,7 @@ public class InfJobController {
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<List<Date>> getJobNextTimes(@RequestParam("id") Long id, public CommonResult<List<Date>> getJobNextTimes(@RequestParam("id") Long id,
@RequestParam(value = "count", required = false, defaultValue = "5") Integer count) { @RequestParam(value = "count", required = false, defaultValue = "5") Integer count) {
InfJobDO job = jobService.getJob(id); JobDO job = jobService.getJob(id);
if (job == null) { if (job == null) {
return success(Collections.emptyList()); return success(Collections.emptyList());
} }

View File

@ -4,13 +4,13 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogRespVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogRespVO;
import cn.iocoder.yudao.module.infra.convert.job.InfJobLogConvert; import cn.iocoder.yudao.module.infra.convert.job.JobLogConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobLogDO; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
import cn.iocoder.yudao.module.infra.service.job.InfJobLogService; import cn.iocoder.yudao.module.infra.service.job.JobLogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -31,51 +31,51 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "定时任务日志") @Api(tags = "管理后台 - 定时任务日志")
@RestController @RestController
@RequestMapping("/infra/job-log") @RequestMapping("/infra/job-log")
@Validated @Validated
public class InfJobLogController { public class JobLogController {
@Resource @Resource
private InfJobLogService jobLogService; private JobLogService jobLogService;
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得定时任务日志") @ApiOperation("获得定时任务日志")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<InfJobLogRespVO> getJobLog(@RequestParam("id") Long id) { public CommonResult<JobLogRespVO> getJobLog(@RequestParam("id") Long id) {
InfJobLogDO jobLog = jobLogService.getJobLog(id); JobLogDO jobLog = jobLogService.getJobLog(id);
return success(InfJobLogConvert.INSTANCE.convert(jobLog)); return success(JobLogConvert.INSTANCE.convert(jobLog));
} }
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获得定时任务日志列表") @ApiOperation("获得定时任务日志列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<List<InfJobLogRespVO>> getJobLogList(@RequestParam("ids") Collection<Long> ids) { public CommonResult<List<JobLogRespVO>> getJobLogList(@RequestParam("ids") Collection<Long> ids) {
List<InfJobLogDO> list = jobLogService.getJobLogList(ids); List<JobLogDO> list = jobLogService.getJobLogList(ids);
return success(InfJobLogConvert.INSTANCE.convertList(list)); return success(JobLogConvert.INSTANCE.convertList(list));
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得定时任务日志分页") @ApiOperation("获得定时任务日志分页")
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<PageResult<InfJobLogRespVO>> getJobLogPage(@Valid InfJobLogPageReqVO pageVO) { public CommonResult<PageResult<JobLogRespVO>> getJobLogPage(@Valid JobLogPageReqVO pageVO) {
PageResult<InfJobLogDO> pageResult = jobLogService.getJobLogPage(pageVO); PageResult<JobLogDO> pageResult = jobLogService.getJobLogPage(pageVO);
return success(InfJobLogConvert.INSTANCE.convertPage(pageResult)); return success(JobLogConvert.INSTANCE.convertPage(pageResult));
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@ApiOperation("导出定时任务日志 Excel") @ApiOperation("导出定时任务日志 Excel")
@PreAuthorize("@ss.hasPermission('infra:job:export')") @PreAuthorize("@ss.hasPermission('infra:job:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportJobLogExcel(@Valid InfJobLogExportReqVO exportReqVO, public void exportJobLogExcel(@Valid JobLogExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<InfJobLogDO> list = jobLogService.getJobLogList(exportReqVO); List<JobLogDO> list = jobLogService.getJobLogList(exportReqVO);
// 导出 Excel // 导出 Excel
List<InfJobLogExcelVO> datas = InfJobLogConvert.INSTANCE.convertList02(list); List<JobLogExcelVO> datas = JobLogConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "任务日志.xls", "数据", InfJobLogExcelVO.class, datas); ExcelUtils.write(response, "任务日志.xls", "数据", JobLogExcelVO.class, datas);
} }
} }

View File

@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成 * 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/ */
@Data @Data
public class InfJobBaseVO { public class JobBaseVO {
@ApiModelProperty(value = "任务名称", required = true, example = "测试任务") @ApiModelProperty(value = "任务名称", required = true, example = "测试任务")
@NotNull(message = "任务名称不能为空") @NotNull(message = "任务名称不能为空")

View File

@ -8,11 +8,11 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("定时任务创建 Request VO") @ApiModel("管理后台 - 定时任务创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobCreateReqVO extends InfJobBaseVO { public class JobCreateReqVO extends JobBaseVO {
@ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") @ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
@NotNull(message = "处理器的名字不能为空") @NotNull(message = "处理器的名字不能为空")

View File

@ -14,7 +14,7 @@ import java.util.Date;
* @author 芋道源码 * @author 芋道源码
*/ */
@Data @Data
public class InfJobExcelVO { public class JobExcelVO {
@ExcelProperty("任务编号") @ExcelProperty("任务编号")
private Long id; private Long id;

View File

@ -4,17 +4,17 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel(value = "定时任务 Excel 导出 Request VO", description = "参数和 InfJobPageReqVO 是一致的") @ApiModel(value = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 InfJobPageReqVO 是一致的")
@Data @Data
public class InfJobExportReqVO { public class JobExportReqVO {
@ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配") @ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配")
private String name; private String name;
@ApiModelProperty(value = "任务状态", example = "1", notes = "参见 InfJobStatusEnum 枚举") @ApiModelProperty(value = "任务状态", example = "1", notes = "参见 JobStatusEnum 枚举")
private Integer status; private Integer status;
@ApiModelProperty(value = "处理器的名字", example = "sysUserSessionTimeoutJob", notes = "模糊匹配") @ApiModelProperty(value = "处理器的名字", example = "UserSessionTimeoutJob", notes = "模糊匹配")
private String handlerName; private String handlerName;
} }

View File

@ -7,11 +7,11 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("定时任务分页 Request VO") @ApiModel("管理后台 - 定时任务分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobPageReqVO extends PageParam { public class JobPageReqVO extends PageParam {
@ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配") @ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配")
private String name; private String name;

View File

@ -9,11 +9,11 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@ApiModel("定时任务 Response VO") @ApiModel("管理后台 - 定时任务 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobRespVO extends InfJobBaseVO { public class JobRespVO extends JobBaseVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @ApiModelProperty(value = "任务编号", required = true, example = "1024")
private Long id; private Long id;

View File

@ -8,11 +8,11 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("定时任务更新 Request VO") @ApiModel("管理后台 - 定时任务更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobUpdateReqVO extends InfJobBaseVO { public class JobUpdateReqVO extends JobBaseVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @ApiModelProperty(value = "任务编号", required = true, example = "1024")
@NotNull(message = "任务编号不能为空") @NotNull(message = "任务编号不能为空")

View File

@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成 * 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/ */
@Data @Data
public class InfJobLogBaseVO { public class JobLogBaseVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @ApiModelProperty(value = "任务编号", required = true, example = "1024")
@NotNull(message = "任务编号不能为空") @NotNull(message = "任务编号不能为空")

View File

@ -14,7 +14,7 @@ import java.util.Date;
* @author 芋艿 * @author 芋艿
*/ */
@Data @Data
public class InfJobLogExcelVO { public class JobLogExcelVO {
@ExcelProperty("日志编号") @ExcelProperty("日志编号")
private Long id; private Long id;

View File

@ -9,9 +9,9 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "定时任务 Excel 导出 Request VO", description = "参数和 InfJobLogPageReqVO 是一致的") @ApiModel(value = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 InfJobLogPageReqVO 是一致的")
@Data @Data
public class InfJobLogExportReqVO { public class JobLogExportReqVO {
@ApiModelProperty(value = "任务编号", example = "10") @ApiModelProperty(value = "任务编号", example = "10")
private Long jobId; private Long jobId;

View File

@ -12,11 +12,11 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("定时任务日志分页 Request VO") @ApiModel("管理后台 - 定时任务日志分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobLogPageReqVO extends PageParam { public class JobLogPageReqVO extends PageParam {
@ApiModelProperty(value = "任务编号", example = "10") @ApiModelProperty(value = "任务编号", example = "10")
private Long jobId; private Long jobId;

View File

@ -8,11 +8,11 @@ import lombok.ToString;
import java.util.Date; import java.util.Date;
@ApiModel("定时任务日志 Response VO") @ApiModel("管理后台 - 定时任务日志 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfJobLogRespVO extends InfJobLogBaseVO { public class JobLogRespVO extends JobLogBaseVO {
@ApiModelProperty(value = "日志编号", required = true, example = "1024") @ApiModelProperty(value = "日志编号", required = true, example = "1024")
private Long id; private Long id;

View File

@ -1,16 +1,16 @@
package cn.iocoder.yudao.module.infra.controller.admin.logger; package cn.iocoder.yudao.module.infra.controller.admin.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogRespVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO;
import cn.iocoder.yudao.module.infra.convert.logger.InfApiAccessLogConvert; import cn.iocoder.yudao.module.infra.convert.logger.ApiAccessLogConvert;
import cn.iocoder.yudao.module.infra.service.logger.InfApiAccessLogService; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -28,33 +28,33 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "API 访问日志") @Api(tags = "管理后台 - API 访问日志")
@RestController @RestController
@RequestMapping("/infra/api-access-log") @RequestMapping("/infra/api-access-log")
@Validated @Validated
public class InfApiAccessLogController { public class ApiAccessLogController {
@Resource @Resource
private InfApiAccessLogService apiAccessLogService; private ApiAccessLogService apiAccessLogService;
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得API 访问日志分页") @ApiOperation("获得API 访问日志分页")
@PreAuthorize("@ss.hasPermission('infra:api-access-log:query')") @PreAuthorize("@ss.hasPermission('infra:api-access-log:query')")
public CommonResult<PageResult<InfApiAccessLogRespVO>> getApiAccessLogPage(@Valid InfApiAccessLogPageReqVO pageVO) { public CommonResult<PageResult<ApiAccessLogRespVO>> getApiAccessLogPage(@Valid ApiAccessLogPageReqVO pageVO) {
PageResult<InfApiAccessLogDO> pageResult = apiAccessLogService.getApiAccessLogPage(pageVO); PageResult<ApiAccessLogDO> pageResult = apiAccessLogService.getApiAccessLogPage(pageVO);
return success(InfApiAccessLogConvert.INSTANCE.convertPage(pageResult)); return success(ApiAccessLogConvert.INSTANCE.convertPage(pageResult));
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@ApiOperation("导出API 访问日志 Excel") @ApiOperation("导出API 访问日志 Excel")
@PreAuthorize("@ss.hasPermission('infra:api-access-log:export')") @PreAuthorize("@ss.hasPermission('infra:api-access-log:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportApiAccessLogExcel(@Valid InfApiAccessLogExportReqVO exportReqVO, public void exportApiAccessLogExcel(@Valid ApiAccessLogExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<InfApiAccessLogDO> list = apiAccessLogService.getApiAccessLogList(exportReqVO); List<ApiAccessLogDO> list = apiAccessLogService.getApiAccessLogList(exportReqVO);
// 导出 Excel // 导出 Excel
List<InfApiAccessLogExcelVO> datas = InfApiAccessLogConvert.INSTANCE.convertList02(list); List<ApiAccessLogExcelVO> datas = ApiAccessLogConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "API 访问日志.xls", "数据", InfApiAccessLogExcelVO.class, datas); ExcelUtils.write(response, "API 访问日志.xls", "数据", ApiAccessLogExcelVO.class, datas);
} }
} }

View File

@ -1,16 +1,16 @@
package cn.iocoder.yudao.module.infra.controller.admin.logger; package cn.iocoder.yudao.module.infra.controller.admin.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogRespVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO;
import cn.iocoder.yudao.module.infra.convert.logger.InfApiErrorLogConvert; import cn.iocoder.yudao.module.infra.convert.logger.ApiErrorLogConvert;
import cn.iocoder.yudao.module.infra.service.logger.InfApiErrorLogService; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import cn.iocoder.yudao.module.infra.service.logger.ApiErrorLogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -29,14 +29,14 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Api(tags = "API 错误日志") @Api(tags = "管理后台 - API 错误日志")
@RestController @RestController
@RequestMapping("/infra/api-error-log") @RequestMapping("/infra/api-error-log")
@Validated @Validated
public class InfApiErrorLogController { public class ApiErrorLogController {
@Resource @Resource
private InfApiErrorLogService apiErrorLogService; private ApiErrorLogService apiErrorLogService;
@PutMapping("/update-status") @PutMapping("/update-status")
@ApiOperation("更新 API 错误日志的状态") @ApiOperation("更新 API 错误日志的状态")
@ -54,21 +54,21 @@ public class InfApiErrorLogController {
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得 API 错误日志分页") @ApiOperation("获得 API 错误日志分页")
@PreAuthorize("@ss.hasPermission('infra:api-error-log:query')") @PreAuthorize("@ss.hasPermission('infra:api-error-log:query')")
public CommonResult<PageResult<InfApiErrorLogRespVO>> getApiErrorLogPage(@Valid InfApiErrorLogPageReqVO pageVO) { public CommonResult<PageResult<ApiErrorLogRespVO>> getApiErrorLogPage(@Valid ApiErrorLogPageReqVO pageVO) {
PageResult<InfApiErrorLogDO> pageResult = apiErrorLogService.getApiErrorLogPage(pageVO); PageResult<ApiErrorLogDO> pageResult = apiErrorLogService.getApiErrorLogPage(pageVO);
return success(InfApiErrorLogConvert.INSTANCE.convertPage(pageResult)); return success(ApiErrorLogConvert.INSTANCE.convertPage(pageResult));
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@ApiOperation("导出 API 错误日志 Excel") @ApiOperation("导出 API 错误日志 Excel")
@PreAuthorize("@ss.hasPermission('infra:api-error-log:export')") @PreAuthorize("@ss.hasPermission('infra:api-error-log:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportApiErrorLogExcel(@Valid InfApiErrorLogExportReqVO exportReqVO, public void exportApiErrorLogExcel(@Valid ApiErrorLogExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<InfApiErrorLogDO> list = apiErrorLogService.getApiErrorLogList(exportReqVO); List<ApiErrorLogDO> list = apiErrorLogService.getApiErrorLogList(exportReqVO);
// 导出 Excel // 导出 Excel
List<InfApiErrorLogExcelVO> datas = InfApiErrorLogConvert.INSTANCE.convertList02(list); List<ApiErrorLogExcelVO> datas = ApiErrorLogConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "API 错误日志.xls", "数据", InfApiErrorLogExcelVO.class, datas); ExcelUtils.write(response, "API 错误日志.xls", "数据", ApiErrorLogExcelVO.class, datas);
} }
} }

View File

@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成 * 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/ */
@Data @Data
public class InfApiAccessLogBaseVO { public class ApiAccessLogBaseVO {
@ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") @ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
@NotNull(message = "链路追踪编号不能为空") @NotNull(message = "链路追踪编号不能为空")

View File

@ -14,7 +14,7 @@ import java.util.Date;
* @author 芋道源码 * @author 芋道源码
*/ */
@Data @Data
public class InfApiAccessLogExcelVO { public class ApiAccessLogExcelVO {
@ExcelProperty("日志主键") @ExcelProperty("日志主键")
private Long id; private Long id;

View File

@ -9,9 +9,9 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "API 访问日志 Excel 导出 Request VO", description = "参数和 InfApiAccessLogPageReqVO 是一致的") @ApiModel(value = "管理后台 - API 访问日志 Excel 导出 Request VO", description = "参数和 InfApiAccessLogPageReqVO 是一致的")
@Data @Data
public class InfApiAccessLogExportReqVO { public class ApiAccessLogExportReqVO {
@ApiModelProperty(value = "用户编号", example = "666") @ApiModelProperty(value = "用户编号", example = "666")
private Long userId; private Long userId;

View File

@ -12,11 +12,11 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("API 访问日志分页 Request VO") @ApiModel("管理后台 - API 访问日志分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfApiAccessLogPageReqVO extends PageParam { public class ApiAccessLogPageReqVO extends PageParam {
@ApiModelProperty(value = "用户编号", example = "666") @ApiModelProperty(value = "用户编号", example = "666")
private Long userId; private Long userId;

View File

@ -8,11 +8,11 @@ import lombok.ToString;
import java.util.Date; import java.util.Date;
@ApiModel("API 访问日志 Response VO") @ApiModel("管理后台 - API 访问日志 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfApiAccessLogRespVO extends InfApiAccessLogBaseVO { public class ApiAccessLogRespVO extends ApiAccessLogBaseVO {
@ApiModelProperty(value = "日志主键", required = true, example = "1024") @ApiModelProperty(value = "日志主键", required = true, example = "1024")
private Long id; private Long id;

View File

@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成 * 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/ */
@Data @Data
public class InfApiErrorLogBaseVO { public class ApiErrorLogBaseVO {
@ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") @ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
@NotNull(message = "链路追踪编号不能为空") @NotNull(message = "链路追踪编号不能为空")

View File

@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
@ -15,7 +14,7 @@ import java.util.Date;
* @author 芋道源码 * @author 芋道源码
*/ */
@Data @Data
public class InfApiErrorLogExcelVO { public class ApiErrorLogExcelVO {
@ExcelProperty("编号") @ExcelProperty("编号")
private Integer id; private Integer id;
@ -27,7 +26,7 @@ public class InfApiErrorLogExcelVO {
private Integer userId; private Integer userId;
@ExcelProperty(value = "用户类型", converter = DictConvert.class) @ExcelProperty(value = "用户类型", converter = DictConvert.class)
@DictFormat(DictTypeConstants.USER_TYPE) @DictFormat(cn.iocoder.yudao.module.system.enums.DictTypeConstants.USER_TYPE)
private Integer userType; private Integer userType;
@ExcelProperty("应用名") @ExcelProperty("应用名")

View File

@ -9,9 +9,9 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "API 错误日志 Excel 导出 Request VO", description = "参数和 InfApiErrorLogPageReqVO 是一致的") @ApiModel(value = "管理后台 - API 错误日志 Excel 导出 Request VO", description = "参数和 InfApiErrorLogPageReqVO 是一致的")
@Data @Data
public class InfApiErrorLogExportReqVO { public class ApiErrorLogExportReqVO {
@ApiModelProperty(value = "用户编号", example = "666") @ApiModelProperty(value = "用户编号", example = "666")
private Long userId; private Long userId;

View File

@ -12,11 +12,11 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("API 错误日志分页 Request VO") @ApiModel("管理后台 - API 错误日志分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfApiErrorLogPageReqVO extends PageParam { public class ApiErrorLogPageReqVO extends PageParam {
@ApiModelProperty(value = "用户编号", example = "666") @ApiModelProperty(value = "用户编号", example = "666")
private Long userId; private Long userId;

View File

@ -8,11 +8,11 @@ import lombok.ToString;
import java.util.Date; import java.util.Date;
@ApiModel("API 错误日志 Response VO") @ApiModel("管理后台 - API 错误日志 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfApiErrorLogRespVO extends InfApiErrorLogBaseVO { public class ApiErrorLogRespVO extends ApiErrorLogBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @ApiModelProperty(value = "编号", required = true, example = "1024")
private Integer id; private Integer id;

View File

@ -1,7 +1,9 @@
### 请求 /infra/redis/get-monitor-info 接口 => 成功 ### 请求 /infra/redis/get-monitor-info 接口 => 成功
GET {{baseUrl}}/infra/redis/get-monitor-info GET {{baseUrl}}/infra/redis/get-monitor-info
Authorization: Bearer {{token}} Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
### 请求 /infra/redis/get-key-list 接口 => 成功 ### 请求 /infra/redis/get-key-list 接口 => 成功
GET {{baseUrl}}/infra/redis/get-key-list GET {{baseUrl}}/infra/redis/get-key-list
Authorization: Bearer {{token}} Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}

View File

@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.redis;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
import cn.iocoder.yudao.framework.redis.core.RedisKeyRegistry; import cn.iocoder.yudao.framework.redis.core.RedisKeyRegistry;
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.InfRedisKeyRespVO; import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.InfRedisMonitorRespVO; import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespVO;
import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert; import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -22,7 +22,7 @@ import java.util.Properties;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "Redis 监控") @Api(tags = "管理后台 - Redis 监控")
@RestController @RestController
@RequestMapping("/infra/redis") @RequestMapping("/infra/redis")
public class RedisController { public class RedisController {
@ -33,7 +33,7 @@ public class RedisController {
@GetMapping("/get-monitor-info") @GetMapping("/get-monitor-info")
@ApiOperation("获得 Redis 监控信息") @ApiOperation("获得 Redis 监控信息")
@PreAuthorize("@ss.hasPermission('infra:redis:get-monitor-info')") @PreAuthorize("@ss.hasPermission('infra:redis:get-monitor-info')")
public CommonResult<InfRedisMonitorRespVO> getRedisMonitorInfo() { public CommonResult<RedisMonitorRespVO> getRedisMonitorInfo() {
// 获得 Redis 统计信息 // 获得 Redis 统计信息
Properties info = stringRedisTemplate.execute((RedisCallback<Properties>) RedisServerCommands::info); Properties info = stringRedisTemplate.execute((RedisCallback<Properties>) RedisServerCommands::info);
Long dbSize = stringRedisTemplate.execute(RedisServerCommands::dbSize); Long dbSize = stringRedisTemplate.execute(RedisServerCommands::dbSize);
@ -47,7 +47,7 @@ public class RedisController {
@GetMapping("/get-key-list") @GetMapping("/get-key-list")
@ApiOperation("获得 Redis Key 列表") @ApiOperation("获得 Redis Key 列表")
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
public CommonResult<List<InfRedisKeyRespVO>> getKeyList() { public CommonResult<List<RedisKeyRespVO>> getKeyList() {
List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list(); List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list();
return success(RedisConvert.INSTANCE.convertList(keyDefines)); return success(RedisConvert.INSTANCE.convertList(keyDefines));
} }

View File

@ -9,11 +9,11 @@ import lombok.Data;
import java.time.Duration; import java.time.Duration;
@ApiModel("Redis Key 信息 Response VO") @ApiModel("管理后台 - Redis Key 信息 Response VO")
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
public class InfRedisKeyRespVO { public class RedisKeyRespVO {
@ApiModelProperty(value = "login_user:%s", required = true, example = "String") @ApiModelProperty(value = "login_user:%s", required = true, example = "String")
private String keyTemplate; private String keyTemplate;
@ -22,7 +22,7 @@ public class InfRedisKeyRespVO {
private RedisKeyDefine.KeyTypeEnum keyType; private RedisKeyDefine.KeyTypeEnum keyType;
@ApiModelProperty(value = "Value 类型", required = true, example = "java.lang.String") @ApiModelProperty(value = "Value 类型", required = true, example = "java.lang.String")
private Class valueType; private Class<?> valueType;
@ApiModelProperty(value = "超时类型", required = true, example = "1") @ApiModelProperty(value = "超时类型", required = true, example = "1")
private RedisKeyDefine.TimeoutTypeEnum timeoutType; private RedisKeyDefine.TimeoutTypeEnum timeoutType;

View File

@ -9,11 +9,11 @@ import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
@ApiModel("Redis 监控信息 Response VO") @ApiModel("管理后台 - Redis 监控信息 Response VO")
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
public class InfRedisMonitorRespVO { public class RedisMonitorRespVO {
@ApiModelProperty(value = "Redis info 指令结果", required = true, notes = "具体字段,查看 Redis 文档") @ApiModelProperty(value = "Redis info 指令结果", required = true, notes = "具体字段,查看 Redis 文档")
private Properties info; private Properties info;

View File

@ -1,29 +1,29 @@
package cn.iocoder.yudao.module.infra.convert.config; package cn.iocoder.yudao.module.infra.convert.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigCreateReqVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigCreateReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigExcelVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigRespVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigUpdateReqVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigUpdateReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface InfConfigConvert { public interface ConfigConvert {
InfConfigConvert INSTANCE = Mappers.getMapper(InfConfigConvert.class); ConfigConvert INSTANCE = Mappers.getMapper(ConfigConvert.class);
PageResult<ConfigRespVO> convertPage(PageResult<InfConfigDO> page); PageResult<ConfigRespVO> convertPage(PageResult<ConfigDO> page);
ConfigRespVO convert(InfConfigDO bean); ConfigRespVO convert(ConfigDO bean);
InfConfigDO convert(ConfigCreateReqVO bean); ConfigDO convert(ConfigCreateReqVO bean);
InfConfigDO convert(ConfigUpdateReqVO bean); ConfigDO convert(ConfigUpdateReqVO bean);
List<ConfigExcelVO> convertList(List<InfConfigDO> list); List<ConfigExcelVO> convertList(List<ConfigDO> list);
} }

View File

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.infra.convert.file;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.FileRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface FileConvert {
FileConvert INSTANCE = Mappers.getMapper(FileConvert.class);
FileRespVO convert(FileDO bean);
PageResult<FileRespVO> convertPage(PageResult<FileDO> page);
}

View File

@ -1,18 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.file;
import cn.iocoder.yudao.coreservice.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface InfFileConvert {
InfFileConvert INSTANCE = Mappers.getMapper(InfFileConvert.class);
InfFileRespVO convert(InfFileDO bean);
PageResult<InfFileRespVO> convertPage(PageResult<InfFileDO> page);
}

View File

@ -1,36 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.job;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobCreateReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobUpdateReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 定时任务 Convert
*
* @author 芋道源码
*/
@Mapper
public interface InfJobConvert {
InfJobConvert INSTANCE = Mappers.getMapper(InfJobConvert.class);
InfJobDO convert(InfJobCreateReqVO bean);
InfJobDO convert(InfJobUpdateReqVO bean);
InfJobRespVO convert(InfJobDO bean);
List<InfJobRespVO> convertList(List<InfJobDO> list);
PageResult<InfJobRespVO> convertPage(PageResult<InfJobDO> page);
List<InfJobExcelVO> convertList02(List<InfJobDO> list);
}

View File

@ -1,30 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.job;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 定时任务日志 Convert
*
* @author 芋艿
*/
@Mapper
public interface InfJobLogConvert {
InfJobLogConvert INSTANCE = Mappers.getMapper(InfJobLogConvert.class);
InfJobLogRespVO convert(InfJobLogDO bean);
List<InfJobLogRespVO> convertList(List<InfJobLogDO> list);
PageResult<InfJobLogRespVO> convertPage(PageResult<InfJobLogDO> page);
List<InfJobLogExcelVO> convertList02(List<InfJobLogDO> list);
}

View File

@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.infra.convert.job;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobCreateReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobUpdateReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 定时任务 Convert
*
* @author 芋道源码
*/
@Mapper
public interface JobConvert {
JobConvert INSTANCE = Mappers.getMapper(JobConvert.class);
JobDO convert(JobCreateReqVO bean);
JobDO convert(JobUpdateReqVO bean);
JobRespVO convert(JobDO bean);
List<JobRespVO> convertList(List<JobDO> list);
PageResult<JobRespVO> convertPage(PageResult<JobDO> page);
List<JobExcelVO> convertList02(List<JobDO> list);
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.infra.convert.job;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 定时任务日志 Convert
*
* @author 芋艿
*/
@Mapper
public interface JobLogConvert {
JobLogConvert INSTANCE = Mappers.getMapper(JobLogConvert.class);
JobLogRespVO convert(JobLogDO bean);
List<JobLogRespVO> convertList(List<JobLogDO> list);
PageResult<JobLogRespVO> convertPage(PageResult<JobLogDO> page);
List<JobLogExcelVO> convertList02(List<JobLogDO> list);
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* API 访问日志 Convert
*
* @author 芋道源码
*/
@Mapper
public interface ApiAccessLogConvert {
ApiAccessLogConvert INSTANCE = Mappers.getMapper(ApiAccessLogConvert.class);
ApiAccessLogRespVO convert(ApiAccessLogDO bean);
List<ApiAccessLogRespVO> convertList(List<ApiAccessLogDO> list);
PageResult<ApiAccessLogRespVO> convertPage(PageResult<ApiAccessLogDO> page);
List<ApiAccessLogExcelVO> convertList02(List<ApiAccessLogDO> list);
ApiAccessLogDO convert(ApiAccessLogCreateReqDTO bean);
}

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* API 错误日志 Convert
*
* @author 芋道源码
*/
@Mapper
public interface ApiErrorLogConvert {
ApiErrorLogConvert INSTANCE = Mappers.getMapper(ApiErrorLogConvert.class);
ApiErrorLogRespVO convert(ApiErrorLogDO bean);
PageResult<ApiErrorLogRespVO> convertPage(PageResult<ApiErrorLogDO> page);
List<ApiErrorLogExcelVO> convertList02(List<ApiErrorLogDO> list);
ApiErrorLogDO convert(ApiErrorLogCreateReqDTO bean);
}

View File

@ -1,30 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogRespVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* API 访问日志 Convert
*
* @author 芋道源码
*/
@Mapper
public interface InfApiAccessLogConvert {
InfApiAccessLogConvert INSTANCE = Mappers.getMapper(InfApiAccessLogConvert.class);
InfApiAccessLogRespVO convert(InfApiAccessLogDO bean);
List<InfApiAccessLogRespVO> convertList(List<InfApiAccessLogDO> list);
PageResult<InfApiAccessLogRespVO> convertPage(PageResult<InfApiAccessLogDO> page);
List<InfApiAccessLogExcelVO> convertList02(List<InfApiAccessLogDO> list);
}

View File

@ -1,15 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface InfApiAccessLogCoreConvert {
InfApiAccessLogCoreConvert INSTANCE = Mappers.getMapper(InfApiAccessLogCoreConvert.class);
InfApiAccessLogDO convert(ApiAccessLogCreateReqDTO bean);
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogExcelVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogRespVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* API 错误日志 Convert
*
* @author 芋道源码
*/
@Mapper
public interface InfApiErrorLogConvert {
InfApiErrorLogConvert INSTANCE = Mappers.getMapper(InfApiErrorLogConvert.class);
InfApiErrorLogRespVO convert(InfApiErrorLogDO bean);
PageResult<InfApiErrorLogRespVO> convertPage(PageResult<InfApiErrorLogDO> page);
List<InfApiErrorLogExcelVO> convertList02(List<InfApiErrorLogDO> list);
}

View File

@ -1,15 +0,0 @@
package cn.iocoder.yudao.module.infra.convert.logger;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface InfApiErrorLogCoreConvert {
InfApiErrorLogCoreConvert INSTANCE = Mappers.getMapper(InfApiErrorLogCoreConvert.class);
InfApiErrorLogDO convert(ApiErrorLogCreateReqDTO bean);
}

View File

@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.convert.redis;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.InfRedisKeyRespVO; import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.InfRedisMonitorRespVO; import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespVO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
@ -16,11 +16,11 @@ public interface RedisConvert {
RedisConvert INSTANCE = Mappers.getMapper(RedisConvert.class); RedisConvert INSTANCE = Mappers.getMapper(RedisConvert.class);
default InfRedisMonitorRespVO build(Properties info, Long dbSize, Properties commandStats) { default RedisMonitorRespVO build(Properties info, Long dbSize, Properties commandStats) {
InfRedisMonitorRespVO respVO = InfRedisMonitorRespVO.builder().info(info).dbSize(dbSize) RedisMonitorRespVO respVO = RedisMonitorRespVO.builder().info(info).dbSize(dbSize)
.commandStats(new ArrayList<>(commandStats.size())).build(); .commandStats(new ArrayList<>(commandStats.size())).build();
commandStats.forEach((key, value) -> { commandStats.forEach((key, value) -> {
respVO.getCommandStats().add(InfRedisMonitorRespVO.CommandStat.builder() respVO.getCommandStats().add(RedisMonitorRespVO.CommandStat.builder()
.command(StrUtil.subAfter((String) key, "cmdstat_", false)) .command(StrUtil.subAfter((String) key, "cmdstat_", false))
.calls(Integer.valueOf(StrUtil.subBetween((String) value, "calls=", ","))) .calls(Integer.valueOf(StrUtil.subBetween((String) value, "calls=", ",")))
.usec(Long.valueOf(StrUtil.subBetween((String) value, "usec=", ","))) .usec(Long.valueOf(StrUtil.subBetween((String) value, "usec=", ",")))
@ -29,6 +29,6 @@ public interface RedisConvert {
return respVO; return respVO;
} }
List<InfRedisKeyRespVO> convertList(List<RedisKeyDefine> list); List<RedisKeyRespVO> convertList(List<RedisKeyDefine> list);
} }

View File

@ -13,11 +13,11 @@ import lombok.ToString;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@TableName("inf_config") @TableName("infra_config")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InfConfigDO extends BaseDO { public class ConfigDO extends BaseDO {
/** /**
* 参数主键 * 参数主键

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.infra.dal.dataobject.file; package cn.iocoder.yudao.module.infra.dal.dataobject.file;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
@ -16,13 +15,13 @@ import java.io.InputStream;
* @author 芋道源码 * @author 芋道源码
*/ */
@Data @Data
@TableName("inf_file") @TableName("infra_file")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InfFileDO extends TenantBaseDO { public class FileDO extends TenantBaseDO {
/** /**
* 文件路径 * 文件路径

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.dal.dataobject.job; package cn.iocoder.yudao.module.infra.dal.dataobject.job;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.infra.enums.job.InfJobStatusEnum; import cn.iocoder.yudao.module.infra.enums.job.JobStatusEnum;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
@ -11,14 +11,14 @@ import lombok.*;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@TableName("inf_job") @TableName("infra_job")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InfJobDO extends BaseDO { public class JobDO extends BaseDO {
/** /**
* 任务编号 * 任务编号
@ -32,7 +32,7 @@ public class InfJobDO extends BaseDO {
/** /**
* 任务状态 * 任务状态
* *
* 枚举 {@link InfJobStatusEnum} * 枚举 {@link JobStatusEnum}
*/ */
private Integer status; private Integer status;
/** /**

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.dal.dataobject.job;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.module.infra.enums.job.InfJobLogStatusEnum; import cn.iocoder.yudao.module.infra.enums.job.JobLogStatusEnum;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
@ -13,14 +13,14 @@ import java.util.Date;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@TableName("inf_job_log") @TableName("infra_job_log")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InfJobLogDO extends BaseDO { public class JobLogDO extends BaseDO {
/** /**
* 日志编号 * 日志编号
@ -29,19 +29,19 @@ public class InfJobLogDO extends BaseDO {
/** /**
* 任务编号 * 任务编号
* *
* 关联 {@link InfJobDO#getId()} * 关联 {@link JobDO#getId()}
*/ */
private Long jobId; private Long jobId;
/** /**
* 处理器的名字 * 处理器的名字
* *
* 冗余字段 {@link InfJobDO#getHandlerName()} * 冗余字段 {@link JobDO#getHandlerName()}
*/ */
private String handlerName; private String handlerName;
/** /**
* 处理器的参数 * 处理器的参数
* *
* 冗余字段 {@link InfJobDO#getHandlerParam()} * 冗余字段 {@link JobDO#getHandlerParam()}
*/ */
private String handlerParam; private String handlerParam;
/** /**
@ -66,7 +66,7 @@ public class InfJobLogDO extends BaseDO {
/** /**
* 状态 * 状态
* *
* 枚举 {@link InfJobLogStatusEnum} * 枚举 {@link JobLogStatusEnum}
*/ */
private Integer status; private Integer status;
/** /**

View File

@ -14,14 +14,14 @@ import java.util.Date;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@TableName("inf_api_access_log") @TableName("infra_api_access_log")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InfApiAccessLogDO extends TenantBaseDO { public class ApiAccessLogDO extends TenantBaseDO {
/** /**
* 编号 * 编号

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.infra.dal.dataobject.logger; package cn.iocoder.yudao.module.infra.dal.dataobject.logger;
import cn.iocoder.yudao.coreservice.modules.infra.enums.logger.InfApiErrorLogProcessStatusEnum;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
@ -14,14 +13,14 @@ import java.util.Date;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@TableName("inf_api_error_log") @TableName("infra_api_error_log")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InfApiErrorLogDO extends TenantBaseDO { public class ApiErrorLogDO extends TenantBaseDO {
/** /**
* 编号 * 编号

View File

@ -16,11 +16,11 @@ import java.util.List;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
public class InfConfigCoreDAOImpl implements ConfigFrameworkDAO { public class ConfigCoreDAOImpl implements ConfigFrameworkDAO {
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;
public InfConfigCoreDAOImpl(String jdbcUrl, String username, String password) { public ConfigCoreDAOImpl(String jdbcUrl, String username, String password) {
DataSource dataSource = new DriverManagerDataSource(jdbcUrl, username, password); DataSource dataSource = new DriverManagerDataSource(jdbcUrl, username, password);
this.jdbcTemplate = new JdbcTemplate(dataSource); this.jdbcTemplate = new JdbcTemplate(dataSource);
} }

View File

@ -1,33 +1,33 @@
package cn.iocoder.yudao.module.infra.dal.mysql.config; package cn.iocoder.yudao.module.infra.dal.mysql.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface InfConfigMapper extends BaseMapperX<InfConfigDO> { public interface ConfigMapper extends BaseMapperX<ConfigDO> {
default InfConfigDO selectByKey(String key) { default ConfigDO selectByKey(String key) {
return selectOne(new QueryWrapper<InfConfigDO>().eq("`key`", key)); return selectOne(new QueryWrapper<ConfigDO>().eq("`key`", key));
} }
default PageResult<InfConfigDO> selectPage(ConfigPageReqVO reqVO) { default PageResult<ConfigDO> selectPage(ConfigPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfConfigDO>() return selectPage(reqVO, new QueryWrapperX<ConfigDO>()
.likeIfPresent("name", reqVO.getName()) .likeIfPresent("name", reqVO.getName())
.likeIfPresent("`key`", reqVO.getKey()) .likeIfPresent("`key`", reqVO.getKey())
.eqIfPresent("`type`", reqVO.getType()) .eqIfPresent("`type`", reqVO.getType())
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime())); .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
} }
default List<InfConfigDO> selectList(ConfigExportReqVO reqVO) { default List<ConfigDO> selectList(ConfigExportReqVO reqVO) {
return selectList(new QueryWrapperX<InfConfigDO>() return selectList(new QueryWrapperX<ConfigDO>()
.likeIfPresent("name", reqVO.getName()) .likeIfPresent("name", reqVO.getName())
.likeIfPresent("`key`", reqVO.getKey()) .likeIfPresent("`key`", reqVO.getKey())
.eqIfPresent("`type`", reqVO.getType()) .eqIfPresent("`type`", reqVO.getType())

View File

@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.infra.dal.mysql.file;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.FilePageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
/**
* 文件操作 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface FileMapper extends BaseMapperX<FileDO> {
default PageResult<FileDO> selectPage(FilePageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<FileDO>()
.likeIfPresent("id", reqVO.getId())
.likeIfPresent("type", reqVO.getType())
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc("create_time"));
}
default Integer selectCountById(String id) {
return selectCount(FileDO::getId, id);
}
/**
* 基于 Path 获取文件
* 实际上是基于 ID 查询
* 由于前端使用 <img /> 的方式获取图片所以需要忽略租户的查询
*
* @param path 路径
* @return 文件
*/
@InterceptorIgnore(tenantLine = "true")
default FileDO selectByPath(String path) {
return selectById(path);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.infra.dal.mysql.file;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface InfFileCoreMapper extends BaseMapperX<InfFileDO> {
default Integer selectCountById(String id) {
return selectCount(InfFileDO::getId, id);
}
/**
* 基于 Path 获取文件
* 实际上是基于 ID 查询
* 由于前端使用 <img /> 的方式获取图片所以需要忽略租户的查询
*
* @param path 路径
* @return 文件
*/
@InterceptorIgnore(tenantLine = "true")
default InfFileDO selectByPath(String path) {
return selectById(path);
}
}

View File

@ -1,24 +0,0 @@
package cn.iocoder.yudao.module.infra.dal.mysql.file;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import org.apache.ibatis.annotations.Mapper;
/**
* admin 文件操作 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface InfFileMapper extends BaseMapperX<InfFileDO> {
default PageResult<InfFileDO> selectPage(InfFilePageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfFileDO>()
.likeIfPresent("id", reqVO.getId())
.likeIfPresent("type", reqVO.getType())
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc("create_time"));
}
}

View File

@ -1,41 +0,0 @@
package cn.iocoder.yudao.module.infra.dal.mysql.job;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.InfJobPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 定时任务 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface InfJobMapper extends BaseMapperX<InfJobDO> {
default InfJobDO selectByHandlerName(String handlerName) {
return selectOne(InfJobDO::getHandlerName, handlerName);
}
default PageResult<InfJobDO> selectPage(InfJobPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<InfJobDO>()
.likeIfPresent(InfJobDO::getName, reqVO.getName())
.eqIfPresent(InfJobDO::getStatus, reqVO.getStatus())
.likeIfPresent(InfJobDO::getHandlerName, reqVO.getHandlerName())
);
}
default List<InfJobDO> selectList(InfJobExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<InfJobDO>()
.likeIfPresent(InfJobDO::getName, reqVO.getName())
.eqIfPresent(InfJobDO::getStatus, reqVO.getStatus())
.likeIfPresent(InfJobDO::getHandlerName, reqVO.getHandlerName())
);
}
}

View File

@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.infra.dal.mysql.job;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.InfJobLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.InfJobLogDO; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -16,10 +16,10 @@ import java.util.List;
* @author 芋道源码 * @author 芋道源码
*/ */
@Mapper @Mapper
public interface InfJobLogMapper extends BaseMapperX<InfJobLogDO> { public interface JobLogMapper extends BaseMapperX<JobLogDO> {
default PageResult<InfJobLogDO> selectPage(InfJobLogPageReqVO reqVO) { default PageResult<JobLogDO> selectPage(JobLogPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfJobLogDO>() return selectPage(reqVO, new QueryWrapperX<JobLogDO>()
.eqIfPresent("job_id", reqVO.getJobId()) .eqIfPresent("job_id", reqVO.getJobId())
.likeIfPresent("handler_name", reqVO.getHandlerName()) .likeIfPresent("handler_name", reqVO.getHandlerName())
.geIfPresent("begin_time", reqVO.getBeginTime()) .geIfPresent("begin_time", reqVO.getBeginTime())
@ -29,8 +29,8 @@ public interface InfJobLogMapper extends BaseMapperX<InfJobLogDO> {
); );
} }
default List<InfJobLogDO> selectList(InfJobLogExportReqVO reqVO) { default List<JobLogDO> selectList(JobLogExportReqVO reqVO) {
return selectList(new QueryWrapperX<InfJobLogDO>() return selectList(new QueryWrapperX<JobLogDO>()
.eqIfPresent("job_id", reqVO.getJobId()) .eqIfPresent("job_id", reqVO.getJobId())
.likeIfPresent("handler_name", reqVO.getHandlerName()) .likeIfPresent("handler_name", reqVO.getHandlerName())
.geIfPresent("begin_time", reqVO.getBeginTime()) .geIfPresent("begin_time", reqVO.getBeginTime())

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.infra.dal.mysql.job;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 定时任务 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface JobMapper extends BaseMapperX<JobDO> {
default JobDO selectByHandlerName(String handlerName) {
return selectOne(JobDO::getHandlerName, handlerName);
}
default PageResult<JobDO> selectPage(JobPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<JobDO>()
.likeIfPresent(JobDO::getName, reqVO.getName())
.eqIfPresent(JobDO::getStatus, reqVO.getStatus())
.likeIfPresent(JobDO::getHandlerName, reqVO.getHandlerName())
);
}
default List<JobDO> selectList(JobExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<JobDO>()
.likeIfPresent(JobDO::getName, reqVO.getName())
.eqIfPresent(JobDO::getStatus, reqVO.getStatus())
.likeIfPresent(JobDO::getHandlerName, reqVO.getHandlerName())
);
}
}

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.infra.dal.mysql.logger; package cn.iocoder.yudao.module.infra.dal.mysql.logger;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -16,10 +16,10 @@ import java.util.List;
* @author 芋道源码 * @author 芋道源码
*/ */
@Mapper @Mapper
public interface InfApiAccessLogMapper extends BaseMapperX<InfApiAccessLogDO> { public interface ApiAccessLogMapper extends BaseMapperX<ApiAccessLogDO> {
default PageResult<InfApiAccessLogDO> selectPage(InfApiAccessLogPageReqVO reqVO) { default PageResult<ApiAccessLogDO> selectPage(ApiAccessLogPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfApiAccessLogDO>() return selectPage(reqVO, new QueryWrapperX<ApiAccessLogDO>()
.eqIfPresent("user_id", reqVO.getUserId()) .eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType()) .eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName()) .eqIfPresent("application_name", reqVO.getApplicationName())
@ -31,8 +31,8 @@ public interface InfApiAccessLogMapper extends BaseMapperX<InfApiAccessLogDO> {
); );
} }
default List<InfApiAccessLogDO> selectList(InfApiAccessLogExportReqVO reqVO) { default List<ApiAccessLogDO> selectList(ApiAccessLogExportReqVO reqVO) {
return selectList(new QueryWrapperX<InfApiAccessLogDO>() return selectList(new QueryWrapperX<ApiAccessLogDO>()
.eqIfPresent("user_id", reqVO.getUserId()) .eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType()) .eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName()) .eqIfPresent("application_name", reqVO.getApplicationName())

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.infra.dal.mysql.logger; package cn.iocoder.yudao.module.infra.dal.mysql.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.InfApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -16,10 +16,10 @@ import java.util.List;
* @author 芋道源码 * @author 芋道源码
*/ */
@Mapper @Mapper
public interface InfApiErrorLogMapper extends BaseMapperX<InfApiErrorLogDO> { public interface ApiErrorLogMapper extends BaseMapperX<ApiErrorLogDO> {
default PageResult<InfApiErrorLogDO> selectPage(InfApiErrorLogPageReqVO reqVO) { default PageResult<ApiErrorLogDO> selectPage(ApiErrorLogPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfApiErrorLogDO>() return selectPage(reqVO, new QueryWrapperX<ApiErrorLogDO>()
.eqIfPresent("user_id", reqVO.getUserId()) .eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType()) .eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName()) .eqIfPresent("application_name", reqVO.getApplicationName())
@ -30,8 +30,8 @@ public interface InfApiErrorLogMapper extends BaseMapperX<InfApiErrorLogDO> {
); );
} }
default List<InfApiErrorLogDO> selectList(InfApiErrorLogExportReqVO reqVO) { default List<ApiErrorLogDO> selectList(ApiErrorLogExportReqVO reqVO) {
return selectList(new QueryWrapperX<InfApiErrorLogDO>() return selectList(new QueryWrapperX<ApiErrorLogDO>()
.eqIfPresent("user_id", reqVO.getUserId()) .eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType()) .eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName()) .eqIfPresent("application_name", reqVO.getApplicationName())

View File

@ -1,14 +0,0 @@
package cn.iocoder.yudao.module.infra.dal.mysql.logger;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import org.apache.ibatis.annotations.Mapper;
/**
* API 访问日志 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface InfApiAccessLogCoreMapper extends BaseMapperX<InfApiAccessLogDO> {
}

View File

@ -1,9 +0,0 @@
package cn.iocoder.yudao.module.infra.dal.mysql.logger;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface InfApiErrorLogCoreMapper extends BaseMapperX<InfApiErrorLogDO> {
}

View File

@ -1,16 +0,0 @@
package cn.iocoder.yudao.module.infra.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* System 错误码枚举类
*
* system 系统使用 1-006-000-000
*/
public interface SysErrorCodeConstants {
// ========= 文件相关 1006001000=================
ErrorCode FILE_PATH_EXISTS = new ErrorCode(1006001000, "文件路径已存在");
ErrorCode FILE_NOT_EXISTS = new ErrorCode(1006001002, "文件不存在");
}

View File

@ -5,7 +5,7 @@ import lombok.Getter;
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum InfConfigTypeEnum { public enum ConfigTypeEnum {
/** /**
* 系统配置 * 系统配置

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