Exemplo n.º 1
0
        List <QueryAdvResponse> QueryComplexAdv(QueryAdvRequest request)
        {
            AdvDao     dao       = new AdvDao();
            uint       timestamp = request.CreationTime != 0 ? request.CreationTime : Util.ToTimestamp(DateTime.Now);
            List <Adv> list      = dao.GetByCtime(timestamp);
            List <QueryAdvResponse> responses = new List <QueryAdvResponse>();

            foreach (var adv in list)
            {
                OrcaAdv          orca_adv = AdvManager.Get(adv.AdvId);
                QueryAdvResponse response = new QueryAdvResponse
                {
                    Adv = new OrcaAdv
                    {
                        AdvId    = adv.AdvId,
                        DivPaper = orca_adv.DivPaper
                    }
                };
                if (request.Resolution == QueryAdvRequest.Types.Resolution.Res4To3)
                {
                    response.Adv.WallPaper4To3 = orca_adv.WallPaper4To3;
                }
                if (request.Resolution == QueryAdvRequest.Types.Resolution.Res16To9)
                {
                    response.Adv.WallPaper16To9 = orca_adv.WallPaper16To9;
                }
                responses.Add(response);
            }
            return(responses);
        }
Exemplo n.º 2
0
        List <QueryAdvResponse> QuerySimpleAdv(QueryAdvRequest request)
        {
            AdvDao     dao  = new AdvDao();
            List <Adv> list = request.CreationTime != 0 ? dao.GetByCtime(request.CreationTime) : dao.GetAll();
            List <QueryAdvResponse> responses = new List <QueryAdvResponse>();

            foreach (var adv in list)
            {
                QueryAdvResponse response = new QueryAdvResponse
                {
                    Adv = AdvManager.Get(adv.AdvId)
                };
                responses.Add(response);
            }
            return(responses);
        }