示例#1
0
        public string CreateDef(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);
            TongsDefinition tongsDefinition = JSONHelper.JSONToObject <TongsDefinition>(body);

            tongsDefinition.RecBy = user.Id;
            tongsDefinition       = fixtureService.createTongsDefinition(tongsDefinition);
            return(JSONHelper.ObjectToJSON(ResponseUtil.Ok(tongsDefinition)));
        }