青羊经侦大队-数据平台
安瑾然
2022-07-13 68985c22a03d280a96e89f4d0e67f144259fab92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.example.jz.controller;
 
import com.example.jz.exception.BusinessException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author 安瑾然
 * @data 2022/7/13 - 11:24 AM
 * @description
 */
@RestController("test")
@Api(value = "测试接口", tags = "测试接口")
public class TestController {
 
    @GetMapping("/business")
    @ApiOperation("业务异常测试")
    public String test() {
        throw new BusinessException("业务异常");
    }
 
    @GetMapping("/custom")
    @ApiOperation("通用异常测试")
    public String test2() {
        throw new NullPointerException("空指针异常");
    }
}