public string ScrapEntity(int id, string body) { string token = TokenHelper.GetTokenJson(HttpContext.Request.Headers["Authorization"]); TokenInfo tokenInfo = JSONHelper.JSONToObject <TokenInfo>(token); User p = new User(); p.Name = tokenInfo.UserName; User user = userService.getUserByName(p); Scrap scrap = JSONHelper.JSONToObject <Scrap>(body); scrap.Id = id; scrap.OperatorId = user.Id; Scrap res = fixtureService.ScrapRequest(scrap); if (res != null) { return(JSONHelper.ObjectToJSON(ResponseUtil.Ok(res))); } else { return(null); } }