SceneApplication.java 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package com.fdkankan.scene;
  2. import com.fdkankan.scene.dto.TestDto;
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  6. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
  11. @RestController
  12. @EnableDiscoveryClient
  13. public class SceneApplication {
  14. public static void main(String[] args) {
  15. SpringApplication.run(SceneApplication.class, args);
  16. }
  17. @PostMapping("/test/test")
  18. public TestDto test(@RequestBody TestDto test){
  19. System.out.println("进入了");
  20. if(test.getName().equals("aaa")){
  21. // throw new BusinessException(1000,"asdfaswdfasdfsdf");
  22. int i = test.getId() / 0;
  23. }
  24. return test;
  25. }
  26. }