feat(douyin-mashida): 彻底重构优化配置面板,支持一键填域名/订阅推送/网关自检并剔除冗余字段
- 剔除历史旧卡券时代废弃的 afterVerifyLink(去使用链接)与 afterVerifyMessage(通知正文) - 面板新增一键填入当前域名、向开放平台一键订阅推送、停用推送以及网关连通与签名自检功能 - 业务配置重构为「基础接入与商户凭据」、「买家 H5 直充与发货私信」、「高级网关设置」三层清晰结构 - 后端与前端服务新增 /douyin-mashida/subscribe 与 /douyin-mashida/test-gateway 统一接口 验证方式:前端类型检查与打包构建通过,全量 132 项前端单测与 674 项后端单测全部通过
This commit is contained in:
@@ -146,6 +146,35 @@ export async function sendDouyinMashidaOrderMessage(
|
||||
})
|
||||
}
|
||||
|
||||
/** 消息推送配置(向平台订阅/停用推送):对应开放平台 message.config */
|
||||
export async function configureDouyinMashidaMessage(
|
||||
input: {
|
||||
status: number
|
||||
messageUrl?: string | undefined
|
||||
topics?: string | undefined
|
||||
} & DouyinMashidaCallOptions,
|
||||
): Promise<JsonObject> {
|
||||
const params: Record<string, string> = {
|
||||
status: String(input.status),
|
||||
}
|
||||
if (input.messageUrl) {
|
||||
params.message_url = input.messageUrl
|
||||
}
|
||||
if (input.topics) {
|
||||
params.topics = input.topics
|
||||
}
|
||||
|
||||
const response = await douyinMashidaGatewayRequest({
|
||||
method: 'message.config',
|
||||
params,
|
||||
config: input.config,
|
||||
timeoutMs: input.timeoutMs,
|
||||
})
|
||||
|
||||
return isPlainObject(response) ? response : {}
|
||||
}
|
||||
|
||||
function isPlainObject(value: unknown): value is JsonObject {
|
||||
return Object.prototype.toString.call(value) === '[object Object]'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user