Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
44 lines
2.2 KiB
PHP
44 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* @package AKSRT
|
|
*/
|
|
|
|
namespace AKSRT\Admin\Schema;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
class SchemaExtensionsAudit {
|
|
|
|
public static function build(): array {
|
|
return [
|
|
'key' => 'audit',
|
|
'title' => 'API内容审核',
|
|
'version' => '1.0.0',
|
|
'option_key' => 'aksrt_settings',
|
|
'groups' => [
|
|
['key' => 'provider', 'title' => '审核接口', 'fields' => [
|
|
['key' => 'content_audit_enabled', 'label' => '启用内容审核', 'type' => 'switch', 'default' => false],
|
|
['key' => 'content_audit_provider', 'label' => '审核服务商', 'type' => 'radio', 'default' => 'baidu', 'options' => [
|
|
['label' => '百度内容审核', 'value' => 'baidu'],
|
|
['label' => '关闭审核接口', 'value' => 'null'],
|
|
]],
|
|
['key' => 'content_audit_api_key', 'label' => 'API Key', 'type' => 'input', 'default' => ''],
|
|
['key' => 'content_audit_api_secret', 'label' => 'Secret Key', 'type' => 'input', 'default' => ''],
|
|
]],
|
|
['key' => 'scope', 'title' => '审核范围', 'fields' => [
|
|
['key' => 'content_audit_text_enabled', 'label' => '文本审核', 'type' => 'switch', 'default' => true],
|
|
['key' => 'content_audit_image_enabled', 'label' => '图片审核', 'type' => 'switch', 'default' => false],
|
|
['key' => 'audit_bbs_term', 'label' => '审核论坛分类', 'type' => 'switch', 'default' => false],
|
|
]],
|
|
['key' => 'fallback', 'title' => '失败策略', 'fields' => [
|
|
['key' => 'content_audit_on_failure', 'label' => '审核失败时', 'type' => 'radio', 'default' => 'allow', 'options' => [
|
|
['label' => '放行', 'value' => 'allow'],
|
|
['label' => '拦截', 'value' => 'block'],
|
|
]],
|
|
['key' => 'content_audit_log_enabled', 'label' => '记录审核日志', 'type' => 'switch', 'default' => true],
|
|
]],
|
|
],
|
|
];
|
|
}
|
|
}
|