|
@ -3,6 +3,9 @@ package com.yihu.jw.controller;
|
|
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
|
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
|
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
|
|
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
|
|
import com.yihu.jw.fegin.PatientFegin;
|
|
import com.yihu.jw.fegin.PatientFegin;
|
|
|
|
import com.yihu.jw.restmodel.exception.SystemException;
|
|
|
|
import com.yihu.jw.restmodel.exception.SecurityException;
|
|
|
|
import com.yihu.jw.restmodel.exception.business.ManageException;
|
|
import com.yihu.jw.version.ApiVersion;
|
|
import com.yihu.jw.version.ApiVersion;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@ -10,13 +13,8 @@ import io.swagger.annotations.ApiParam;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
|
import org.springframework.cloud.sleuth.Tracer;
|
|
import org.springframework.cloud.sleuth.Tracer;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
import org.springframework.web.context.annotation.SessionScope;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
@ -37,8 +35,18 @@ public class PatientController {
|
|
@GetMapping("/hello")
|
|
@GetMapping("/hello")
|
|
@ApiVersion(1)
|
|
@ApiVersion(1)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String hello1(HttpServletRequest request) {
|
|
|
|
System.out.println("haha1..........");
|
|
|
|
|
|
public String hello1(Integer id) throws Exception {
|
|
|
|
switch (id){
|
|
|
|
case 1:{
|
|
|
|
throw new ManageException("后台管理系统异常");
|
|
|
|
}
|
|
|
|
case 2:{
|
|
|
|
throw new SecurityException("权限异常");
|
|
|
|
}
|
|
|
|
case 3:{
|
|
|
|
throw new SystemException("后台系统异常");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
return "hello1";
|
|
return "hello1";
|
|
}
|
|
}
|
|
@ -46,7 +54,7 @@ public class PatientController {
|
|
@GetMapping("/hello")
|
|
@GetMapping("/hello")
|
|
@ApiVersion(2)
|
|
@ApiVersion(2)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String hello2(HttpServletRequest request) {
|
|
|
|
|
|
public String hello2(HttpServletRequest request) throws Exception {
|
|
System.out.println("haha2.........");
|
|
System.out.println("haha2.........");
|
|
return "hello2";
|
|
return "hello2";
|
|
}
|
|
}
|