Prechádzať zdrojové kódy

修改全局变量的位置

chenweida 8 rokov pred
rodič
commit
bf188be236

+ 5 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/CommonContants.java

@ -5,6 +5,11 @@ package com.yihu.jw.restmodel.common;
 * 公共的常量类
 */
public class CommonContants {
    //微服务的id start
    public static final String svr_base = "svr-base";
    public static final String svr_gateway = "svr-gateway";
    public static final Integer common_error_code= -10000; //系统异常
    public static final Integer common_error_params_code= -10100; //接口入参异常

+ 0 - 4
web-gateway/src/main/java/com/yihu/jw/commnon/Contants.java

@ -6,11 +6,7 @@ package com.yihu.jw.commnon;
 */
public class Contants {
    //微服务的id start
    public static final String svr_base = "svr-base";
    public static final String svr_gateway = "svr-gateway";
    //微服务的id end
    public static final class patient {
        public static final String findByCode = "/patient/findByCode";
    }

+ 2 - 1
web-gateway/src/main/java/com/yihu/jw/fegin/PatientFegin.java

@ -3,6 +3,7 @@ package com.yihu.jw.fegin;
import com.yihu.jw.commnon.Contants;
import com.yihu.jw.fegin.fallback.PatientFeginFallback;
import com.yihu.jw.fegin.fallbackfactory.PatientFeginFallbackFactory;
import com.yihu.jw.restmodel.common.CommonContants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 * Created by chenweida on 2017/5/10.
 */
@FeignClient(
        name = Contants.svr_base // name值是eurika的实例名字
        name = CommonContants.svr_base // name值是eurika的实例名字
       // ,fallback = PatientFeginFallback.class// fallback是请求超时或者错误的回调函数
        ,fallbackFactory  =PatientFeginFallbackFactory.class
//        ,configuration =   //可以配置当个fegin的配置 例如禁用单个feign的hystrix