// POST /tbCatalogo/token/ public HttpResponseMessage Post(string token, [FromBody] tbCatalogo param) { tbLogAcessoUsuario log = new tbLogAcessoUsuario(); try { log = Bibliotecas.LogAcaoUsuario.New(token, JsonConvert.SerializeObject(param), "Post"); HttpResponseMessage retorno = new HttpResponseMessage(); if (Permissoes.Autenticado(token)) { short dados = GatewayTbCatalogo.Add(token, param); log.codResposta = (int)HttpStatusCode.OK; Bibliotecas.LogAcaoUsuario.Save(log); return(Request.CreateResponse <short>(HttpStatusCode.OK, dados)); } else { log.codResposta = (int)HttpStatusCode.Unauthorized; Bibliotecas.LogAcaoUsuario.Save(log); return(Request.CreateResponse(HttpStatusCode.Unauthorized)); } } catch (Exception e) { log.codResposta = (int)HttpStatusCode.InternalServerError; log.msgErro = e.Message; Bibliotecas.LogAcaoUsuario.Save(log); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }