コード例 #1
0
ファイル: StdRequest.cs プロジェクト: yorkart/NDWR
 public StdRequest(HttpRequest request)
 {
     this.request = request;
     serviceScanner = GlobalConfig.Instance.ServiceScanner;
     // 收集参数
     parseBatchId();
     parseTransportMode();
     parseInvocations();
 }
コード例 #2
0
ファイル: GlobalConfig.cs プロジェクト: yorkart/NDWR
        public void DefaultConfig(string assembly,ILogFactory factory)
        {
            // 首先要设置日志工厂
            if (factory != null) {
                LogFactory = factory;
            }
            // Json序列化
            JsonSerializer = new NewtonsoftJsonSerializerImpl();
            // 服务扫描
            ServiceScanner = new AttributeServiceScanner(assembly);

            // 添加基础类型参数映射
            Interceptors.Add(new ExceptionInterceptor()); // 异常捕获
            Interceptors.Add(new ParamConvertInterceptor()); // 参数转换
            Interceptors.Add(new DownloadInterceptor()); // 下载拦截
        }