mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 04:25:06 +08:00
解决 db doc 导出的报错问题
This commit is contained in:
@ -44,28 +44,31 @@ public class InfDbDocController {
|
||||
|
||||
@GetMapping("/export-html")
|
||||
public synchronized void exportHtml(HttpServletResponse response) throws FileNotFoundException {
|
||||
// 创建 screw 的配置
|
||||
Configuration config = Configuration.builder()
|
||||
.version(DOC_VERSION) // 版本
|
||||
.description(DOC_DESCRIPTION) // 描述
|
||||
.dataSource(buildDataSource()) // 数据源
|
||||
.engineConfig(buildEngineConfig()) // 引擎配置
|
||||
.produceConfig(buildProcessConfig()) // 处理配置
|
||||
.build();
|
||||
try (HikariDataSource dataSource = buildDataSource()) {
|
||||
// 创建 screw 的配置
|
||||
Configuration config = Configuration.builder()
|
||||
.version(DOC_VERSION) // 版本
|
||||
.description(DOC_DESCRIPTION) // 描述
|
||||
.dataSource(dataSource) // 数据源
|
||||
.engineConfig(buildEngineConfig()) // 引擎配置
|
||||
.produceConfig(buildProcessConfig()) // 处理配置
|
||||
.build();
|
||||
|
||||
// 执行 screw,生成数据库文档
|
||||
new DocumentationExecute(config).execute();
|
||||
// 执行 screw,生成数据库文档
|
||||
new DocumentationExecute(config).execute();
|
||||
|
||||
// 读取,返回
|
||||
ServletUtil.write(response,
|
||||
new FileInputStream(FILE_OUTPUT_DIR + File.separator + DOC_FILE_NAME + FILE_OUTPUT_TYPE.getFileSuffix()),
|
||||
MediaType.TEXT_HTML_VALUE);
|
||||
// 读取,返回
|
||||
ServletUtil.write(response,
|
||||
new FileInputStream(FILE_OUTPUT_DIR + File.separator + DOC_FILE_NAME + FILE_OUTPUT_TYPE.getFileSuffix()),
|
||||
MediaType.TEXT_HTML_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据源
|
||||
*/
|
||||
private DataSource buildDataSource() {
|
||||
// TODO 芋艿:screw 暂时不支持 druid,尴尬
|
||||
private HikariDataSource buildDataSource() {
|
||||
// 创建 HikariConfig 配置类
|
||||
HikariConfig hikariConfig = new HikariConfig();
|
||||
// hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
|
||||
|
@ -5,10 +5,9 @@ import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLogi
|
||||
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert;
|
||||
import cn.iocoder.dashboard.modules.system.dal.mysql.logger.SysLoginLogMapper;
|
||||
import cn.iocoder.dashboard.modules.system.dal.dataobject.logger.SysLoginLogDO;
|
||||
import cn.iocoder.dashboard.modules.system.dal.mysql.logger.SysLoginLogMapper;
|
||||
import cn.iocoder.dashboard.modules.system.service.logger.SysLoginLogService;
|
||||
import cn.iocoder.dashboard.modules.system.service.user.SysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -23,9 +22,6 @@ public class SysLoginLogServiceImpl implements SysLoginLogService {
|
||||
@Resource
|
||||
private SysLoginLogMapper loginLogMapper;
|
||||
|
||||
@Resource
|
||||
private SysUserService userService;
|
||||
|
||||
@Override
|
||||
public void createLoginLog(SysLoginLogCreateReqVO reqVO) {
|
||||
SysLoginLogDO loginLog = SysLoginLogConvert.INSTANCE.convert(reqVO);
|
||||
|
Reference in New Issue
Block a user