瀏覽代碼

implement update

guochao 6 年之前
父節點
當前提交
d462137f68
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      site/src/main/java/com/mooctest/crowd/site/controller/TestController.java

+ 23 - 0
site/src/main/java/com/mooctest/crowd/site/controller/TestController.java

@@ -0,0 +1,23 @@
+package com.mooctest.crowd.site.controller;
+
+import com.mooctest.crowd.domain.exception.BaseException;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author: Diors.Po
+ * @Email: 171256175@qq.com
+ * @date 2019-07-26 22:25
+ */
+@RestController
+public class TestController {
+
+    @RequestMapping(value = "/exception/test/{type}", method = RequestMethod.GET)
+    public Object exceptionTest(@PathVariable("type") Integer type){
+        if (type == 1)
+            throw new BaseException();
+        else if (type == 2)
+            throw new RuntimeException();
+        return "Hello world!!!!";
+    }
+
+}