public ActionResult Add(string t, string k, string d, string imageurl, string u, string um) { string result = "发布失败"; if (Session["UserId"] == null) { return Content("长时间未操作,请重新登录。"); } if (!string.IsNullOrEmpty(t) && !string.IsNullOrEmpty(k) && !string.IsNullOrEmpty(d) && !string.IsNullOrEmpty(imageurl) && !string.IsNullOrEmpty(u) && !string.IsNullOrEmpty(um)) { Video video = new Video(); video.Title = t; video.Keywords = k; video.Description = d; video.Thumbnail = imageurl; video.Url = u; video.UrlM = um; video.InsertTime = DateTime.Now; video.ViewTime = 0; VideoService videoService = new VideoService(); if (videoService.AddVideo(video)) { result = "success"; } } else { result = "必填项不能为空"; } return Content(result); }
public async Task <int> AddVideo([FromBody] NewVideo video) { return(await m_VideoService.AddVideo(video, await GetCurrentUserAsync())); }
public Result AddVideo(VideoModel model) { return(_service.AddVideo(model)); }