feat(worker-platform): 商品名按来源追加可配置后缀
- 新增来源后缀配置(来源下拉、启停、备注,同一时间仅启用一个) - 管理端列表/详情与打手端列表/详情/大厅展示「商品名(后缀)」 - 打手端 DTO 透出 sourceProvider,仅展示,不改写商品名 - 新增来源选项接口与前后端单测
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
getAdminWorkerPlatformNotificationConfig,
|
||||
getAdminWorkerPlatformSummary,
|
||||
getAdminWorkerProductMatchConfig,
|
||||
getAdminWorkerProductNameSuffixConfig,
|
||||
listAdminKuaishouMatchSources,
|
||||
listAdminWorkCategories,
|
||||
listAdminWorkProductMatchLogs,
|
||||
@@ -20,6 +21,7 @@ import {
|
||||
listAdminWorkProductRuleMappings,
|
||||
listAdminWorkProductRules,
|
||||
listAdminWorkerLevels,
|
||||
listWorkerProductNameSuffixSourceOptions,
|
||||
saveAdminWorkCategory,
|
||||
saveAdminWorkProductRule,
|
||||
saveAdminWorkProductRuleMapping,
|
||||
@@ -29,6 +31,7 @@ import {
|
||||
saveAdminWorkerLevel,
|
||||
saveAdminWorkerPlatformNotificationConfig,
|
||||
saveAdminWorkerProductMatchConfig,
|
||||
saveAdminWorkerProductNameSuffixConfig,
|
||||
syncAdminWorkProductRulePrice,
|
||||
testAdminKuaishouProductMatch,
|
||||
testAdminProductMatchByOrderItem,
|
||||
@@ -309,6 +312,44 @@ router.post(
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/worker-platform/product-name-suffix',
|
||||
requireAdminRoles(['admin', 'operator', 'support']),
|
||||
createJsonHandler(() => getAdminWorkerProductNameSuffixConfig(), {
|
||||
successMessage: 'ok',
|
||||
errorMessage: '读取商品名来源后缀配置失败',
|
||||
scope: '[admin/worker-platform/product-name-suffix]',
|
||||
}),
|
||||
)
|
||||
|
||||
// 下拉选项来自工单资料里的来源标识,低频配置,给浏览器 5 分钟缓存。
|
||||
router.get(
|
||||
'/worker-platform/product-name-suffix/sources',
|
||||
requireAdminRoles(['admin', 'operator', 'support']),
|
||||
setHttpCache(300),
|
||||
createJsonHandler(() => listWorkerProductNameSuffixSourceOptions(), {
|
||||
successMessage: 'ok',
|
||||
errorMessage: '读取工单来源选项失败',
|
||||
scope: '[admin/worker-platform/product-name-suffix/sources]',
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/product-name-suffix',
|
||||
requireAdminRoles(['admin']),
|
||||
createJsonHandler((req) => saveAdminWorkerProductNameSuffixConfig(req.body || {}), {
|
||||
successMessage: '商品名来源后缀已保存',
|
||||
errorMessage: '保存商品名来源后缀失败',
|
||||
scope: '[admin/worker-platform/product-name-suffix]',
|
||||
audit: (_req, data) => ({
|
||||
action: 'worker_product_name_suffix_saved',
|
||||
targetType: 'worker_product_name_suffix',
|
||||
targetId: 'worker_product_name_suffix',
|
||||
data: data && typeof data === 'object' ? (data as Record<string, unknown>) : {},
|
||||
}),
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/product-match-config',
|
||||
requireAdminRoles(['admin', 'operator']),
|
||||
|
||||
Reference in New Issue
Block a user