Esempio n. 1
0
        public IActionResult AllCards(DashboardRequest.AllCards model)
        {
            var data = _dashboardService.GetDashboard(User.GetUserId(), model);

            return(Ok(new General.ResponseResult {
                Data = data
            }));
        }
Esempio n. 2
0
        public DashboardResponse.AllCards GetDashboard(int userId, DashboardRequest.AllCards model)
        {
            DashboardResponse.AllCards response = new DashboardResponse.AllCards();

            response.ChartData      = GetChartCard(userId, model.ChartData);
            response.LearnedWords   = GetLearnedWordsCard(userId, model.LearnedWords);
            response.ProgressRate   = GetProgressRate(userId);
            response.TotalSentences = GetSentencesCard(userId, model.TotalSentences);
            response.TotalWords     = GetTotalWordsCard(userId, model.TotalWords);

            return(response);
        }