public async Task <ActionResult> SaveFriendLink([FromBody] FriendLinkEntity param)
        {
            param.src         = System.Web.HttpUtility.HtmlEncode(param.src);
            param.portrait    = System.Web.HttpUtility.HtmlEncode(param.portrait);
            param.description = System.Web.HttpUtility.HtmlEncode(param.description);
            param.title       = System.Web.HttpUtility.HtmlEncode(param.title);
            param.createDate  = DateTime.Now;
            param.isShow      = false;
            var flag = await _friendLinkService.AddEntityAsync(param);

            return(Ok(flag));
        }
示例#2
0
        public async Task <ActionResult> AddFriendLink(FriendLink param)
        {
            string str;
            int    Code;

            param.Friendlink           = System.Web.HttpUtility.HtmlEncode(param.Friendlink);
            param.FriendlinkImage      = System.Web.HttpUtility.HtmlEncode(param.FriendlinkImage);
            param.FriendlinkIntroduce  = System.Web.HttpUtility.HtmlEncode(param.FriendlinkIntroduce);
            param.FriendlinkTitle      = System.Web.HttpUtility.HtmlEncode(param.FriendlinkTitle);
            param.FriendlinkCreateTime = DateTime.Now;
            param.IsShow = 0;
            Code         = await friendLinkSerivce.AddEntityAsync(param) ? 200 : 500;

            str = Code == 200 ? "申请成功" : "申请失败";
            return(Ok(new { code = Code, msg = str }));
        }