Example #1
0
        public async Task <CSSResponse> CreateLog(CreateLogDTO logDetails)
        {
            var userPermissions = await _repository.UserPermissions.GetUserPermissionsBySso(new UserPermissionSsoDetails { Sso = logDetails.SSO });

            if (userPermissions?.Count > 0)
            {
                return(new CSSResponse($"SSO '{logDetails.SSO}' not exists.", HttpStatusCode.Conflict));
            }
            var logRequest = _mapper.Map <Log>(logDetails);

            _repository.Log.CreateLog(logRequest);

            await _repository.SaveAsync();



            return(new CSSResponse("", HttpStatusCode.Created));
        }
Example #2
0
        public async Task <IActionResult> CreateLogger([FromBody] CreateLogDTO createLog)
        {
            var result = await _iLogService.CreateLog(createLog);

            return(StatusCode((int)result.Code, result.Value));
        }
        public async Task <IActionResult> CreateLogAsync([FromRoute] Guid levantamentoId, [FromBody] CreateLogDTO createLog)
        {
            var createLogCommand = new CreateLogCommand(levantamentoId, createLog.Long, createLog.Lat, createLog.Rate, createLog.Speed, createLog.DateOccurred);
            var result           = await _mediator.SendCommand <CreateLogResponse>(createLogCommand);

            return(Response(result));
        }