Пример #1
0
        public async Task <Resp> GetDetailAsync(DetailSource source)
        {
            Detail.IGetDetail detail = source switch
            {
                DetailSource.Admin => new Detail.FromAdmin(),
                DetailSource.Client => new Detail.FromClient(),
                _ => throw new ArgumentException(),
            };
            var r = await detail.GetAnswerDetailAsync(Id);

            return(r);
        }
Пример #2
0
        /// <summary>
        /// 获取详情
        /// </summary>
        /// <param name="source"></param>
        /// <param name="page">答案的分页</param>
        /// <returns></returns>
        public async Task <Resp> GetDetailAsync(DetailSource source, Paginator page)
        {
            CheckEmpty();

            Detail.IGetQuestionDetail detail = source switch
            {
                DetailSource.Admin => new Detail.DetailForAdmin(),
                DetailSource.Client => new Detail.DetailForClient(),
                DetailSource.Report => new Detail.DetailForReport(),
                _ => throw new ArgumentException(),
            };

            return(await detail.GetDetailAsync(Id, page));
        }