Exemplo n.º 1
0
 //添加
 public JsonResult Add(Enums.FavoritesType type, long contentId)
 {
     if (!serviceFavorites.IsExists(currentUser.UserId, type, contentId))
     {
         var model = new Favorites
         {
             Type      = type,
             ContentId = contentId,
             UserId    = currentUser.UserId,
             AddTime   = DateTime.Now
         };
         serviceFavorites.Add(model);
     }
     result.code = 1;
     return(Json(result));
 }
Exemplo n.º 2
0
 //删除
 public JsonResult Delete(Enums.FavoritesType type, long contentId)
 {
     serviceFavorites.Delete(currentUser.UserId, type, contentId);
     result.code = 1;
     return(Json(result));
 }