diff --git a/.gitignore b/.gitignore index 4ce6fdd..15b6fe3 100755 --- a/.gitignore +++ b/.gitignore @@ -337,4 +337,7 @@ ASALocalRun/ .localhistory/ # BeatPulse healthcheck temp database -healthchecksdb \ No newline at end of file +healthchecksdb +/CMS/JXCMS.CMS.Movie/test +*mono_crash.mem.*.blob +test diff --git a/CMS/JXCMS.CMS.Movie/Admin/Controllers/CollectionController.cs b/CMS/JXCMS.CMS.Movie/Admin/Controllers/CollectionController.cs index d1bd04d..c77f2a5 100644 --- a/CMS/JXCMS.CMS.Movie/Admin/Controllers/CollectionController.cs +++ b/CMS/JXCMS.CMS.Movie/Admin/Controllers/CollectionController.cs @@ -1,3 +1,4 @@ +using System.Linq; using JXCMS.CMS.Attribute; using JXCMS.CMS.Movie.Entity; using Microsoft.AspNetCore.Mvc; @@ -8,11 +9,14 @@ namespace JXCMS.CMS.Admin.Controllers [AdminAuthentication] public class CollectionController : Controller { - public IActionResult Index() + public IActionResult Index(int pageNumber = 1, int pageSize = 20) { ViewBag.title = "采集地址"; - var website = WebSiteEntity.Select.ToList(); + var website = WebSiteEntity.Select.Count(out long count).Page(pageNumber, pageSize).ToList(); ViewBag.website = website; + ViewBag.count = count; + ViewBag.pageNumber = pageNumber; + ViewBag.totlePage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1; return View(); } @@ -25,6 +29,27 @@ namespace JXCMS.CMS.Admin.Controllers public IActionResult DeleteWebSite(int id) { + WebSiteEntity.Find(id).Delete(); + return Redirect(Url.Action("Index")); + } + + public IActionResult DeleteWebSiteBatch(int[] ids) + { + WebSiteEntity.Where(x => ids.Contains(x.Id)).ToDelete().ExecuteAffrows(); + return Redirect(Url.Action("Index")); + } + + public IActionResult EnableWebSiteBatch(int[] ids) + { + WebSiteEntity.Where(x => ids.Contains(x.Id)).ToUpdate() + .Set(y => y.IsEnable, true).ExecuteAffrows(); + return Redirect(Url.Action("Index")); + } + + public IActionResult DisableWebSiteBatch(int[] ids) + { + WebSiteEntity.Where(x => ids.Contains(x.Id)).ToUpdate() + .Set(y => y.IsEnable, false).ExecuteAffrows(); return Redirect(Url.Action("Index")); } @@ -43,5 +68,7 @@ namespace JXCMS.CMS.Admin.Controllers } return View(webSiteEntity); } + + } } \ No newline at end of file diff --git a/CMS/JXCMS.CMS.Movie/Admin/Views/Collection/Index.cshtml b/CMS/JXCMS.CMS.Movie/Admin/Views/Collection/Index.cshtml index d808921..b0c74b3 100644 --- a/CMS/JXCMS.CMS.Movie/Admin/Views/Collection/Index.cshtml +++ b/CMS/JXCMS.CMS.Movie/Admin/Views/Collection/Index.cshtml @@ -25,101 +25,96 @@
- - | -网站名称 | -网站url | -采集cron | -状态 | -操作 | -
---|