完善接单平台通知配置
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Router } from 'express'
|
||||
|
||||
import { listAdminPendingNotifications } from '../../services/admin/admin-notification-service.js'
|
||||
import { createJsonHandler, requireAdminRoles } from './session.js'
|
||||
|
||||
const router = Router()
|
||||
|
||||
router.get(
|
||||
'/notifications',
|
||||
requireAdminRoles(['admin', 'operator', 'support']),
|
||||
createJsonHandler((req) => listAdminPendingNotifications(Number(req.query.limit || 20)), {
|
||||
successMessage: 'ok',
|
||||
errorMessage: '读取后台待办失败',
|
||||
scope: '[admin/notifications]',
|
||||
}),
|
||||
)
|
||||
|
||||
export default router
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
deleteAdminWorkOrder,
|
||||
deleteAdminWorkerLevel,
|
||||
getAdminWorkerFinanceConfig,
|
||||
getAdminWorkerPlatformNotificationConfig,
|
||||
getAdminWorkerPlatformSummary,
|
||||
getAdminWorkOrderEvents,
|
||||
getAdminWorkOrderSharing,
|
||||
@@ -31,6 +32,7 @@ import {
|
||||
resolveAdminProblemWorkOrder,
|
||||
reviewAdminWorkerUser,
|
||||
saveAdminWorkerFinanceConfig,
|
||||
saveAdminWorkerPlatformNotificationConfig,
|
||||
saveAdminWorkerWithdrawalAccount,
|
||||
saveAdminWorkCategory,
|
||||
saveAdminWorkProductRule,
|
||||
@@ -289,6 +291,32 @@ router.post(
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/worker-platform/notification-config',
|
||||
requireAdminRoles(['admin', 'operator']),
|
||||
createJsonHandler(() => getAdminWorkerPlatformNotificationConfig(), {
|
||||
successMessage: 'ok',
|
||||
errorMessage: '读取通知配置失败',
|
||||
scope: '[admin/worker-platform/notification-config]',
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/notification-config',
|
||||
requireAdminRoles(['admin']),
|
||||
createJsonHandler((req) => saveAdminWorkerPlatformNotificationConfig(req.body || {}), {
|
||||
successMessage: '通知配置已保存',
|
||||
errorMessage: '保存通知配置失败',
|
||||
scope: '[admin/worker-platform/notification-config]',
|
||||
audit: (_req, data) => ({
|
||||
action: 'worker_platform_notification_config_saved',
|
||||
targetType: 'worker_platform_notification_config',
|
||||
targetId: 'worker_platform_notifications',
|
||||
data: data && typeof data === 'object' ? (data as Record<string, unknown>) : {},
|
||||
}),
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/worker-platform/finance-requests',
|
||||
requireAdminRoles(['admin', 'operator', 'support']),
|
||||
|
||||
Reference in New Issue
Block a user