青羊经侦大队-数据平台
baizonghao
2023-03-21 e0670c59089d8461b13b7f910fd538e9a5a6edef
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
30
31
32
33
34
package com.example.jz.controller;
 
import com.example.jz.auth.TokenJwtManager;
import com.example.jz.exception.BusinessException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
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 {
    @Autowired
    TokenJwtManager tokenJwtManager;
 
    @GetMapping("/business")
    @ApiOperation("业务异常测试")
    public String test() {
        return null;
    }
 
    @GetMapping("/custom")
    @ApiOperation("通用异常测试")
    public String test2() {
        throw new NullPointerException("空指针异常");
    }
}