Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
468a6d44
Commit
468a6d44
authored
Apr 20, 2021
by
jiawei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://111.203.232.171:8888/lee/chnmuseum-party
parents
19b108be
70fea19a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
AssetController.java
...nergy/chnmuseum/party/web/controller/AssetController.java
+1
-1
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+9
-2
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+5
-5
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AssetController.java
View file @
468a6d44
...
...
@@ -153,7 +153,7 @@ public class AssetController extends BaseController {
final
List
<
TBoxOperation
>
tBoxOperationList
=
assetService
.
listBoxByOrgan
();
final
Map
<
String
,
InputStream
>
map
=
new
LinkedHashMap
<>(
tBoxOperationList
.
size
());
for
(
TBoxOperation
tBoxOperation
:
tBoxOperationList
)
{
map
.
put
(
tBoxOperation
.
getOrganName
()
+
"-"
+
tBoxOperation
.
getMac
()
+
".cipher"
,
IoUtil
.
toStream
(
RSAUtils
.
encrypt
(
VideoEncryptUtil
.
cipher
,
tBoxOperation
.
getPublicKey
()),
StandardCharsets
.
UTF_8
));
map
.
put
(
tBoxOperation
.
getOrganName
()
+
"-"
+
tBoxOperation
.
getMac
()
.
replaceAll
(
":|-"
,
"_"
)
+
".cipher"
,
IoUtil
.
toStream
(
RSAUtils
.
encrypt
(
VideoEncryptUtil
.
cipher
,
tBoxOperation
.
getPublicKey
()),
StandardCharsets
.
UTF_8
));
}
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
String
[]
paths
=
map
.
keySet
().
toArray
(
new
String
[
0
]);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
468a6d44
...
...
@@ -117,7 +117,7 @@ public class ChinaMobileRestApiController extends BaseController {
@RequiresAuthentication
//@RequiresPermissions("equitment:key")
public
Map
<
String
,
Object
>
getBoxPrivateKey
(
@RequestParam
(
value
=
"mac"
)
String
mac
)
{
try
{
String
macAddress
=
mac
.
trim
().
toUpperCase
();
String
macAddress
=
mac
.
trim
().
toUpperCase
()
.
replaceAll
(
"-|_"
,
":"
)
;
final
LambdaQueryWrapper
<
TBoxOperation
>
queryWrapper
=
Wrappers
.<
TBoxOperation
>
lambdaQuery
().
eq
(
TBoxOperation:
:
getMac
,
macAddress
);
final
TBoxOperation
tBoxOperation
=
this
.
boxOperationService
.
getOne
(
queryWrapper
);
if
(
tBoxOperation
!=
null
)
{
...
...
@@ -660,7 +660,14 @@ public class ChinaMobileRestApiController extends BaseController {
current
=
currentList
.
get
(
0
);
}
Map
map
=
new
HashMap
();
map
.
put
(
"isLatest"
,
versionNo
.
equalsIgnoreCase
(
current
.
getAppVersion
()));
if
(
StringUtils
.
isNotBlank
(
versionNo
))
{
if
(
Long
.
parseLong
(
versionNo
)
>=
Long
.
parseLong
(
current
.
getAppVersion
()))
{
map
.
put
(
"isLatest"
,
true
);
}
}
else
{
map
.
put
(
"isLatest"
,
false
);
}
map
.
put
(
"versionNo"
,
current
.
getAppVersion
());
map
.
put
(
"versionUrl"
,
current
.
getApkUrl
());
map
.
put
(
"updateLog"
,
current
.
getUpdateLog
());
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
468a6d44
...
...
@@ -17,7 +17,6 @@ import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.tobato.fastdfs.domain.fdfs.FileInfo
;
import
com.github.tobato.fastdfs.domain.fdfs.MetaData
;
import
com.github.tobato.fastdfs.exception.FdfsServerException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -80,14 +79,14 @@ public class FileUploadController extends BaseController {
try
{
FastDFSUtils
.
deleteFile
(
fileUrl
);
FastDFSUtils
.
deleteFile
(
fileUrlCrypto
);
}
catch
(
FdfsServerException
e
)
{
}
catch
(
Throwable
e
)
{
this
.
assetService
.
removeById
(
id
);
return
getResult
(
"文件
被已
删除"
);
return
getResult
(
"文件
已被
删除"
);
}
this
.
assetService
.
removeById
(
id
);
return
getSuccessResult
();
}
return
getResult
(
"文件
被已
删除"
);
return
getResult
(
"文件
已被
删除"
);
}
@ApiImplicitParams
({
...
...
@@ -178,6 +177,7 @@ public class FileUploadController extends BaseController {
final
Set
<
MetaData
>
fileMetaData
=
FastDFSUtils
.
getFileMetaData
(
fileUrlCrypto
);
String
md5
=
fileMetaData
.
stream
().
filter
(
x
->
"MD5"
.
equals
(
x
.
getName
())).
map
(
MetaData:
:
getValue
).
findFirst
().
get
();
asset
.
setMd5
(
md5
);
asset
.
setFileUrlCrypto
(
md5
+
".chnmuseum"
);
}
else
if
(
Arrays
.
stream
(
AUDIO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
finalExtName
.
toUpperCase
())))
{
metaDataSet
.
add
(
new
MetaData
(
"fileType"
,
FileTypeEnum
.
AUDIO
.
name
()));
handleResult
.
setFileType
(
FileTypeEnum
.
AUDIO
.
name
());
...
...
@@ -826,7 +826,7 @@ public class FileUploadController extends BaseController {
final
long
fileSize
=
fileInfo
.
getFileSize
();
final
Asset
asset
=
Asset
.
builder
()
.
fileName
(
originalFilename
)
.
fileNameCrypto
(
baseName
+
".chnmuseum"
)
.
fileNameCrypto
(
md5
+
".chnmuseum"
)
.
fileExtName
(
extName
)
.
fileType
(
FileTypeEnum
.
VIDEO
.
name
())
.
fileSize
(
fileSize
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment