东莞市连易网络科技有限公司
东莞市连易网络科技有限公司
  • 网站
  • 用户
  • 购物车
  • 购物车
  • 搜索
  • 网站
  • 用户
帮助
帮助
开发文档 审核/滥用管理
  • 用户文档
  • 开发文档
  • API文档
  • 提及
  • 标签
  • 更多
  • 取消
  • 新建
  • +开始
  • +UI 自定义
  • +外部集成
  • -插件/框架扩展
    • -插件
      • 异常和日志记录
      • 插件生命周期
      • -插件示例
        • 使用小组件从插件渲染内容
        • 公开数据给外部源
        • 公开配置选项
        • 创建动态
        • -创建自定义应用程序和内容
          • -向内容添加核心服务支持
            • 书签
            • 审核/滥用管理
            • 提及
            • 搜索
            • +标签
            • 点赞
            • 评论
        • 基于模板的电子邮件
        • 处理事件
        • 处理内容中的嵌入文件
        • 定义权限
        • 扩展规则支持
        • 文件交互
        • 文件查看器
        • 注册模板令牌
        • 管理依赖关系
        • 管理物理文件存储
        • 翻译插件文本
        • 通知
    • +设置开发环境
    • +进程 API

审核/滥用管理

滥用插件自动执行滥用检测,以防止垃圾信息或其他滥用进入平台。单个滥用检测器处理适用于其滥用检测逻辑的事件,并在检测到滥用时通知滥用服务。

IAbuseCheckingContentType 接口定义了支持滥用服务所需的方法。实现此服务的内容类型可以标记为滥用,如果添加了足够的标记,则可以将其隐藏,并使用滥用 UI 进行审核。

为什么我应该允许我的内容被标记为滥用?

帮助促使平台会员更诚信。那些对可疑内容负责的人会通过电子邮件发送他们,陈述他们的内容被视为滥用,并可以对电子邮件的质疑提出申诉。

创建滥用插件

在此示例中,我们基于应用程序/内容示例进行构建。请务必注意,可以在同一 IContentType 类中实现一个或多个核心服务。

我们采用了 IContentType 实现,并进一步扩展了 IAbuseCheckingContentType 接口。

using System;
using System.Collections.Generic;
using Limyee.Extensibility.Content.Version1;
using Limyee.Extensions.Lists.Data;
using IContent = Limyee.Extensibility.Content.Version1.IContent;

namespace Limyee.Extensions.Lists
{
    public interface ILinkItemContentType : IContentType, IAbuseCheckingContentType
    {
        IContentStateChanges _contentState = null;
        
        #region IPlugin
        
        //...
        
        #endregion
        
        #region IContentType

        //...

        #endregion
        
        #region IAbuseCheckingContentType
        
        //...
        
        #endregion
    }
}

当一段内容首次被标记为滥用时,将调用 ContentSuspectedAbusive 方法。这里的演示是暂时禁用内容。因此,我们将 LinkItem 的 IsEnabled 属性设置为 false;

public void ContentSuspectedAbusive(Guid abuseId, Guid contentId)
{
    var content = LinksData.GetLink(contentId);
    if (content == null) return;

    content.IsEnabled = false;
}

在通知用户其内容被标记后,他们可以对该操作提出申诉。如果审核员接受废除,他们可以批准内容并将其恢复到平台中。示例是执行 ContentFoundNotAbusive 方法并且 IsEnabled 标志设置回 true;

public void ContentFoundNotAbusive(Guid abuseId, Guid contentId)
{
    var content = LinksData.GetLink(contentId);
    if (content == null) return;

    content.IsEnabled = true;
}

另一方面,如果内容被认为不适合平台。然后调用 ContentConfirmedAbusive 方法,删除内容。

public void ContentConfirmedAbusive(Guid abuseId, Guid contentId)
{
    LinksData.DeleteLink(contentId);
}

在大多数情况下,当内容被标记为滥用时,您希望修剪滥用内容的结果集。为了使平台能够检索禁用的内容,需要 GetHiddenContent 方法。在这里是返回禁用内容。

public IContent GetHiddenContent(Guid contentId)
{
    return LinksData.GetLink(contentId);
}

下面是完整示例。

using System;
using System.Collections.Generic;
using Limyee.Extensibility.Content.Version1;
using Limyee.Extensions.Lists.Data;
using IContent = Limyee.Extensibility.Content.Version1.IContent;

namespace Samples.Links
{
    public class LinkItemContentType : IAbuseCheckingContentType
    {
        IContentStateChanges _contentState = null;

        #region IPlugin Members

        public string Description
        {
            get { return "Items in a Links collection"; }
        }

        public void Initialize()
        {
        
        }

        public string Name
        {
            get { return "Link Items"; }
        }
        
        #endregion

        #region IContentType Members

        public Guid[] ApplicationTypes
        {
            get { return new Guid[] { ContentTypes.LinksApplicationId }; }
        }

        public void AttachChangeEvents(IContentStateChanges stateChanges)
        {
            _contentState = stateChanges;
        }

        public Guid ContentTypeId
        {
            get { return ContentTypes.LinksItemId; }
        }

        public string ContentTypeName
        {
            get { return "Links Item"; }
        }

        public IContent Get(Guid contentId)
        {
            return LinksData.GetLink(contentId);
        }

        #endregion

        #region IAbuseCheckingContentType

        public List<int> GetReviewBoardUsers(Guid contentId)
        {
            //Deprecated: The service now uses the group or site Manage Abuse permission
            return null;
        }

        public bool CanUserReviewAppeals(Guid contentId, int userId)
        {
            //Deprecated: The service now uses the group or site Manage Abuse permission
            return false;
        }

        public void ContentSuspectedAbusive(Guid abuseId, Guid contentId)
        {
            var content = LinksData.GetLink(contentId);
            if (content == null) return;

            content.IsEnabled = false;
        }

        public void ContentFoundNotAbusive(Guid abuseId, Guid contentId)
        {
            var content = LinksData.GetLink(contentId);
            if (content == null) return;

            content.IsEnabled = true;
        }

        public void ContentConfirmedAbusive(Guid abuseId, Guid contentId)
        {
            LinksData.DeleteLink(contentId);
        }

        public IContent GetHiddenContent(Guid contentId)
        {
            return LinksData.GetLink(contentId);
        }

        #endregion
    }
}

  • 分享
  • 历史
  • 更多
  • 取消
相关
推荐
Copyright © 2021 东莞市连易网络科技有限公司. All rights reserved.
Powered by Limyee Commerce System(3.0.0). © 2014 - 2025 Limyee Inc.