public async Task <Result> Post([FromBody] WidgetCarouselParam model)
        {
            var widgetInstance = new WidgetInstance
            {
                Name         = model.Name,
                WidgetId     = (int)WidgetWithId.CarouselWidget,
                WidgetZoneId = model.WidgetZoneId,
                PublishStart = model.PublishStart,
                PublishEnd   = model.PublishEnd,
                DisplayOrder = model.DisplayOrder,
                Data         = JsonConvert.SerializeObject(model.Items)
            };

            _widgetInstanceRepository.Add(widgetInstance);
            await _widgetInstanceRepository.SaveChangesAsync();

            return(Result.Ok());
        }
        public async Task <Result> Put(int id, [FromBody] WidgetCarouselParam model)
        {
            var widgetInstance = await _widgetInstanceRepository.Query().FirstOrDefaultAsync(x => x.Id == id);

            if (widgetInstance == null)
            {
                return(Result.Fail("单据不存在"));
            }
            widgetInstance.Name         = model.Name;
            widgetInstance.PublishStart = model.PublishStart;
            widgetInstance.PublishEnd   = model.PublishEnd;
            widgetInstance.WidgetZoneId = model.WidgetZoneId;
            widgetInstance.DisplayOrder = model.DisplayOrder;
            widgetInstance.Data         = JsonConvert.SerializeObject(model.Items);
            widgetInstance.UpdatedOn    = DateTime.Now;
            await _widgetInstanceRepository.SaveChangesAsync();

            return(Result.Ok());
        }