/// <summary> /// Run. /// </summary> public void Run() { var distributeNow = Distribute; this.Distribute = null; distributeNow.Distribute(this); // clear distribute in case we're submitting to cluster. That's a lot of command line junk to send to the cluster for no reason! this.Distribute = distributeNow; }
/// <summary> /// 分发API请求 /// </summary> /// <param name="para">开发平台查询参数</param> public static IDistribute Distribute(string module) { IDistribute distributeSystem = null; switch (module.ToLower()) { //系统配置信息模块 case "core": distributeSystem = new V1.Core.Distribute(); break; default: break; } return(distributeSystem); }
/// <summary> /// 分发API请求 /// </summary> /// <param name="para">开发平台查询参数</param> private IResultResponse Distribute(SysParameter para) { if (string.IsNullOrEmpty(para.Method)) { return(ResultResponse.ExceptionResult("提交参数不正确,Method参数不正确.")); } IDistribute distributeSystem = null; string module = ""; Regex reSysDistribute = new Regex(@"^(?<module>[^\.]+)\.(?<other>[\S\s]*?)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline); Match mSys = reSysDistribute.Match(para.Method); if (!mSys.Success) { return(ResultResponse.ExceptionResult("action 参数错误")); } //string platform = mSys.Groups["platform"].Value.ToLower(); module = mSys.Groups["module"].Value.ToLower(); #region 版本分发处理 string version = para.Version ?? "1.0"; switch (version) { case "1.0": distributeSystem = V1.API.Distribute(module); break; default: //默认API 1.0通道 如果在所有版本中都找不到,使用默认的 distributeSystem = V1.API.Distribute(module); break; } #endregion if (distributeSystem == null) { return(ResultResponse.ExceptionResult("提交参数不正确,没有找到名称为:“" + module + "”的接口处理模块")); } else { return(distributeSystem.Process(para)); } }
public static void DistributeVipOrder(this IDistribute <Order> distribute, Order order) { }
public static void DistributeVipOrder(this IDistribute <IOrder> distribute, IOrder vipOrder) { Console.WriteLine("DistributeVipOrder"); }
public ProductCollection(IDistribute distribute) { this._distribute = distribute; }