Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
ed80e0db
提交
ed80e0db
authored
5月 23, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
oss(upload)
上级
a7c667a7
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
777 行增加
和
1 行删除
+777
-1
pom.xml
pom.xml
+15
-1
PartUploadController.java
...ain/java/com/mmc/pms/controller/PartUploadController.java
+0
-0
UploadController.java
src/main/java/com/mmc/pms/controller/UploadController.java
+0
-0
JsonUtil.java
src/main/java/com/mmc/pms/json/JsonUtil.java
+119
-0
RedisConstant.java
src/main/java/com/mmc/pms/redis/RedisConstant.java
+205
-0
FileLoadUtil.java
src/main/java/com/mmc/pms/util/FileLoadUtil.java
+241
-0
FileServletConstant.java
src/main/java/com/mmc/pms/util/FileServletConstant.java
+28
-0
FileTypeConstant.java
src/main/java/com/mmc/pms/util/FileTypeConstant.java
+84
-0
OssConstant.java
src/main/java/com/mmc/pms/util/OssConstant.java
+26
-0
PartUploadInfo.java
src/main/java/com/mmc/pms/util/PartUploadInfo.java
+20
-0
TDateUtil.java
src/main/java/com/mmc/pms/util/TDateUtil.java
+0
-0
application-dev.yml
src/main/resources/application-dev.yml
+13
-0
application-local.yml
src/main/resources/application-local.yml
+13
-0
application-prod.yml
src/main/resources/application-prod.yml
+13
-0
没有找到文件。
pom.xml
浏览文件 @
ed80e0db
...
@@ -96,13 +96,27 @@
...
@@ -96,13 +96,27 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.10.2
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.70
</version>
</dependency>
<!--swagger-->
<!--swagger-->
<dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
3.0.2
</version>
<version>
3.0.2
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.taobao.arthas
</groupId>
<artifactId>
arthas-spring-boot-starter
</artifactId>
<version>
3.6.3
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.deepoove
</groupId>
<groupId>
com.deepoove
</groupId>
<artifactId>
poi-tl
</artifactId>
<artifactId>
poi-tl
</artifactId>
...
...
src/main/java/com/mmc/pms/controller/PartUploadController.java
0 → 100644
浏览文件 @
ed80e0db
差异被折叠。
点击展开。
src/main/java/com/mmc/pms/controller/UploadController.java
0 → 100644
浏览文件 @
ed80e0db
差异被折叠。
点击展开。
src/main/java/com/mmc/pms/json/JsonUtil.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
json
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
java.io.*
;
import
java.util.List
;
/**
* @Author small @Date 2023/5/23 13:50 @Version 1.0
*/
public
class
JsonUtil
{
public
static
void
main
(
String
[]
args
)
{
String
array
=
"[1,24,23]"
;
List
<
Integer
>
list
=
JSONArray
.
parseArray
(
array
,
Integer
.
class
);
System
.
out
.
println
(
list
.
get
(
2
));
}
/**
* 把Java对象转换成json字符串
*
* @param object 待转化为JSON字符串的Java对象
* @return json 串 or null
*/
public
static
String
parseObjToJson
(
Object
object
)
{
String
string
=
null
;
try
{
string
=
JSONObject
.
toJSONString
(
object
);
}
catch
(
Exception
e
)
{
// LOGGER.error(e.getMessage());
}
return
string
;
}
/**
* 将Json字符串信息转换成对应的Java对象
*
* @param json json字符串对象
* @param c 对应的类型
*/
public
static
<
T
>
T
parseJsonToObj
(
String
json
,
Class
<
T
>
c
)
{
try
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
json
);
return
JSON
.
toJavaObject
(
jsonObject
,
c
);
}
catch
(
Exception
e
)
{
// LOGGER.error(e.getMessage());
}
return
null
;
}
/**
* 读取json文件
*
* @param fileName
* @return
*/
public
static
String
readJsonFile
(
String
fileName
)
{
String
jsonStr
=
""
;
try
{
File
jsonFile
=
new
File
(
fileName
);
FileReader
fileReader
=
new
FileReader
(
jsonFile
);
Reader
reader
=
new
InputStreamReader
(
new
FileInputStream
(
jsonFile
),
"utf-8"
);
int
ch
=
0
;
StringBuffer
sb
=
new
StringBuffer
();
while
((
ch
=
reader
.
read
())
!=
-
1
)
{
sb
.
append
((
char
)
ch
);
}
fileReader
.
close
();
reader
.
close
();
jsonStr
=
sb
.
toString
();
return
jsonStr
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* 将JSON数据格式化并保存到文件中
*
* @param jsonData 需要输出的json数
* @param filePath 输出的文件地址
* @return
*/
public
static
boolean
createJsonFile
(
Object
jsonData
,
String
filePath
)
{
String
content
=
JSON
.
toJSONString
(
jsonData
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
WriteDateUseDateFormat
);
// 标记文件生成是否成功
boolean
flag
=
true
;
// 生成json格式文件
try
{
// 保证创建一个新文件
File
file
=
new
File
(
filePath
);
if
(!
file
.
getParentFile
().
exists
())
{
// 如果父目录不存在,创建父目录
file
.
getParentFile
().
mkdirs
();
}
if
(
file
.
exists
())
{
// 如果已存在,删除旧文件
file
.
delete
();
}
file
.
createNewFile
();
// 将格式化后的字符串写入文件
Writer
write
=
new
OutputStreamWriter
(
new
FileOutputStream
(
file
),
"UTF-8"
);
write
.
write
(
content
);
write
.
flush
();
write
.
close
();
}
catch
(
Exception
e
)
{
flag
=
false
;
e
.
printStackTrace
();
}
return
flag
;
}
}
src/main/java/com/mmc/pms/redis/RedisConstant.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
redis
;
/**
* @Author small @Date 2023/5/23 13:49 @Version 1.0
*/
public
class
RedisConstant
{
/** 验证码-key */
public
static
final
String
VERIFYCODEKEY
=
"verifyCode"
;
/** 电话号码-key */
public
static
final
String
PHONENUMKEY
=
"phoneNum"
;
/** 当天用户量统计-key */
public
static
final
String
ACTIVE_USER_TOTAL_COUNT_TODAY
=
"active_user_total_count_today"
;
/** 后台-当天用户量统计-key */
public
static
final
String
ADMIN_ACTIVE_COUNT_TODAY
=
"admin_active_count_today"
;
/** 云享飞-当天用户量统计-key */
public
static
final
String
YXF_ACTIVE_COUNT_TODAY
=
"yxf_active_count_today"
;
/** 云飞手-当天用户量统计-key */
public
static
final
String
YFS_ACTIVE_COUNT_TODAY
=
"yfs_active_count_today"
;
/** 云仓-当天用户量统计-key */
public
static
final
String
YC_ACTIVE_COUNT_TODAY
=
"yc_active_count_today"
;
/** 登录信息token前缀 */
public
static
final
String
LOGING_TOKEN_BEFORE
=
"CLOUD-SHARED-FLIGHT-USERID@"
;
/**
* token黑名单-key
*
* @param userId
* @return
*/
/** 实名认证 redis 的键 */
public
static
final
String
REALNAMEREDISKEY
=
"realName"
;
/** token失效 */
public
static
final
String
DISABLE_TOKEN
=
"DISABLE-TOKEN"
;
/**
* 分片上传的key
*
* @param userId
* @return
*/
public
static
final
String
PART_UPLOAD
=
"UPLOAD_PART_"
;
/** 飞手端-假数据-分页信息-可以 */
public
static
final
String
FLYER_DUMMY_DATA_PAGE
=
"FLYER_DUMMY_DATA_PAGE"
;
/** token失效列表的key */
public
static
final
String
DISABLE_TOKEN_LIST
=
"DISABLE_TOKEN_LIST"
;
/** 无人机城的订单状态 */
public
static
final
String
UAV_MALL_ORDER_STATUS
=
"UAV_MALL_ORDER_STATUS"
;
/** 无人机城的快递公司编码 */
public
static
final
String
UAV_MALL_EXP_COM
=
"UAV_MALL_EXP_COM"
;
/** 无人机城的快递状态码 */
public
static
final
String
UAV_MALL_EXP_STATUS
=
"UAV_MALL_EXP_STATUS"
;
/**
* 微信access_token
*
* @param userId
* @return
*/
public
static
final
String
WX_ACCESS_TOKEN_BEFORE
=
"WX_ACCESS_TOKEN_"
;
public
static
final
String
REPO_SEND_PAY_MESSAGE
=
"REPO_ORDER_REMIND_PAY_"
;
public
static
final
String
FLYER_PUBLIC_DEFAULT_NAME
=
"FLYER_PUBLIC_DEFAULT_NAME"
;
public
static
final
String
EVALUATION
=
"EVALUATION"
;
public
static
final
String
FLYER_DUMMY_DATA
=
"FLYER_DUMMY_DATA_KEY"
;
public
static
final
String
UAV_DUMMY_DATA
=
"UAV_DUMMY_DATA_KEY"
;
/** tagInfoAllot表的缓存key */
public
static
final
String
TAGINFOALLOT_QUESTALL
=
"csf-service-system:tagInfoAllot:questAll"
;
public
static
String
getDisableTokenKey
(
String
accountId
,
String
roleId
,
String
tokenType
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
RedisConstant
.
DISABLE_TOKEN
);
key
.
append
(
"_ROLE_"
);
key
.
append
(
roleId
);
key
.
append
(
"_"
);
key
.
append
(
accountId
);
return
key
.
toString
();
}
/**
* 生成唯一的分片上传key
*
* @param uploadId
* @return
*/
public
static
String
createPartUploadKey
(
String
uploadId
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
uploadId
);
return
key
.
toString
();
}
/** 生成微信api的access_token的key */
public
static
String
createWxToken
(
String
wxAppid
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
RedisConstant
.
WX_ACCESS_TOKEN_BEFORE
);
key
.
append
(
wxAppid
);
return
key
.
toString
();
}
/** 表单重复提交key */
public
static
String
createRepeatKey
(
String
token
,
String
url
,
String
params
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
token
);
key
.
append
(
url
);
key
.
append
(
params
);
return
key
.
toString
();
}
public
static
String
createRepeatKey
(
String
token
,
String
url
)
{
return
RedisConstant
.
createRepeatKey
(
token
,
url
,
""
);
}
/** 登录缓存信息 */
public
static
String
createLoginCacheKey
(
String
tokenType
,
Integer
id
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
tokenType
);
key
.
append
(
"_"
);
key
.
append
(
id
);
return
key
.
toString
();
}
/** 每位账号的的token的key的前缀 */
public
static
String
tokenPreFix
(
String
tokenType
,
String
roleId
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
tokenType
);
key
.
append
(
"_ROLE_"
);
key
.
append
(
roleId
);
key
.
append
(
"_"
);
return
key
.
toString
();
}
/** 每位账号的token保存的key */
public
static
String
createLoginTokenKey
(
String
tokenType
,
String
roleId
,
String
accountId
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
RedisConstant
.
tokenPreFix
(
tokenType
,
roleId
));
key
.
append
(
accountId
);
return
key
.
toString
();
}
public
static
String
createRepoOrderOver
(
Integer
orderInfoId
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
RedisConstant
.
REPO_SEND_PAY_MESSAGE
);
key
.
append
(
orderInfoId
);
return
key
.
toString
();
}
public
static
String
getLockKey
(
String
userId
,
String
tokenType
,
String
path
)
{
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
userId
);
sb
.
append
(
"_"
);
sb
.
append
(
tokenType
);
sb
.
append
(
"_"
);
sb
.
append
(
path
);
return
sb
.
toString
();
}
public
static
String
createInspection
(
Integer
id
)
{
StringBuffer
key
=
new
StringBuffer
();
key
.
append
(
RedisConstant
.
EVALUATION
);
key
.
append
(
id
);
return
key
.
toString
();
}
public
static
String
accessTokenKey
(
String
clientId
,
Integer
roleId
,
String
grantType
)
{
StringBuilder
key
=
new
StringBuilder
();
key
.
append
(
"OAUTH_"
);
key
.
append
(
clientId
);
key
.
append
(
"_"
);
key
.
append
(
roleId
);
key
.
append
(
"_"
);
key
.
append
(
grantType
);
return
key
.
toString
();
}
public
static
String
getCompanyChildKey
(
Integer
companyId
)
{
StringBuilder
key
=
new
StringBuilder
();
key
.
append
(
"company_cache:"
);
key
.
append
(
companyId
);
return
key
.
toString
();
}
public
static
String
getXEAccessTokenKey
()
{
StringBuilder
key
=
new
StringBuilder
();
key
.
append
(
"XE_ACCESS_TOKEN"
);
return
key
.
toString
();
}
}
src/main/java/com/mmc/pms/util/FileLoadUtil.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
util
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @Author small @Date 2023/5/23 10:16 @Version 1.0
*/
@Slf4j
public
class
FileLoadUtil
{
/**
* 批量生成文件
*
* @throws IOException
* @throws IllegalStateException
*/
public
static
ResultBody
bathCreateFile
(
String
directory
,
MultipartFile
[]
files
)
throws
IllegalStateException
,
IOException
{
if
(
files
==
null
||
files
.
length
==
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FILE_UPLOAD_NULL_ERROR
.
getResultCode
(),
ResultEnum
.
FILE_UPLOAD_NULL_ERROR
.
getResultMsg
());
}
List
<
String
>
downloadPaths
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
files
.
length
;
i
++)
{
String
filename
=
FileLoadUtil
.
createNewFileName
(
files
[
i
].
getOriginalFilename
());
// 创建新路径
String
newFileDir
=
FileLoadUtil
.
createFileDirctory
(
directory
);
// 创建文件对象
File
uploadFile
=
new
File
(
newFileDir
+
filename
);
if
(!
uploadFile
.
getParentFile
().
exists
())
{
uploadFile
.
getParentFile
().
mkdirs
();
}
while
(
uploadFile
.
exists
())
{
// 文件名重复
filename
=
filename
+
"("
+
i
+
")"
;
uploadFile
=
new
File
(
newFileDir
+
filename
);
i
++;
}
uploadFile
.
createNewFile
();
files
[
i
].
transferTo
(
uploadFile
);
downloadPaths
.
add
(
FileLoadUtil
.
createDownLoadPath
(
directory
,
filename
));
}
return
ResultBody
.
success
(
downloadPaths
);
}
/**
* 文件名
*
* @param originalFilename
* @return
*/
public
static
String
createNewFileName
(
String
originalFilename
)
{
int
i
=
originalFilename
.
lastIndexOf
(
'.'
);
String
endWith
=
""
;
StringBuffer
sb
=
new
StringBuffer
();
if
(
i
>=
0
)
{
endWith
=
originalFilename
.
substring
(
i
);
}
sb
.
append
(
System
.
currentTimeMillis
());
sb
.
append
(
endWith
);
return
sb
.
toString
();
}
/** 文件夹路径 */
public
static
String
createFileDirctory
(
String
directory
)
{
return
FileServletConstant
.
MOUNTVOLUME
+
directory
+
File
.
separator
+
TDateUtil
.
getCurrentDateByType
(
"yyyyMMdd"
)
+
File
.
separator
;
}
/** 解析下载路径 */
public
static
String
explainLoadPath
(
String
path
)
{
return
FileServletConstant
.
MOUNTVOLUME
+
path
.
replaceAll
(
"@"
,
FileServletConstant
.
separator
);
}
/** 生成下载地址 */
public
static
String
createDownLoadPath
(
String
directory
,
String
filename
)
{
return
FileServletConstant
.
DOWNLOADPATH
+
directory
+
"@"
+
TDateUtil
.
getCurrentDateByType
(
"yyyyMMdd"
)
+
"@"
+
filename
;
}
/**
* 判断文件大小
*
* @param len
* @param size
* @param unit
*/
public
static
boolean
checkFileSize
(
Long
len
,
int
size
,
String
unit
)
{
double
fileSize
=
0
;
if
(
"B"
.
equals
(
unit
.
toUpperCase
()))
{
fileSize
=
(
double
)
len
;
}
else
if
(
"K"
.
equals
(
unit
.
toUpperCase
()))
{
fileSize
=
(
double
)
len
/
1024
;
}
else
if
(
"M"
.
equals
(
unit
.
toUpperCase
()))
{
fileSize
=
(
double
)
len
/
1048576
;
}
else
if
(
"G"
.
equals
(
unit
.
toUpperCase
()))
{
fileSize
=
(
double
)
len
/
1073741824
;
}
if
(
fileSize
>
size
)
{
return
false
;
}
return
true
;
}
/**
* 将文件头转换成16进制字符串
*
* @return 16进制字符串
*/
private
static
String
bytesToHexString
(
byte
[]
src
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
if
(
src
==
null
||
src
.
length
<=
0
)
{
return
null
;
}
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
int
v
=
src
[
i
]
&
0xFF
;
String
hv
=
Integer
.
toHexString
(
v
);
if
(
hv
.
length
()
<
2
)
{
stringBuilder
.
append
(
0
);
}
stringBuilder
.
append
(
hv
);
}
return
stringBuilder
.
toString
();
}
/**
* 得到文件头
*
* @return 文件头
* @throws IOException
*/
private
static
String
getFileContent
(
InputStream
is
)
throws
IOException
{
final
int
len
=
20
;
byte
[]
b
=
new
byte
[
len
];
final
boolean
isMark
=
is
.
markSupported
();
if
(
isMark
)
{
is
.
mark
(
len
);
}
try
{
is
.
read
(
b
,
0
,
len
);
}
catch
(
IOException
e
)
{
log
.
warn
(
"读取文件头信息失败: "
,
e
);
throw
e
;
}
finally
{
if
(
isMark
)
{
is
.
reset
();
}
}
return
bytesToHexString
(
b
);
}
public
static
FileTypeConstant
getType
(
InputStream
is
)
throws
IOException
{
return
getType
(
getFileContent
(
is
));
}
public
static
FileTypeConstant
getType
(
final
byte
[]
bytes
)
throws
IOException
{
return
getType
(
bytesToHexString
(
bytes
));
}
public
static
FileTypeConstant
getType
(
String
fileHead
)
throws
IOException
{
if
(
fileHead
==
null
||
fileHead
.
length
()
==
0
)
{
return
null
;
}
fileHead
=
fileHead
.
toUpperCase
();
FileTypeConstant
[]
fileTypes
=
FileTypeConstant
.
values
();
for
(
FileTypeConstant
type
:
fileTypes
)
{
String
s
=
type
.
getValue
().
toUpperCase
();
if
(
fileHead
.
contains
(
type
.
getValue
().
toUpperCase
()))
{
return
type
;
}
}
return
null
;
}
public
static
Integer
checkFileType
(
FileTypeConstant
value
)
{
Integer
type
=
4
;
// 其他
// 图片
FileTypeConstant
[]
pics
=
{
FileTypeConstant
.
JPEG
,
FileTypeConstant
.
PNG
,
FileTypeConstant
.
BMP
,
FileTypeConstant
.
GIF
};
FileTypeConstant
[]
docs
=
{
FileTypeConstant
.
PST
,
FileTypeConstant
.
XLS_DOC
,
FileTypeConstant
.
XLSX_DOCX
,
FileTypeConstant
.
WPS
,
FileTypeConstant
.
PDF
,
FileTypeConstant
.
PPTX_DOCX
};
FileTypeConstant
[]
videos
=
{
FileTypeConstant
.
AVI
,
FileTypeConstant
.
RAM
,
FileTypeConstant
.
RM
,
FileTypeConstant
.
MPG
,
FileTypeConstant
.
MOV
,
FileTypeConstant
.
ASF
,
FileTypeConstant
.
MP4
,
FileTypeConstant
.
FLV
,
FileTypeConstant
.
MID
};
// 图片
for
(
FileTypeConstant
fileType
:
pics
)
{
if
(
fileType
.
equals
(
value
))
{
type
=
1
;
}
}
// 文档
for
(
FileTypeConstant
fileType
:
docs
)
{
if
(
fileType
.
equals
(
value
))
{
type
=
2
;
}
}
// 视频
for
(
FileTypeConstant
fileType
:
videos
)
{
if
(
fileType
.
equals
(
value
))
{
type
=
3
;
}
}
return
type
;
}
}
src/main/java/com/mmc/pms/util/FileServletConstant.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
util
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
/**
* @Author small @Date 2023/5/23 10:24 @Version 1.0
*/
@Component
public
class
FileServletConstant
{
public
static
String
MOUNTVOLUME
;
public
static
String
separator
;
public
static
String
DOWNLOADPATH
;
// 下载地址
public
FileServletConstant
(
@Value
(
"${mount.directory}"
)
String
mountVolume
,
@Value
(
"${mmcflying.download.path}"
)
String
downloadPath
)
{
if
(
File
.
separator
.
equals
(
"\\"
))
{
separator
=
"\\\\"
;
}
else
{
separator
=
File
.
separator
;
}
MOUNTVOLUME
=
mountVolume
.
replaceAll
(
"@"
,
separator
);
DOWNLOADPATH
=
downloadPath
;
}
}
src/main/java/com/mmc/pms/util/FileTypeConstant.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
util
;
/**
* @Author small @Date 2023/5/23 10:17 @Version 1.0
*/
public
enum
FileTypeConstant
{
/** JEPG. */
JPEG
(
"FFD8FF"
),
/** PNG. */
PNG
(
"89504E47"
),
/** Windows Bitmap. */
BMP
(
"424D"
),
/** GIF. */
GIF
(
"47494638"
),
/** Outlook (pst). */
PST
(
"2142444E"
),
/** MS Word/Excel. */
XLS_DOC
(
"D0CF11E0"
),
XLSX_DOCX
(
"504B030414000600080000002100"
),
PPTX_DOCX
(
"504B03040A0000000000874EE240000000000000"
),
XLSX_DOC
(
"504B03041400000008000A52F64E926EBD1F8501"
),
/** WPS文字wps、表格et、演示dps都是一样的 */
WPS
(
"D0CF11E0A1B11AE10000"
),
/** Adobe Acrobat. */
PDF
(
"255044462D312E"
),
/** Wave. */
WAV
(
"57415645"
),
/** AVI. */
AVI
(
"41564920"
),
/** Real Audio. */
RAM
(
"2E7261FD"
),
/** Real Media. */
RM
(
"2E524D46"
),
/** MPEG (mpg). */
MPG
(
"000001BA"
),
/** Quicktime. */
MOV
(
"6D6F6F76"
),
/** Windows Media. */
ASF
(
"3026B2758E66CF11"
),
/** MIDI. */
MID
(
"4D546864"
),
/** MP4. */
// MP4("00000020667479706"),
// mp4("00000018667479706D70"),
MP4
(
"667479706"
),
/** MP3. */
MP3
(
"49443303000000002176"
),
/** FLV. */
FLV
(
"464C5601050000000900"
);
private
String
value
=
""
;
/**
* Constructor.
*
* @param value
*/
private
FileTypeConstant
(
String
value
)
{
this
.
value
=
value
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
src/main/java/com/mmc/pms/util/OssConstant.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
util
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
/**
* @Author small @Date 2023/5/23 10:26 @Version 1.0
*/
@Component
public
class
OssConstant
{
public
static
String
ENDPOINT
;
public
static
String
ACCESSKEYID
;
public
static
String
ACCESSKEYSECRET
;
public
static
String
BUCKET
;
public
OssConstant
(
@Value
(
"${aliyun.oss.endpoint}"
)
String
endPoint
,
@Value
(
"${aliyun.oss.access-key-id}"
)
String
accessKeyId
,
@Value
(
"${aliyun.oss.access-key-secret}"
)
String
accessKeySecret
,
@Value
(
"${aliyun.oss.bucket}"
)
String
bucket
)
{
ENDPOINT
=
endPoint
;
ACCESSKEYID
=
accessKeyId
;
ACCESSKEYSECRET
=
accessKeySecret
;
BUCKET
=
bucket
;
}
}
src/main/java/com/mmc/pms/util/PartUploadInfo.java
0 → 100644
浏览文件 @
ed80e0db
package
com
.
mmc
.
pms
.
util
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @Author small @Date 2023/5/23 13:48 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
PartUploadInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4138719631627565554L
;
private
String
uploadId
;
private
String
bucketName
;
private
String
objectName
;
}
src/main/java/com/mmc/pms/util/TDateUtil.java
0 → 100644
浏览文件 @
ed80e0db
差异被折叠。
点击展开。
src/main/resources/application-dev.yml
浏览文件 @
ed80e0db
...
@@ -20,4 +20,17 @@ springfox:
...
@@ -20,4 +20,17 @@ springfox:
enabled
:
false
enabled
:
false
enabled
:
true
#开启文档
enabled
:
true
#开启文档
aliyun
:
oss
:
endpoint
:
oss-cn-shenzhen.aliyuncs.com
access-key-id
:
LTAI4FzCpyrA33PegnxWS6XV
access-key-secret
:
ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket
:
pad-video-x
mmcflying
:
download
:
path
:
/ossservlet/upload/download/
mount
:
directory
:
D:@javaVolume@
src/main/resources/application-local.yml
浏览文件 @
ed80e0db
...
@@ -20,4 +20,17 @@ springfox:
...
@@ -20,4 +20,17 @@ springfox:
enabled
:
false
enabled
:
false
enabled
:
true
#开启文档
enabled
:
true
#开启文档
aliyun
:
oss
:
endpoint
:
oss-cn-shenzhen.aliyuncs.com
access-key-id
:
LTAI4FzCpyrA33PegnxWS6XV
access-key-secret
:
ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket
:
pad-video-x
mmcflying
:
download
:
path
:
/ossservlet/upload/download/
mount
:
directory
:
D:@javaVolume@
src/main/resources/application-prod.yml
浏览文件 @
ed80e0db
...
@@ -19,3 +19,16 @@ springfox:
...
@@ -19,3 +19,16 @@ springfox:
swagger-ui
:
swagger-ui
:
enabled
:
false
enabled
:
false
enabled
:
true
#开启文档
enabled
:
true
#开启文档
aliyun
:
oss
:
endpoint
:
oss-cn-shenzhen.aliyuncs.com
access-key-id
:
LTAI4FzCpyrA33PegnxWS6XV
access-key-secret
:
ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket
:
pad-video-x
mmcflying
:
download
:
path
:
/ossservlet/upload/download/
mount
:
directory
:
D:@javaVolume@
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论