Пример #1
0
        /// <summary>
        /// 根据名称获取跟踪策略
        /// 这里的实现是直接创建跟踪策略
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public async Task <TrackerStrategy> QueryByName(string name)
        {
            TrackerStrategy strategy = new TrackerStrategy()
            {
                ID   = Guid.NewGuid(),
                Name = name
            };

            return(await Task.FromResult(strategy));
        }
Пример #2
0
        public async Task Exit(TrackerStrategy trackerStrategy, RequestTracker tracker)
        {
            var service = await GetStrategyService(trackerStrategy.Name);

            await service.Exit(tracker);
        }
Пример #3
0
        public async Task <ValidateResult> Access(TrackerStrategy trackerStrategy, RequestTracker tracker)
        {
            var service = await GetStrategyService(trackerStrategy.Name);

            return(await service.Access(tracker));
        }