2ccec55b by chentao

no message

1 parent 51ce8d57
1 package com.lego.web.controller.core; 1 package com.lego.web.controller.core;
2 2
3 import cn.hutool.core.bean.BeanUtil; 3 import cn.hutool.core.bean.BeanUtil;
4 import cn.hutool.core.io.IoUtil;
5 import cn.hutool.core.util.ObjectUtil; 4 import cn.hutool.core.util.ObjectUtil;
6 import com.lego.common.annotation.RepeatSubmit; 5 import com.lego.common.annotation.RepeatSubmit;
7 import com.lego.common.core.controller.BaseController; 6 import com.lego.common.core.controller.BaseController;
8 import com.lego.common.core.domain.R; 7 import com.lego.common.core.domain.R;
9 import com.lego.common.core.page.TableDataInfo; 8 import com.lego.common.core.page.TableDataInfo;
10 import com.lego.common.core.service.ConfigService;
11 import com.lego.common.exception.ServiceException;
12 import com.lego.common.utils.EncryptUtils; 9 import com.lego.common.utils.EncryptUtils;
13 import com.lego.common.utils.StringUtils; 10 import com.lego.common.utils.StringUtils;
14 import com.lego.common.utils.spring.SpringUtils;
15 import com.lego.core.domin.Course;
16 import com.lego.core.domin.bo.BuildingBlockBo;
17 import com.lego.core.domin.bo.BuildingBlockQueryBo;
18 import com.lego.core.domin.bo.CourseBo; 11 import com.lego.core.domin.bo.CourseBo;
19 import com.lego.core.domin.bo.CourseQueryBo; 12 import com.lego.core.domin.bo.CourseQueryBo;
20 import com.lego.core.domin.vo.BuildingBlockVo;
21 import com.lego.core.domin.vo.CourseVo; 13 import com.lego.core.domin.vo.CourseVo;
22 import com.lego.core.mapper.CourseMapper; 14 import com.lego.core.mapper.CourseMapper;
23 import com.lego.core.service.IBuildingBlockService;
24 import com.lego.core.service.ICourseService; 15 import com.lego.core.service.ICourseService;
25 import com.lego.oss.core.OssClient; 16 import com.lego.oss.core.OssClient;
26 import com.lego.oss.entity.UploadResult; 17 import com.lego.oss.entity.UploadResult;
27 import com.lego.oss.factory.OssFactory; 18 import com.lego.oss.factory.OssFactory;
28 import com.lego.system.domain.vo.SysOssVo; 19 import com.lego.system.domain.vo.SysOssVo;
29 import com.lego.system.service.ISysOssService;
30 import com.lego.system.service.impl.SysOssServiceImpl; 20 import com.lego.system.service.impl.SysOssServiceImpl;
31 import lombok.RequiredArgsConstructor; 21 import lombok.RequiredArgsConstructor;
32 import org.springframework.web.bind.annotation.*; 22 import org.springframework.web.bind.annotation.*;
...@@ -34,9 +24,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -34,9 +24,7 @@ import org.springframework.web.bind.annotation.*;
34 import javax.servlet.http.HttpServletRequest; 24 import javax.servlet.http.HttpServletRequest;
35 import javax.validation.Valid; 25 import javax.validation.Valid;
36 import java.io.ByteArrayOutputStream; 26 import java.io.ByteArrayOutputStream;
37 import java.io.IOException;
38 import java.io.InputStream; 27 import java.io.InputStream;
39 import java.io.OutputStream;
40 import java.rmi.ServerException; 28 import java.rmi.ServerException;
41 import java.util.List; 29 import java.util.List;
42 import java.util.Objects; 30 import java.util.Objects;
...@@ -119,7 +107,7 @@ public class CourseController extends BaseController { ...@@ -119,7 +107,7 @@ public class CourseController extends BaseController {
119 fileBytes = byteArrayOutputStream.toByteArray(); 107 fileBytes = byteArrayOutputStream.toByteArray();
120 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 108 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
121 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 109 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
122 } catch (IOException e) { 110 } catch (Exception e) {
123 System.out.println(e.getMessage()); 111 System.out.println(e.getMessage());
124 } 112 }
125 113
...@@ -137,7 +125,7 @@ public class CourseController extends BaseController { ...@@ -137,7 +125,7 @@ public class CourseController extends BaseController {
137 fileBytes = byteArrayOutputStream.toByteArray(); 125 fileBytes = byteArrayOutputStream.toByteArray();
138 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 126 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
139 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 127 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
140 } catch (IOException e) { 128 } catch (Exception e) {
141 System.out.println(e.getMessage()); 129 System.out.println(e.getMessage());
142 } 130 }
143 131
...@@ -155,7 +143,7 @@ public class CourseController extends BaseController { ...@@ -155,7 +143,7 @@ public class CourseController extends BaseController {
155 fileBytes = byteArrayOutputStream.toByteArray(); 143 fileBytes = byteArrayOutputStream.toByteArray();
156 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 144 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
157 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 145 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
158 } catch (IOException e) { 146 } catch (Exception e) {
159 System.out.println(e.getMessage()); 147 System.out.println(e.getMessage());
160 } 148 }
161 } else if (".ldr".equals(suffix)) { 149 } else if (".ldr".equals(suffix)) {
...@@ -172,7 +160,7 @@ public class CourseController extends BaseController { ...@@ -172,7 +160,7 @@ public class CourseController extends BaseController {
172 fileBytes = byteArrayOutputStream.toByteArray(); 160 fileBytes = byteArrayOutputStream.toByteArray();
173 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 161 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
174 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 162 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
175 } catch (IOException e) { 163 } catch (Exception e) {
176 System.out.println(e.getMessage()); 164 System.out.println(e.getMessage());
177 } 165 }
178 } 166 }
...@@ -222,7 +210,7 @@ public class CourseController extends BaseController { ...@@ -222,7 +210,7 @@ public class CourseController extends BaseController {
222 fileBytes = byteArrayOutputStream.toByteArray(); 210 fileBytes = byteArrayOutputStream.toByteArray();
223 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 211 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
224 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 212 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
225 } catch (IOException e) { 213 } catch (Exception e) {
226 System.out.println(e.getMessage()); 214 System.out.println(e.getMessage());
227 } 215 }
228 } else if (".mp4".equals(suffix)) { 216 } else if (".mp4".equals(suffix)) {
...@@ -239,7 +227,7 @@ public class CourseController extends BaseController { ...@@ -239,7 +227,7 @@ public class CourseController extends BaseController {
239 fileBytes = byteArrayOutputStream.toByteArray(); 227 fileBytes = byteArrayOutputStream.toByteArray();
240 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 228 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
241 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 229 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
242 } catch (IOException e) { 230 } catch (Exception e) {
243 System.out.println(e.getMessage()); 231 System.out.println(e.getMessage());
244 } 232 }
245 } else if (".json".equals(suffix)) { 233 } else if (".json".equals(suffix)) {
...@@ -256,7 +244,7 @@ public class CourseController extends BaseController { ...@@ -256,7 +244,7 @@ public class CourseController extends BaseController {
256 fileBytes = byteArrayOutputStream.toByteArray(); 244 fileBytes = byteArrayOutputStream.toByteArray();
257 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 245 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
258 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 246 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
259 } catch (IOException e) { 247 } catch (Exception e) {
260 System.out.println(e.getMessage()); 248 System.out.println(e.getMessage());
261 } 249 }
262 } else if (".ldr".equals(suffix)) { 250 } else if (".ldr".equals(suffix)) {
...@@ -273,7 +261,7 @@ public class CourseController extends BaseController { ...@@ -273,7 +261,7 @@ public class CourseController extends BaseController {
273 fileBytes = byteArrayOutputStream.toByteArray(); 261 fileBytes = byteArrayOutputStream.toByteArray();
274 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 262 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
275 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 263 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
276 } catch (IOException e) { 264 } catch (Exception e) {
277 System.out.println(e.getMessage()); 265 System.out.println(e.getMessage());
278 } 266 }
279 } 267 }
...@@ -323,7 +311,7 @@ public class CourseController extends BaseController { ...@@ -323,7 +311,7 @@ public class CourseController extends BaseController {
323 fileBytes = byteArrayOutputStream.toByteArray(); 311 fileBytes = byteArrayOutputStream.toByteArray();
324 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 312 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
325 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 313 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
326 } catch (IOException e) { 314 } catch (Exception e) {
327 System.out.println(e.getMessage()); 315 System.out.println(e.getMessage());
328 } 316 }
329 } else if (".mp4".equals(suffix)) { 317 } else if (".mp4".equals(suffix)) {
...@@ -340,7 +328,7 @@ public class CourseController extends BaseController { ...@@ -340,7 +328,7 @@ public class CourseController extends BaseController {
340 fileBytes = byteArrayOutputStream.toByteArray(); 328 fileBytes = byteArrayOutputStream.toByteArray();
341 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 329 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
342 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 330 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
343 } catch (IOException e) { 331 } catch (Exception e) {
344 System.out.println(e.getMessage()); 332 System.out.println(e.getMessage());
345 } 333 }
346 } else if (".json".equals(suffix)) { 334 } else if (".json".equals(suffix)) {
...@@ -357,7 +345,7 @@ public class CourseController extends BaseController { ...@@ -357,7 +345,7 @@ public class CourseController extends BaseController {
357 fileBytes = byteArrayOutputStream.toByteArray(); 345 fileBytes = byteArrayOutputStream.toByteArray();
358 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 346 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
359 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 347 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
360 } catch (IOException e) { 348 } catch (Exception e) {
361 System.out.println(e.getMessage()); 349 System.out.println(e.getMessage());
362 } 350 }
363 } else if (".ldr".equals(suffix)) { 351 } else if (".ldr".equals(suffix)) {
...@@ -374,7 +362,7 @@ public class CourseController extends BaseController { ...@@ -374,7 +362,7 @@ public class CourseController extends BaseController {
374 fileBytes = byteArrayOutputStream.toByteArray(); 362 fileBytes = byteArrayOutputStream.toByteArray();
375 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 363 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
376 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 364 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
377 } catch (IOException e) { 365 } catch (Exception e) {
378 System.out.println(e.getMessage()); 366 System.out.println(e.getMessage());
379 } 367 }
380 } 368 }
...@@ -424,7 +412,7 @@ public class CourseController extends BaseController { ...@@ -424,7 +412,7 @@ public class CourseController extends BaseController {
424 fileBytes = byteArrayOutputStream.toByteArray(); 412 fileBytes = byteArrayOutputStream.toByteArray();
425 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 413 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
426 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 414 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
427 } catch (IOException e) { 415 } catch (Exception e) {
428 System.out.println(e.getMessage()); 416 System.out.println(e.getMessage());
429 } 417 }
430 } else if (".mp4".equals(suffix)) { 418 } else if (".mp4".equals(suffix)) {
...@@ -441,7 +429,7 @@ public class CourseController extends BaseController { ...@@ -441,7 +429,7 @@ public class CourseController extends BaseController {
441 fileBytes = byteArrayOutputStream.toByteArray(); 429 fileBytes = byteArrayOutputStream.toByteArray();
442 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 430 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
443 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 431 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
444 } catch (IOException e) { 432 } catch (Exception e) {
445 System.out.println(e.getMessage()); 433 System.out.println(e.getMessage());
446 } 434 }
447 } else if (".json".equals(suffix)) { 435 } else if (".json".equals(suffix)) {
...@@ -458,7 +446,7 @@ public class CourseController extends BaseController { ...@@ -458,7 +446,7 @@ public class CourseController extends BaseController {
458 fileBytes = byteArrayOutputStream.toByteArray(); 446 fileBytes = byteArrayOutputStream.toByteArray();
459 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 447 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
460 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 448 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
461 } catch (IOException e) { 449 } catch (Exception e) {
462 System.out.println(e.getMessage()); 450 System.out.println(e.getMessage());
463 } 451 }
464 } else if (".ldr".equals(suffix)) { 452 } else if (".ldr".equals(suffix)) {
...@@ -475,7 +463,7 @@ public class CourseController extends BaseController { ...@@ -475,7 +463,7 @@ public class CourseController extends BaseController {
475 fileBytes = byteArrayOutputStream.toByteArray(); 463 fileBytes = byteArrayOutputStream.toByteArray();
476 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 464 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
477 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 465 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
478 } catch (IOException e) { 466 } catch (Exception e) {
479 System.out.println(e.getMessage()); 467 System.out.println(e.getMessage());
480 } 468 }
481 } 469 }
...@@ -525,7 +513,7 @@ public class CourseController extends BaseController { ...@@ -525,7 +513,7 @@ public class CourseController extends BaseController {
525 fileBytes = byteArrayOutputStream.toByteArray(); 513 fileBytes = byteArrayOutputStream.toByteArray();
526 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 514 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
527 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 515 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
528 } catch (IOException e) { 516 } catch (Exception e) {
529 System.out.println(e.getMessage()); 517 System.out.println(e.getMessage());
530 } 518 }
531 } else if (".mp4".equals(suffix)) { 519 } else if (".mp4".equals(suffix)) {
...@@ -542,7 +530,7 @@ public class CourseController extends BaseController { ...@@ -542,7 +530,7 @@ public class CourseController extends BaseController {
542 fileBytes = byteArrayOutputStream.toByteArray(); 530 fileBytes = byteArrayOutputStream.toByteArray();
543 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 531 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
544 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 532 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
545 } catch (IOException e) { 533 } catch (Exception e) {
546 System.out.println(e.getMessage()); 534 System.out.println(e.getMessage());
547 } 535 }
548 } else if (".json".equals(suffix)) { 536 } else if (".json".equals(suffix)) {
...@@ -559,7 +547,7 @@ public class CourseController extends BaseController { ...@@ -559,7 +547,7 @@ public class CourseController extends BaseController {
559 fileBytes = byteArrayOutputStream.toByteArray(); 547 fileBytes = byteArrayOutputStream.toByteArray();
560 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 548 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
561 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 549 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
562 } catch (IOException e) { 550 } catch (Exception e) {
563 System.out.println(e.getMessage()); 551 System.out.println(e.getMessage());
564 } 552 }
565 } else if (".ldr".equals(suffix)) { 553 } else if (".ldr".equals(suffix)) {
...@@ -576,7 +564,7 @@ public class CourseController extends BaseController { ...@@ -576,7 +564,7 @@ public class CourseController extends BaseController {
576 fileBytes = byteArrayOutputStream.toByteArray(); 564 fileBytes = byteArrayOutputStream.toByteArray();
577 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 565 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
578 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 566 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
579 } catch (IOException e) { 567 } catch (Exception e) {
580 System.out.println(e.getMessage()); 568 System.out.println(e.getMessage());
581 } 569 }
582 } 570 }
...@@ -626,7 +614,7 @@ public class CourseController extends BaseController { ...@@ -626,7 +614,7 @@ public class CourseController extends BaseController {
626 fileBytes = byteArrayOutputStream.toByteArray(); 614 fileBytes = byteArrayOutputStream.toByteArray();
627 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 615 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
628 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 616 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
629 } catch (IOException e) { 617 } catch (Exception e) {
630 System.out.println(e.getMessage()); 618 System.out.println(e.getMessage());
631 } 619 }
632 } else if (".mp4".equals(suffix)) { 620 } else if (".mp4".equals(suffix)) {
...@@ -643,7 +631,7 @@ public class CourseController extends BaseController { ...@@ -643,7 +631,7 @@ public class CourseController extends BaseController {
643 fileBytes = byteArrayOutputStream.toByteArray(); 631 fileBytes = byteArrayOutputStream.toByteArray();
644 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 632 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
645 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 633 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
646 } catch (IOException e) { 634 } catch (Exception e) {
647 System.out.println(e.getMessage()); 635 System.out.println(e.getMessage());
648 } 636 }
649 } else if (".json".equals(suffix)) { 637 } else if (".json".equals(suffix)) {
...@@ -660,7 +648,7 @@ public class CourseController extends BaseController { ...@@ -660,7 +648,7 @@ public class CourseController extends BaseController {
660 fileBytes = byteArrayOutputStream.toByteArray(); 648 fileBytes = byteArrayOutputStream.toByteArray();
661 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 649 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
662 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 650 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
663 } catch (IOException e) { 651 } catch (Exception e) {
664 System.out.println(e.getMessage()); 652 System.out.println(e.getMessage());
665 } 653 }
666 } else if (".ldr".equals(suffix)) { 654 } else if (".ldr".equals(suffix)) {
...@@ -677,7 +665,7 @@ public class CourseController extends BaseController { ...@@ -677,7 +665,7 @@ public class CourseController extends BaseController {
677 fileBytes = byteArrayOutputStream.toByteArray(); 665 fileBytes = byteArrayOutputStream.toByteArray();
678 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 666 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
679 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 667 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
680 } catch (IOException e) { 668 } catch (Exception e) {
681 System.out.println(e.getMessage()); 669 System.out.println(e.getMessage());
682 } 670 }
683 } 671 }
...@@ -727,7 +715,7 @@ public class CourseController extends BaseController { ...@@ -727,7 +715,7 @@ public class CourseController extends BaseController {
727 fileBytes = byteArrayOutputStream.toByteArray(); 715 fileBytes = byteArrayOutputStream.toByteArray();
728 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 716 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
729 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); 717 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf");
730 } catch (IOException e) { 718 } catch (Exception e) {
731 System.out.println(e.getMessage()); 719 System.out.println(e.getMessage());
732 } 720 }
733 721
...@@ -745,7 +733,7 @@ public class CourseController extends BaseController { ...@@ -745,7 +733,7 @@ public class CourseController extends BaseController {
745 fileBytes = byteArrayOutputStream.toByteArray(); 733 fileBytes = byteArrayOutputStream.toByteArray();
746 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 734 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
747 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); 735 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4");
748 } catch (IOException e) { 736 } catch (Exception e) {
749 System.out.println(e.getMessage()); 737 System.out.println(e.getMessage());
750 } 738 }
751 739
...@@ -763,7 +751,7 @@ public class CourseController extends BaseController { ...@@ -763,7 +751,7 @@ public class CourseController extends BaseController {
763 fileBytes = byteArrayOutputStream.toByteArray(); 751 fileBytes = byteArrayOutputStream.toByteArray();
764 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 752 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
765 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 753 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
766 } catch (IOException e) { 754 } catch (Exception e) {
767 System.out.println(e.getMessage()); 755 System.out.println(e.getMessage());
768 } 756 }
769 757
...@@ -781,7 +769,7 @@ public class CourseController extends BaseController { ...@@ -781,7 +769,7 @@ public class CourseController extends BaseController {
781 fileBytes = byteArrayOutputStream.toByteArray(); 769 fileBytes = byteArrayOutputStream.toByteArray();
782 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 770 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
783 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 771 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
784 } catch (IOException e) { 772 } catch (Exception e) {
785 System.out.println(e.getMessage()); 773 System.out.println(e.getMessage());
786 } 774 }
787 775
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!