Quellcode durchsuchen

bugfix:添加异常获取

lyx vor 3 Monaten
Ursprung
Commit
d4a1354ab4

+ 6 - 6
alien-store/src/main/java/shop/alien/store/controller/LifeUserLearningVideoController.java

@@ -1,11 +1,7 @@
 package shop.alien.store.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
@@ -27,7 +23,11 @@ public class LifeUserLearningVideoController {
     @ApiOperationSupport(order = 1)
     @PostMapping("/add")
     public R<String> add(@RequestBody LifeUserLearningVideo lifeUserLearningVideo) {
-        return lifeUserLearningVideoService.add(lifeUserLearningVideo);
+        try {
+            return lifeUserLearningVideoService.add(lifeUserLearningVideo);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
     }
 
     @ApiOperation("根据ID删除学习视频")