多模块重构 5:infra 模块的修改~~~
parent
dc11dfc215
commit
9bc9b2ac6b
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
package cn.iocoder.yudao.coreservice.modules.infra.service;
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
package cn.iocoder.yudao.module.infra.api;
|
||||
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogBaseVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogBaseVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogExcelVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExcelVO.java
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogExcelVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExcelVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogExportReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogExportReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogPageReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogPageReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogRespVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/InfApiAccessLogRespVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogBaseVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java
2
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogBaseVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java
5
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogExcelVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExcelVO.java
5
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogExcelVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExcelVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogExportReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogExportReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogPageReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogPageReqVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogRespVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
4
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/InfApiErrorLogRespVO.java → yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
@ -1,7 +1,9 @@
|
||||
### 请求 /infra/redis/get-monitor-info 接口 => 成功
|
||||
GET {{baseUrl}}/infra/redis/get-monitor-info
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
### 请求 /infra/redis/get-key-list 接口 => 成功
|
||||
GET {{baseUrl}}/infra/redis/get-key-list
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
@ -1,29 +1,29 @@
|
||||
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.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.ConfigRespVO;
|
||||
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.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -1,33 +1,33 @@
|
||||
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.mybatis.core.mapper.BaseMapperX;
|
||||
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.ConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface InfConfigMapper extends BaseMapperX<InfConfigDO> {
|
||||
public interface ConfigMapper extends BaseMapperX<ConfigDO> {
|
||||
|
||||
default InfConfigDO selectByKey(String key) {
|
||||
return selectOne(new QueryWrapper<InfConfigDO>().eq("`key`", key));
|
||||
default ConfigDO selectByKey(String key) {
|
||||
return selectOne(new QueryWrapper<ConfigDO>().eq("`key`", key));
|
||||
}
|
||||
|
||||
default PageResult<InfConfigDO> selectPage(ConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<InfConfigDO>()
|
||||
default PageResult<ConfigDO> selectPage(ConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<ConfigDO>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.likeIfPresent("`key`", reqVO.getKey())
|
||||
.eqIfPresent("`type`", reqVO.getType())
|
||||
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
|
||||
}
|
||||
|
||||
default List<InfConfigDO> selectList(ConfigExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<InfConfigDO>()
|
||||
default List<ConfigDO> selectList(ConfigExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<ConfigDO>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.likeIfPresent("`key`", reqVO.getKey())
|
||||
.eqIfPresent("`type`", reqVO.getType())
|
||||
@ -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"));
|
||||
}
|
||||
}
|
||||
@ -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())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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> {
|
||||
}
|
||||
@ -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> {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue