feat(douyin-mashida): 彻底重构优化配置面板,支持一键填域名/订阅推送/网关自检并剔除冗余字段
- 剔除历史旧卡券时代废弃的 afterVerifyLink(去使用链接)与 afterVerifyMessage(通知正文) - 面板新增一键填入当前域名、向开放平台一键订阅推送、停用推送以及网关连通与签名自检功能 - 业务配置重构为「基础接入与商户凭据」、「买家 H5 直充与发货私信」、「高级网关设置」三层清晰结构 - 后端与前端服务新增 /douyin-mashida/subscribe 与 /douyin-mashida/test-gateway 统一接口 验证方式:前端类型检查与打包构建通过,全量 132 项前端单测与 674 项后端单测全部通过
This commit is contained in:
@@ -3,6 +3,8 @@ import { Router } from 'express'
|
||||
import {
|
||||
getAdminDouyinMashidaConfig,
|
||||
saveAdminDouyinMashidaConfig,
|
||||
subscribeAdminDouyinMashidaPush,
|
||||
testAdminDouyinMashidaGateway,
|
||||
} from '../../../services/admin/platform-config/douyin-mashida-service.js'
|
||||
import { createJsonHandler } from '../session.js'
|
||||
import type { JsonRecord } from '../../../types/json.js'
|
||||
@@ -49,4 +51,35 @@ router.post(
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/douyin-mashida/subscribe',
|
||||
createJsonHandler((req) => subscribeAdminDouyinMashidaPush(req.body as JsonRecord), {
|
||||
successMessage: '平台推送设置成功',
|
||||
errorMessage: '平台推送设置失败',
|
||||
scope: '[admin/platform-config/douyin-mashida/subscribe]',
|
||||
audit: (req, _data) => {
|
||||
const payload = req.body as JsonRecord
|
||||
return {
|
||||
action: 'platform_douyin_mashida_subscribe_updated',
|
||||
targetType: 'platform_config',
|
||||
targetId: 'douyin_mashida',
|
||||
data: {
|
||||
disable: Boolean(payload?.disable),
|
||||
messageUrl: String(payload?.messageUrl || payload?.publicUrl || ''),
|
||||
},
|
||||
}
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/douyin-mashida/test-gateway',
|
||||
createJsonHandler(() => testAdminDouyinMashidaGateway(), {
|
||||
successMessage: '网关测试完成',
|
||||
errorMessage: '网关测试失败',
|
||||
scope: '[admin/platform-config/douyin-mashida/test-gateway]',
|
||||
}),
|
||||
)
|
||||
|
||||
export default router
|
||||
|
||||
|
||||
Reference in New Issue
Block a user