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
2455866c
Commit
2455866c
authored
Apr 08, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
900cda8c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
66 deletions
+29
-66
FdfsException.java
...nergy/chnmuseum/party/common/exception/FdfsException.java
+0
-29
FdfsUnsupportStorePathException.java
...rty/common/exception/FdfsUnsupportStorePathException.java
+0
-20
GlobalExceptionAdvisor.java
...gy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
+12
-0
VideoEncryptUtil.java
...energy/chnmuseum/party/common/video/VideoEncryptUtil.java
+9
-6
VideoTestUtil.java
...wisenergy/chnmuseum/party/common/video/VideoTestUtil.java
+1
-0
LearningContentBoardMapper.java
...gy/chnmuseum/party/mapper/LearningContentBoardMapper.java
+3
-8
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+4
-3
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/exception/FdfsException.java
deleted
100644 → 0
View file @
900cda8c
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
exception
;
/**
* 封装fastdfs的异常,使用运行时异常
*
* @author yuqih
* @author tobato
*
*/
public
abstract
class
FdfsException
extends
RuntimeException
{
/**
* serialVersionUID
*/
private
static
final
long
serialVersionUID
=
1L
;
protected
FdfsException
(
String
message
)
{
super
(
message
);
}
/**
* @param message
* @param cause
*/
protected
FdfsException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
}
\ No newline at end of file
src/main/java/cn/wisenergy/chnmuseum/party/common/exception/FdfsUnsupportStorePathException.java
deleted
100644 → 0
View file @
900cda8c
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
exception
;
/**
* 从Url解析StorePath文件路径对象错误
*
* @author wuyf
*
*/
public
class
FdfsUnsupportStorePathException
extends
FdfsException
{
/**
* serialVersionUID
*/
private
static
final
long
serialVersionUID
=
8116336411011152869L
;
public
FdfsUnsupportStorePathException
(
String
message
)
{
super
(
message
);
}
}
\ No newline at end of file
src/main/java/cn/wisenergy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
View file @
2455866c
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
mvc
;
import
cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM
;
import
cn.wisenergy.chnmuseum.party.common.enums.RESULT_INFO_ENUM
;
import
com.google.common.base.Splitter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
...
...
@@ -23,11 +24,14 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
org.springframework.web.multipart.support.MissingServletRequestPartException
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.ConstraintViolationException
;
import
java.sql.SQLIntegrityConstraintViolationException
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -202,6 +206,14 @@ public class GlobalExceptionAdvisor {
return
httpResult
;
}
@ExceptionHandler
(
MissingServletRequestPartException
.
class
)
public
Object
handleServletRequestPartException
(
MissingServletRequestPartException
exception
)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
"400"
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
"请选择文件后点击上传"
);
return
map
;
}
/**
* 添加异常信息到map中
*
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/video/VideoEncryptUtil.java
View file @
2455866c
...
...
@@ -2,20 +2,22 @@ package cn.wisenergy.chnmuseum.party.common.video;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.*
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.charset.StandardCharsets
;
@Slf4j
public
class
VideoEncryptUtil
{
private
static
final
String
plainFilePath
=
"D:\\200.tmp\\"
;
//此为AES128位,如果要求AES256位,需要更新jdk内的包,jdk8发布版本默认不支持
private
static
final
String
cipher
=
"3348c95c60520be7"
;
private
static
final
int
dataLength
=
4096
;
public
static
void
main
(
InputStream
fis
,
String
cipher
)
throws
IOException
{
final
OutputStream
[]
outputStream
=
new
OutputStream
[
1
];
AesCipherDataSink
encryptingDataSink
=
new
AesCipherDataSink
(
"3348c95c60520be7"
.
getBytes
(
StandardCharsets
.
UTF_8
),
public
static
InputStream
main
(
InputStream
fis
,
String
cipher
)
throws
IOException
{
final
ByteArrayOutputStream
[]
outputStream
=
new
ByteArray
OutputStream
[
1
];
AesCipherDataSink
encryptingDataSink
=
new
AesCipherDataSink
(
cipher
.
getBytes
(
StandardCharsets
.
UTF_8
),
new
DataSink
()
{
@Override
public
void
open
()
{
...
...
@@ -23,7 +25,7 @@ public class VideoEncryptUtil {
}
@Override
public
void
write
(
byte
[]
buffer
,
int
offset
,
int
length
)
throws
IOException
{
public
void
write
(
byte
[]
buffer
,
int
offset
,
int
length
)
{
outputStream
[
0
].
write
(
buffer
,
offset
,
length
);
}
...
...
@@ -41,6 +43,7 @@ public class VideoEncryptUtil {
encryptingDataSink
.
close
();
fis
.
close
();
log
.
info
(
"加解密完成"
);
return
new
ByteArrayInputStream
(
outputStream
[
0
].
toByteArray
());
}
}
src/main/java/cn/wisenergy/chnmuseum/party/common/video/VideoTestUtil.java
View file @
2455866c
...
...
@@ -10,6 +10,7 @@ import java.nio.charset.StandardCharsets;
@Slf4j
public
class
VideoTestUtil
{
private
static
final
String
plainFilePath
=
"D:\\200.tmp\\"
;
//此为AES128位,如果要求AES256位,需要更新jdk内的包,jdk8发布版本默认不支持
private
static
final
String
cipher
=
"3348c95c60520be7"
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/LearningContentBoardMapper.java
View file @
2455866c
...
...
@@ -35,7 +35,6 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
@Select
(
"SELECT t.* FROM "
+
"("
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
...
...
@@ -44,7 +43,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+
"and a.file_type = 'VIDEO' "
+
"and lc.applicable_scope = 'THIS_ORGAN' "
+
"and lc.organ_code = #{organCode} "
+
"UNION
ALL
"
+
"UNION "
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
...
...
@@ -53,9 +52,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+
"and a.file_type = 'VIDEO' "
+
"and lc.applicable_scope = 'THIS_ORGAN' "
+
"and lc.organ_code = #{organCode} "
+
"UNION "
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover "
+
"FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
...
...
@@ -65,7 +62,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+
"and a.file_type = 'VIDEO' "
+
"and lc.applicable_scope = 'THIS_ORGAN_SUB'"
+
"and lc.organ_code like CONCAT(#{organCode},'%') "
+
"UNION
ALL
"
+
"UNION "
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
...
...
@@ -74,9 +71,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+
"and a.file_type = 'VIDEO' "
+
"and lc.applicable_scope = 'THIS_ORGAN_SUB' "
+
"and lc.organ_code = #{organCode} "
+
"UNION "
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
+
"and lcb.exhibition_board_id = eb.id "
...
...
@@ -84,7 +79,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+
"and vc.id = a.ref_item_id "
+
"and a.file_type = 'VIDEO' "
+
"and lc.applicable_scope = 'ALL_PLAT'"
+
"UNION
ALL
"
+
"UNION "
+
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover "
+
"FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+
"WHERE lcb.learning_content_id = lc.id "
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
2455866c
...
...
@@ -29,7 +29,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.shiro.authc.DisabledAccountException
;
import
org.apache.shiro.authc.IncorrectCredentialsException
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
...
@@ -43,7 +42,9 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
...
...
@@ -144,7 +145,7 @@ public class ChinaMobileRestApiController extends BaseController {
@GetMapping
(
"/equitment/activity"
)
//@RequiresAuthentication //@RequiresPermissions("/equitment/activity/")
public
Map
<
String
,
Object
>
getActivity
(
@RequestParam
(
required
=
true
)
String
mac
)
{
List
<
TBoxOperation
>
list
=
new
ArrayList
<>()
;
List
<
TBoxOperation
>
list
;
try
{
UpdateWrapper
<
TBoxOperation
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
eq
(
"mac"
,
mac
);
...
...
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