public object GetUserData(int id) { string token = Request.Headers.Authorization == null ? "" : Request.Headers.Authorization.ToString(); //Logger.Info(Request.RequestUri + " || Method: " + Request.Method, Request.Headers.ToString(), id.ToString(), Level.INFO); ResponseDTO Response = new ResponseDTO(); ErrorDTO ErrorResponse = new ErrorDTO(); // CHECK token //if (ValidateToken(token)) //{ // Response = UserBUS.GetUserInfo(id); //} //else //{ // ErrorResponse.Code = 403; // ErrorResponse.Message = "Invalid Token"; // Response.Error = ErrorResponse; //} Response = UserBUS.GetUserInfo(id); return(Response); }
public object GetAccountLogin() { string token = Request.Headers.Authorization == null ? "" : Request.Headers.Authorization.ToString(); Logger.Info(Request.RequestUri + " || Method: " + Request.Method, Request.Headers.ToString(), null, Level.INFO); int id = ValidateToken(token); ResponseDTO Response = new ResponseDTO(); ErrorDTO ErrorResponse = new ErrorDTO(); Response = UserBUS.GetUserInfo(id); if (Response.Error == null) { return(Request.CreateResponse(HttpStatusCode.OK, Response)); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, Response)); } }