public void TestMethod_Update()
        {
            LessonUnitBll bll = new LessonUnitBll();

            DtoLessonUnit unit = new DtoLessonUnit();

            unit.Id         = 10000;
            unit.CourseId   = 9999;
            unit.LessonId   = 9999;
            unit.Index      = 100;
            unit.Name       = $"测试内容了";
            unit.Screenshot = "testurl";
            unit.Status     = 0;
            unit.Steps      = new List <Step>();
            unit.Steps.Add(new Step
            {
                id      = 0,
                StepNum = 0,
                Actions = new List <StepAction>()
                {
                    new SetTitle()
                    {
                        Actionid = "asdfgh", Text = "test", Align = "left", Color = "#ffffff", ActionNum = 0, InType = "none", Size = "small", X = 102.3435, Y = 123.2342
                    }
                }
            });
            bll.Update(unit);
        }
        [ValidateInput(false)]//不做html验证
        public JsonResult SetPage(string pagestr)
        {
            LessonUnitBll bll      = new LessonUnitBll();
            Page          pageInfo = new Page();

            #region 解析数据
            JObject obj       = JsonConvert.DeserializeObject(pagestr) as JObject;
            string  base64Str = obj["thumbnail"].ToString().Split(',')[1];
            pageInfo.id      = Convert.ToInt32(obj["id"]);
            pageInfo.pageNum = Convert.ToInt32(obj["pageNum"]);
            pageInfo.name    = obj["name"].ToString();

            string thumbnailPath     = "UnitThumbnail";          //文件路径
            string thumbnailFileName = $"unit{pageInfo.id}.png"; //文件名称

            new Thread(() =>
            {
                byte[] arr              = Convert.FromBase64String(base64Str);
                MemoryStream ms         = new MemoryStream(arr);
                FileManageClient client = new FileManageClient(ConfigurationManager.AppSettings["uploadUrl"]);
                var response            = client.UploadCoverage(thumbnailFileName, ms, ConfigurationManager.AppSettings["OssSubject"], thumbnailPath, true);
            }).Start();                                                   //开启线程上传缩略图片

            pageInfo.thumbnail = $"/{thumbnailPath}/{thumbnailFileName}"; //拼接存储路径
            pageInfo.steps     = new List <Models.CurriculumSetViewModel.Step>();

            JArray steps = JsonConvert.DeserializeObject(obj["steps"].ToString()) as JArray;
            foreach (var s in steps)
            {
                Models.CurriculumSetViewModel.Step step = new Models.CurriculumSetViewModel.Step();
                step.stepNum = Convert.ToInt32(s["stepNum"]);
                step.actions = new List <ActionBase>();

                JArray actions = JsonConvert.DeserializeObject(s["actions"].ToString()) as JArray;
                foreach (var a in actions)
                {
                    step.actions.Add(ActionTranslator.JsonToViewData(a.ToString()));
                }
                pageInfo.steps.Add(step);
            }

            #endregion 解析数据
            int coins     = 0;
            var stepsData = pageInfo.steps.Select(s => new Domain.JsonEntity.UnitStep.Step()
            {
                id      = s.id,
                StepNum = s.stepNum,
                Actions = s.actions.Select(a => ActionTranslator.ViewDataToData(a, ref coins)).ToList()
            }).ToList();
            //修改数据
            bll.Update(new DtoLessonUnit
            {
                Id         = pageInfo.id,
                Name       = pageInfo.name,
                Screenshot = pageInfo.thumbnail,
                Status     = 0,
                Index      = pageInfo.pageNum,
                Steps      = stepsData,
                Coins      = coins
            });
            return(Json(new JsonResponse <string> {
                State = true, ErrorCode = 0, ErrorMsg = "", Data = ""
            }));
        }