Beispiel #1
0
        /// <summary>
        /// 添加回复
        /// </summary>
        /// <returns></returns>
        public JsonResult AddDynamicComment(DynamicPostReq parame)
        {
            if (string.IsNullOrWhiteSpace(parame.detail))
            {
                return(Json(new { status = 0, msg = "参数错误" }));
            }
            PublicUserModel loginUser   = this.GetLoginUser();
            DynamicModel    dynamicItem = new DynamicModel()
            {
                UserId         = loginUser.UserID,
                ImageList      = jss.Deserialize <List <DynamicImage> >(parame.ImageList),
                DynamicContent = parame.detail,
                Id             = parame.replyId,
                ReplyCommentId = parame.replyCommentId
            };
            int dynamicReplayId = dynamicBll.DynamicCommentAdd(dynamicItem);

            return(Json(new { status = dynamicReplayId, msg = "评论成功" }));
        }
Beispiel #2
0
        public ApiResponse AddDynamicComment([FromBody] DynamicPostReq parame)
        {
            if (string.IsNullOrWhiteSpace(parame.detail))
            {
                return(new ApiResponse(Metas.Content_Null));
            }
            Credential loginUser = Request.GetCredential();

            List <DynamicImage> ImageList   = !string.IsNullOrEmpty(parame.ImageList) ? jss.Deserialize <List <DynamicImage> >(parame.ImageList) : new List <DynamicImage>();
            DynamicModel        dynamicItem = new DynamicModel()
            {
                UserId         = loginUser.UserID,
                ImageList      = ImageList,
                DynamicContent = parame.detail,
                Id             = parame.DynamicId,
                ReplyCommentId = parame.CommentId
            };
            int dynamicReplayId = dynamicBll.DynamicCommentAdd(dynamicItem);

            return(new ApiResponse(Metas.SUCCESS, new { CommentId = dynamicReplayId }));
        }
Beispiel #3
0
        /// <summary>
        /// 添加动态
        /// </summary>
        /// <param name="parame"></param>
        /// <param name="ImageList"></param>
        /// <returns></returns>
        public JsonResult AddDynamic(DynamicPostReq parame)
        {
            if (string.IsNullOrEmpty(parame.detail))
            {
                return(Json(new { status = -1 }));
            }

            PublicUserModel     loginUser   = this.GetLoginUser();
            List <DynamicImage> ImageList   = jss.Deserialize <List <DynamicImage> >(parame.ImageList);
            DynamicModel        dynamicItem = new DynamicModel()
            {
                UserId         = loginUser.UserID,
                ImageList      = ImageList,
                DynamicContent = parame.detail
            };
            int dynamicId = dynamicBll.DynamicAdd(dynamicItem);

            dynamicItem.Id       = dynamicId;
            dynamicItem.UserName = loginUser.Name;
            dynamicItem.Portrait = loginUser.Portrait;
            dynamicItem.AddTime  = DateTime.Now;
            return(Json(new { status = 1, data = FormatDyamic(dynamicItem, ImageList, loginUser.UserID) }));
        }
Beispiel #4
0
        public ApiResponse AddDynamic([FromBody] DynamicPostReq parame)
        {
            if (string.IsNullOrEmpty(parame.detail))
            {
                return(new ApiResponse(Metas.Content_Null));
            }
            Credential loginUser = Request.GetCredential();

            List <DynamicImage> ImageList   = !string.IsNullOrEmpty(parame.ImageList)?jss.Deserialize <List <DynamicImage> >(parame.ImageList):new List <DynamicImage>();
            DynamicModel        dynamicItem = new DynamicModel()
            {
                UserId         = loginUser.UserID,
                ImageList      = ImageList,
                DynamicContent = parame.detail
            };
            int dynamicId = dynamicBll.DynamicAdd(dynamicItem);

            dynamicItem.Id       = dynamicId;
            dynamicItem.UserName = loginUser.Name;
            dynamicItem.Portrait = loginUser.Icon;
            dynamicItem.AddTime  = DateTime.Now;

            return(new ApiResponse(Metas.SUCCESS, FormatDyamic(dynamicItem, ImageList, new List <DynamicModel>(), loginUser.UserID)));
        }