public IActionResult Add([FromBody] ClientExerciseResult clientExerciseResult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var user_ID     = _jwtHandler.GetUserID(_httpContextAccessor.HttpContext);
            var planning_ID = clientExerciseResult.ExercisePlanning_ID;

            byte[] Recording = Helper.Compress(clientExerciseResult.Result);

            ExerciseResult exerciseResult = new ExerciseResult
            {
                Duration = clientExerciseResult.Duration,
                Score    = clientExerciseResult.Score,
                Result   = Recording,
            };

            _exerciseResultService.AddByPlanningID(exerciseResult, user_ID, planning_ID);

            return(NoContent());
        }
Beispiel #2
0
        public IActionResult GetByUserID()
        {
            var user_ID = _jwtHandler.GetUserID(_httpContextAccessor.HttpContext);

            return(Ok(_exerciseService.GetByUserID(user_ID)));
        }
        public IActionResult GetByID(long id)
        {
            var user_ID = _jwtHandler.GetUserID(_httpContextAccessor.HttpContext);

            return(Ok(_exercisePlanningService.GetByID(user_ID, id)));
        }