Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 50773f20
authored
Jan 07, 2026
by
gonglei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
加入框架代码
1 parent
c03823ff
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
63 deletions
aus-admin/build.gradle
aus-api/build.gradle
aus-config/src/main/resources/config/common-dev.yaml
aus-framework/build.gradle
aus-framework/src/main/java/org/summerframework/storage/platform/AbstractStorageService.java
aus-framework/src/main/java/org/summerframework/storage/platform/LocalFileService.java
aus-task/build.gradle
aus-admin/build.gradle
View file @
50773f2
...
...
@@ -45,8 +45,6 @@ dependencies {
annotationProcessor
'org.springframework.boot:spring-boot-configuration-processor'
testImplementation
(
'org.springframework.boot:spring-boot-starter-test'
)
testRuntimeOnly
'org.junit.platform:junit-platform-launcher'
implementation
'com.aspose:aspose-words:25.2:jdk17'
implementation
'com.aspose:aspose-cells:24.2'
// 排除 slf4j-simple,如果被其他库引入
configurations
.
all
{
exclude
group:
'org.slf4j'
,
module:
'slf4j-simple'
...
...
aus-api/build.gradle
View file @
50773f2
...
...
@@ -43,8 +43,6 @@ dependencies {
implementation
'io.github.swalikh:wework-wehook-starter:1.0.0'
runtimeOnly
'com.mysql:mysql-connector-j'
compileOnly
(
"org.projectlombok:lombok"
)
implementation
'com.aspose:aspose-words:25.2:jdk17'
implementation
'com.aspose:aspose-cells:24.2'
// implementation 'redis.clients:jedis:3.3.0'
// implementation 'com.github.jedis-lock:jedis-lock:1.0.0'
...
...
aus-config/src/main/resources/config/common-dev.yaml
View file @
50773f2
...
...
@@ -68,9 +68,9 @@ spring:
data
:
redis
:
database
:
6
host
:
localhost
port
:
6379
password
:
host
:
120.237.107.125
port
:
1
6379
password
:
Ml1234..
# 连接超时时间 单位 ms(毫秒)
timeout
:
3000ms
jedis
:
...
...
aus-framework/build.gradle
View file @
50773f2
...
...
@@ -41,8 +41,6 @@ dependencies {
implementation
'org.apache.poi:poi:5.4.0'
implementation
'org.apache.poi:poi-ooxml:5.4.0'
implementation
'org.apache.poi:poi-scratchpad:5.4.0'
compileOnly
'com.aspose:aspose-words:25.2:jdk17'
compileOnly
'com.aspose:aspose-cells:24.2'
// 滑动验证码
implementation
'cloud.tianai.captcha:tianai-captcha-springboot-starter:1.4.1'
compileOnly
'org.projectlombok:lombok'
...
...
aus-framework/src/main/java/org/summerframework/storage/platform/AbstractStorageService.java
View file @
50773f2
package
org
.
summerframework
.
storage
.
platform
;
import
com.aspose.cells.*
;
import
com.aspose.words.*
;
import
com.aspose.words.ImageSaveOptions
;
import
com.aspose.words.ImageType
;
import
com.aspose.words.SaveFormat
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -189,26 +185,6 @@ public abstract class AbstractStorageService implements StorageService {
}
protected
void
thumbWord
(
String
sourceFilePath
,
String
targetFilePath
)
throws
Exception
{
// 加载 Word 文档
Document
doc
=
new
Document
(
sourceFilePath
);
// 渲染第一页为图片
ImageSaveOptions
options
=
new
ImageSaveOptions
(
SaveFormat
.
PNG
);
// 从第0页开始 仅渲染一页
options
.
setPageSet
(
new
PageSet
(
0
,
1
));
// 分辨率
options
.
setResolution
(
150
);
String
outputImagePath
=
sourceFilePath
.
substring
(
0
,
sourceFilePath
.
lastIndexOf
(
"."
))
+
".png"
;
doc
.
save
(
outputImagePath
,
options
);
// 生成缩略图(可选)
File
outputImageFile
=
new
File
(
outputImagePath
);
BufferedImage
image
=
ImageIO
.
read
(
outputImageFile
);
BufferedImage
thumbnail
=
resizeImage
(
image
,
thumbnailsWidth
,
thumbnailsHeight
);
// 你可以指定缩略图大小
ImageIO
.
write
(
thumbnail
,
"png"
,
new
File
(
targetFilePath
));
outputImageFile
.
delete
();
}
protected
void
thumbPdf
(
String
sourceFilePath
,
String
targetFilePath
)
throws
IOException
{
// 加载 PDF 文件
FileInputStream
file
=
new
FileInputStream
(
sourceFilePath
);
...
...
@@ -227,30 +203,6 @@ public abstract class AbstractStorageService implements StorageService {
document
.
close
();
}
protected
void
thumbExcel
(
String
sourceFilePath
,
String
targetFilePath
)
throws
Exception
{
// 加载 Excel 文件
Workbook
workbook
=
new
Workbook
(
sourceFilePath
);
// 获取第一个工作表
Worksheet
sheet
=
workbook
.
getWorksheets
().
get
(
0
);
// 渲染选项
ImageOrPrintOptions
options
=
new
ImageOrPrintOptions
();
options
.
setImageType
(
ImageType
.
PNG
);
options
.
setOnePagePerSheet
(
true
);
// 将整张表渲染为一页
options
.
setOnlyArea
(
false
);
// 如果只想渲染有内容的区域,设置为 true
options
.
setPrintingPage
(
PrintingPageType
.
DEFAULT
);
// 渲染器
SheetRender
render
=
new
SheetRender
(
sheet
,
options
);
String
outputImagePath
=
sourceFilePath
.
substring
(
0
,
sourceFilePath
.
lastIndexOf
(
"."
))
+
".png"
;
// 渲染第一页(通常每个 sheet 只有一页)
render
.
toImage
(
0
,
outputImagePath
);
// 生成缩略图(可选)
File
outputImageFile
=
new
File
(
outputImagePath
);
BufferedImage
image
=
ImageIO
.
read
(
outputImageFile
);
BufferedImage
thumbnail
=
resizeImage
(
image
,
thumbnailsWidth
,
thumbnailsHeight
);
// 你可以指定缩略图大小
ImageIO
.
write
(
thumbnail
,
"png"
,
new
File
(
targetFilePath
));
outputImageFile
.
delete
();
}
protected
void
thumbPpt
(
String
sourceFilePath
,
String
targetFilePath
)
throws
IOException
{
// 1. 加载 PPTX 文件
...
...
aus-framework/src/main/java/org/summerframework/storage/platform/LocalFileService.java
View file @
50773f2
...
...
@@ -202,7 +202,7 @@ public class LocalFileService extends AbstractStorageService implements StorageS
@Override
public
void
removeFileInfo
(
@Nullable
FileInfo
fileInfo
)
{
if
(
Objects
.
nonNull
(
fileInfo
))
{
if
(
Objects
.
nonNull
(
fileInfo
))
{
removeFile
(
fileInfo
.
getFilePath
());
}
}
...
...
@@ -318,9 +318,7 @@ public class LocalFileService extends AbstractStorageService implements StorageS
thumbPath
=
thumbDir
+
this
.
getRandomFileName
(
filename
);
Thumbnails
.
of
(
sourceFile
).
size
(
thumbnailsWidth
,
thumbnailsHeight
).
crop
(
Positions
.
CENTER
).
toFile
(
absoluteDir
+
thumbPath
);
}
else
if
(
"doc"
.
equals
(
suffix
)
||
"docx"
.
equals
(
suffix
))
{
thumbWord
(
sourceFile
.
getAbsolutePath
(),
absoluteDir
+
thumbPath
);
}
else
if
(
"xls"
.
equals
(
suffix
)
||
"xlsx"
.
equals
(
suffix
))
{
thumbExcel
(
sourceFile
.
getAbsolutePath
(),
absoluteDir
+
thumbPath
);
}
else
if
(
"ppt"
.
equals
(
suffix
)
||
"pptx"
.
equals
(
suffix
))
{
thumbPpt
(
sourceFile
.
getAbsolutePath
(),
absoluteDir
+
thumbPath
);
}
else
if
(
"pdf"
.
equals
(
suffix
))
{
...
...
aus-task/build.gradle
View file @
50773f2
...
...
@@ -42,8 +42,6 @@ dependencies {
annotationProcessor
'org.springframework.boot:spring-boot-configuration-processor'
testImplementation
(
'org.springframework.boot:spring-boot-starter-test'
)
testRuntimeOnly
'org.junit.platform:junit-platform-launcher'
implementation
'com.aspose:aspose-words:25.2:jdk17'
implementation
'com.aspose:aspose-cells:24.2'
// 排除 slf4j-simple,如果被其他库引入
configurations
.
all
{
exclude
group:
'org.slf4j'
,
module:
'slf4j-simple'
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment