Raod 3 years ago
parent ccdfa7bdf3
commit cc72c468bd

@ -65,14 +65,14 @@
<version>2.10.6</version> <version>2.10.6</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.anji-plus</groupId> <!-- <groupId>com.anji-plus</groupId>-->
<artifactId>spring-boot-starter-gaea-export</artifactId> <!-- <artifactId>spring-boot-starter-gaea-export</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.anji-plus</groupId> <!-- <groupId>com.anji-plus</groupId>-->
<artifactId>spring-boot-starter-gaea-log</artifactId> <!-- <artifactId>spring-boot-starter-gaea-log</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.flywaydb</groupId> <groupId>org.flywaydb</groupId>
@ -81,18 +81,6 @@
</dependency> </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid</artifactId>

@ -1,15 +1,15 @@
package com.anjiplus.template.gaea.business.modules.file.service.impl; package com.anjiplus.template.gaea.business.modules.file.service.impl;
import com.alibaba.excel.util.FileUtils;
import com.anji.plus.gaea.constant.BaseOperationEnum; import com.anji.plus.gaea.constant.BaseOperationEnum;
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper; import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
import com.anji.plus.gaea.exception.BusinessException; import com.anji.plus.gaea.exception.BusinessException;
import com.anji.plus.gaea.exception.BusinessExceptionBuilder; import com.anji.plus.gaea.exception.BusinessExceptionBuilder;
import com.anjiplus.template.gaea.business.modules.file.util.StringPatternUtil;
import com.anjiplus.template.gaea.business.code.ResponseCode; import com.anjiplus.template.gaea.business.code.ResponseCode;
import com.anjiplus.template.gaea.business.modules.file.dao.GaeaFileMapper; import com.anjiplus.template.gaea.business.modules.file.dao.GaeaFileMapper;
import com.anjiplus.template.gaea.business.modules.file.entity.GaeaFile; import com.anjiplus.template.gaea.business.modules.file.entity.GaeaFile;
import com.anjiplus.template.gaea.business.modules.file.service.GaeaFileService; import com.anjiplus.template.gaea.business.modules.file.service.GaeaFileService;
import com.anjiplus.template.gaea.business.modules.file.util.FileUtils;
import com.anjiplus.template.gaea.business.modules.file.util.StringPatternUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

@ -0,0 +1,31 @@
package com.anjiplus.template.gaea.business.modules.file.util;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
/**
* Created by raodeming on 2021/7/8.
*/
@Slf4j
public class FileUtils {
public static byte[] readFileToByteArray(File file) {
byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (IOException e) {
log.error("{}", e);
}
return buffer;
}
}

@ -42,6 +42,8 @@ spring:
user: ${spring.datasource.username} user: ${spring.datasource.username}
password: ${spring.datasource.password} password: ${spring.datasource.password}
placeholder-replacement: false placeholder-replacement: false
init-sqls:
- CREATE DATABASE IF NOT EXISTS `aj_report` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
generator: generator:
enabled: true enabled: true
workspace: /workspace/gaea workspace: /workspace/gaea

Loading…
Cancel
Save