Esempio n. 1
0
        public async Task <IActionResult> GetMainPageMyPosts(MainPageRequest mainPageRequest)
        {
            var userName = User.Identity.Name;
            var posts    = await postService.GetMainPageMyPosts(mainPageRequest, userName);

            return(Ok(posts));
        }
        public void Handle()
        {
            this.calculator = new CorrelationCalculator();

            LoginRequest lr = new LoginRequest("viea16u008", "[password here]");

            lr.Perform();

            this.client = lr.Client;

            MainPageRequest mpr = new MainPageRequest(client);

            mpr.Perform();

            EUMainPageRequest eumpr = new EUMainPageRequest(client, mpr.EULink);

            eumpr.Perform();

            this.sessionCache = new SessionCache(this.client, eumpr.SessionLink);

            EUProgressPageRequest euppr = new EUProgressPageRequest(client, eumpr.ProgressLink);

            euppr.Perform();

            logger.Log("Начинаем...");

            var semesters = euppr.SemesterLinks;

            logger.SetStepsCount(semesters.Count - 1);

            foreach (var semester in semesters)
            {
                if (semester.Year > 2016)
                {
                    break;
                }

                HandleSemester(semester);
                logger.Step();
            }

            double result = calculator.ComputeCorrelation();

            // " (+1 это перекос в сторону отличных оценок у девушек, -1 - у парней)
            logger.LogCorrelation(result);
        }
Esempio n. 3
0
        public async Task <IActionResult> GetMainPageHome(MainPageRequest mainPageRequest)
        {
            var posts = await postService.GetMainPageHome(mainPageRequest);

            return(Ok(posts));
        }