package com.fdkankan.scene; import com.fdkankan.common.config.ShiroConfig; import com.fdkankan.common.exception.GlobalExceptionHandler; import com.fdkankan.common.jwt.JwtFilter; import com.fdkankan.common.response.ResultData; import com.fdkankan.scene.dto.TestDto; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Bean; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @RestController @EnableDiscoveryClient public class SceneApplication { public static void main(String[] args) { SpringApplication.run(SceneApplication.class, args); } /** * 注入全局异常处理器 */ @Bean public GlobalExceptionHandler globalExceptionHandler(){ return new GlobalExceptionHandler(); } @PostMapping("/api/user/test/test") public ResultData test(@RequestBody TestDto test){ System.out.println("进入了"); if(test.getName().equals("aaa")){ // throw new BusinessException(1000,"asdfaswdfasdfsdf"); int i = test.getId() / 0; } return ResultData.ok(test); } }