Discourse API 返回字段的描述

如果您的站点已安装 Data Explorer 插件,只需将鼠标悬停在条目上,即可查看所用数字代码的详细信息:

例如,将鼠标悬停在 postspost_type 字段上会显示以下值:

  • regular: 1
  • moderator action: 2
  • small action: 3
  • whisper: 4

除了 Data Explorer 之外,我知道的另一个获取此类信息的地方是 Discourse 源代码。例如,要查找 user_actions 表中每个 action_type 的含义,请在 Rails 控制台中输入 UserAction.types。这将返回以下值:

{:like=>1, :was_liked=>2, :bookmark=>3, :new_topic=>4, :reply=>5, :response=>6, :mention=>7, :quote=>9, :edit=>11, :new_private_message=>12, :got_private_message=>13, :solved=>15, :assigned=>16}

3 个赞