public override object Add(Attachment model) { #region 黄图检查 Utility.AliOss.ImagePornResult imgResult = Utility.AliOss.AliyunApi.GetImageDetectionRate(model.filepath); if (imgResult != null && imgResult.Rate >= WebConfigBLL.ImageDetectionRate) {//超过这个分值的,直接全站拉黑 if (0 != model.fid && 0 != model.userid) { var usermodel = new OAuthUserBll(model.fid).GetUserByCache(model.userid); log4net.LogHelper.WriteInfo(this.GetType(), $"黄图{model.filepath},拉黑:{usermodel.Id}"); new WholeBlackBLL().Add(usermodel.Id, 1, $"黄图自动拉黑{model.filepath}"); } } //超过60分,帖子状态变为机器检测状态 if (imgResult != null && imgResult.Rate >= 60) { model.imgwith = -1; } var score = Utility.Qcloud.QcloudAPI.FileDetection(model.filepath); if (score >= WebConfigBLL.ImageDetectionRate) {//超过这个分值的,直接全站拉黑 if (0 != model.fid && 0 != model.userid) { var usermodel = new OAuthUserBll(model.fid).GetUserByCache(model.userid); log4net.LogHelper.WriteInfo(this.GetType(), $"黄图{model.filepath},拉黑:{usermodel.Id}"); new WholeBlackBLL().Add(usermodel.Id, 1, $"黄图自动拉黑{model.filepath}"); } } //超过60分,帖子状态变为机器检测状态 if (score >= 60) { model.imgwith = -1; } #endregion //log4net.LogHelper.WriteInfo(this.GetType(), imgResult.Rate.ToString()); return(base.Add(model)); }
public List <OAuthUser> GetCommentRewoardListTop(int count, int commentId, int minisnsId) { OAuthUserBll ubll = new OAuthUserBll(minisnsId); return(ubll.GetListBySql(string.Format("select u.* from rewardorder r LEFT JOIN {2} u on (r.rewardFromUserId=u.Id) where r.`status`=1 and r.commentId ={0} order by r.addTime desc limit {1}", commentId, count, ubll.TableName))); }