Example #1
0
        public string ILikeThis(HttpContext context)
        {
            int id  = 0;
            int uid = 0;

            if (int.TryParse(context.Request.Form["_id"], out id) && int.TryParse(context.Request.Form["_uid"], out uid))
            {
                BCtrl_Comment bll    = new BCtrl_Comment();
                int           result = bll.ILikeThis(id, uid);
                if (result > 0)
                {
                    return(string.Format(Entity.G.JSON_OK_STATE_STRING, "评论点赞成功"));
                }
                else if (result == -2)
                {
                    return(string.Format(Entity.G.JSON_OTHER_STATE_STRING, "-2", "已经点赞"));
                }
                else
                {
                    return(string.Format(Entity.G.JSON_ERROR_STATE_STRING, "评论点赞失败"));
                }
            }
            else
            {
                return(string.Format(Entity.G.JSON_PMSERROR_STATE_STRING, "获取参数失败"));
            }
        }
Example #2
0
        public string DeleteComment(HttpContext context)
        {
            int id  = 0;
            int uid = 0;

            if (int.TryParse(context.Request.Form["_id"], out id) && int.TryParse(context.Request.Form["_uid"], out uid))
            {
                BCtrl_Comment bll = new BCtrl_Comment();
                BCtrl_MobileMessage.Instance.Relate_Delete(id); // 删除  与我相关 的数据
                if (bll.DeleteComment(id, uid))
                {
                    return(string.Format(Entity.G.JSON_OK_STATE_STRING, "删除评论成功"));
                }
                else
                {
                    return(string.Format(Entity.G.JSON_ERROR_STATE_STRING, "删除评论失败"));
                }
            }
            else
            {
                return(string.Format(Entity.G.JSON_PMSERROR_STATE_STRING, "获取参数失败"));
            }
        }
Example #3
0
        public void Execute(IJobExecutionContext context)
        {
            BCtrl_WordCheck wcBll    = new BCtrl_WordCheck();
            List <string>   wordList = wcBll.GetWordStringList();

            if (wordList != null)
            {
                //获取需要检测的内容
                BCtrl_Comment bll = new BCtrl_Comment();

                try
                {
                    //构建两个table 一个成功,一个失败
                    //利用sqlbukcopy入库,然后执行批量更新数据
                    DataTable returnTable = new Common().GetDataTable();

                    SqlDataReader reader = bll.GetWillCheckCommentReader();
                    while (reader.Read())
                    {
                        DataRow drn = returnTable.NewRow();
                        drn["ID"]          = int.Parse(reader["ID"].ToString());
                        drn["ContentType"] = int.Parse(reader["ContentType"].ToString());

                        string ws = "";
                        foreach (string word in wordList)
                        {
                            if (reader["Content"].ToString().Contains(word))
                            {
                                ws += word + ",";
                            }
                        }
                        ws = ws.TrimEnd(',');
                        if (string.IsNullOrEmpty(ws))
                        {
                            drn["CheckTypeID"] = 1;
                        }
                        else
                        {
                            drn["CheckTypeID"] = -1;
                        }
                        drn["WordsInfo"] = ws;

                        returnTable.Rows.Add(drn);
                    }
                    reader.Close();

                    bll.WriteBack(returnTable);
                }
                catch (Exception ex)
                {
                    Utils.LogEntity log = new Utils.LogEntity()
                    {
                        LogContent = ex.Message,
                        LogMeta    = "",
                        ExInfo     = "",
                        LogTime    = DateTime.Now,
                        LogTitle   = "敏感词检测异常",
                        LogTypeID  = 5,
                        UnqiueID   = new Guid(),
                        UserID     = 0
                    };
                    Utils.LogUtil.WriteLog(log);
                }
            }
        }