Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2ccec55b
authored
2025-08-10 16:17:50 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
51ce8d57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
40 deletions
lego-admin/src/main/java/com/lego/web/controller/core/CourseController.java
lego-admin/src/main/java/com/lego/web/controller/core/CourseController.java
View file @
2ccec55
package
com
.
lego
.
web
.
controller
.
core
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.lego.common.annotation.RepeatSubmit
;
import
com.lego.common.core.controller.BaseController
;
import
com.lego.common.core.domain.R
;
import
com.lego.common.core.page.TableDataInfo
;
import
com.lego.common.core.service.ConfigService
;
import
com.lego.common.exception.ServiceException
;
import
com.lego.common.utils.EncryptUtils
;
import
com.lego.common.utils.StringUtils
;
import
com.lego.common.utils.spring.SpringUtils
;
import
com.lego.core.domin.Course
;
import
com.lego.core.domin.bo.BuildingBlockBo
;
import
com.lego.core.domin.bo.BuildingBlockQueryBo
;
import
com.lego.core.domin.bo.CourseBo
;
import
com.lego.core.domin.bo.CourseQueryBo
;
import
com.lego.core.domin.vo.BuildingBlockVo
;
import
com.lego.core.domin.vo.CourseVo
;
import
com.lego.core.mapper.CourseMapper
;
import
com.lego.core.service.IBuildingBlockService
;
import
com.lego.core.service.ICourseService
;
import
com.lego.oss.core.OssClient
;
import
com.lego.oss.entity.UploadResult
;
import
com.lego.oss.factory.OssFactory
;
import
com.lego.system.domain.vo.SysOssVo
;
import
com.lego.system.service.ISysOssService
;
import
com.lego.system.service.impl.SysOssServiceImpl
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -34,9 +24,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.rmi.ServerException
;
import
java.util.List
;
import
java.util.Objects
;
...
...
@@ -119,7 +107,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
@@ -137,7 +125,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
@@ -155,7 +143,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -172,7 +160,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -222,7 +210,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".mp4"
.
equals
(
suffix
))
{
...
...
@@ -239,7 +227,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".json"
.
equals
(
suffix
))
{
...
...
@@ -256,7 +244,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -273,7 +261,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -323,7 +311,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".mp4"
.
equals
(
suffix
))
{
...
...
@@ -340,7 +328,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".json"
.
equals
(
suffix
))
{
...
...
@@ -357,7 +345,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -374,7 +362,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -424,7 +412,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".mp4"
.
equals
(
suffix
))
{
...
...
@@ -441,7 +429,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".json"
.
equals
(
suffix
))
{
...
...
@@ -458,7 +446,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -475,7 +463,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -525,7 +513,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".mp4"
.
equals
(
suffix
))
{
...
...
@@ -542,7 +530,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".json"
.
equals
(
suffix
))
{
...
...
@@ -559,7 +547,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -576,7 +564,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -626,7 +614,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".mp4"
.
equals
(
suffix
))
{
...
...
@@ -643,7 +631,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".json"
.
equals
(
suffix
))
{
...
...
@@ -660,7 +648,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
else
if
(
".ldr"
.
equals
(
suffix
))
{
...
...
@@ -677,7 +665,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
...
...
@@ -727,7 +715,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"application/pdf"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
@@ -745,7 +733,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"video/mpeg4"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
@@ -763,7 +751,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
@@ -781,7 +769,7 @@ public class CourseController extends BaseController {
fileBytes
=
byteArrayOutputStream
.
toByteArray
();
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
fileBytes
);
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
"text/plain"
);
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
...
...
Write
Preview
Styling with
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