Browse Source

implement update

guochao 6 years ago
parent
commit
d462137f68

+ 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!!!!";
+    }
+
+}