src/ZKEACMS.SectionWidget/Controllers/SectionContentVideoController.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/* http://www.zkea.net/
* Copyright (c) ZKEASOFT. All rights reserved.
* http://www.zkea.net/licenses */
using ZKEACMS.SectionWidget.Models;
using ZKEACMS.SectionWidget.Service;
using Easy.Constant;
using Microsoft.AspNetCore.Mvc;
using Easy.Mvc.Authorize;
namespace ZKEACMS.SectionWidget.Controllers
{
public class SectionContentVideoController : Controller
{
private readonly ISectionContentProviderService _sectionContentProviderService;
public SectionContentVideoController(ISectionContentProviderService sectionContentProviderService)
{
_sectionContentProviderService = sectionContentProviderService;
}
[DefaultAuthorize]
public ActionResult Create(string sectionGroupId, string sectionWidgetId)
{
return View("Form", new SectionContentVideo
{
SectionGroupId = sectionGroupId,
SectionWidgetId = sectionWidgetId,
ActionType = ActionType.Create
});
}
[DefaultAuthorize]
public ActionResult Edit(string Id)
{
var content = _sectionContentProviderService.GetContent(Id);
content.ActionType = ActionType.Update;
return View("Form", content);
}
[HttpPost, DefaultAuthorize]
public ActionResult Save(SectionContentVideo content)
{
if (!ModelState.IsValid)
{
return View("Form", content);
}
if (content.ActionType == ActionType.Create)
{
_sectionContentProviderService.Add(content);
}
else
{
_sectionContentProviderService.Update(content);
}
ViewBag.Close = true;
return View("Form", content);
}
[DefaultAuthorize]
public JsonResult Delete(string Id)
{
_sectionContentProviderService.Remove(Id);
return Json(true);
后面还有 8 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。