fix(v0.11+): P0 修复 3 处端点错误 (假 PASS)
Phase 1 审计发现 3 处 P0 端点错误 (AI 调用返 success 但实际不生效):
1. integration emailTest
- v0.10 错误: /message/SendMessageConfig/testSendConfig
- v0.11+ 正确: /message/AccountConfig/testSendMail
- 重构: 先拉 config, 再走 testConfig({...config, testSendEmail, testEmailTitle, testEmailContent, testType})
2. integration smsTest
- v0.10 错误: /system/SmsTemplate/testSent
- v0.11+ 正确: /message/AccountConfig/testSendSms
- 重构: 同上模式 (testPhone + testType)
3. integration webhookTest
- v0.10 错误: /message/SendMessageConfig/testSendConfig
- v0.11+ 正确: /message/AccountConfig/testSendWebhook
- 重构: 支持 --configId 或 --url 两种模式
4. msg templateCreate
- v0.10 错误: /api/system/MessageTemplate
- v0.11+ 正确: /api/message/MessageTemplateConfig
端点来源: web/api/msgCenter/accountConfig.ts:29 testConfig() + msgTemplate.ts:14 create()
影响: 这是 cmd-review/ 23 报告中 P0 必修项, 修复后避免 AI 误判 PASS
Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
b9c9e318af
commit
90a8b4eecb
4 files changed
+169
-67
No files matched your search
@@ -1,7 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* commands/integration/emailtest.ts — 邮件测试发送
|
* commands/integration/emailtest.ts — 邮件测试发送
|
||||||
*
|
*
|
||||||
* 走 JNPF SendMessageConfig/testSendConfig 端点
|
* 走 JNPF AccountConfig 端点 (web 真实端点, v0.11+ P0 修复)
|
||||||
|
*
|
||||||
|
* 修复历史:
|
||||||
|
* - v0.10 错误端点: /message/SendMessageConfig/testSendConfig (假 PASS)
|
||||||
|
* - v0.11+ 正确端点: /message/AccountConfig/testSendMail (web Test.vue 验证)
|
||||||
*/
|
*/
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import { JnpfClient } from '../../core/client.ts'
|
import { JnpfClient } from '../../core/client.ts'
|
||||||
@@ -11,35 +15,59 @@ import { log } from '../../core/log.ts'
|
|||||||
interface EmailTestOpts {
|
interface EmailTestOpts {
|
||||||
configId: string
|
configId: string
|
||||||
email?: string
|
email?: string
|
||||||
|
title?: string
|
||||||
|
content?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildIntegrationEmailTestCommand(): Command {
|
export function buildIntegrationEmailTestCommand(): Command {
|
||||||
const cmd = new Command('emailTest')
|
const cmd = new Command('emailTest')
|
||||||
.alias('email-test')
|
.alias('email-test')
|
||||||
.description('邮件测试发送 (走 SendMessageConfig/testSendConfig)')
|
.description('邮件测试发送 (走 AccountConfig/testSendMail)')
|
||||||
.requiredOption('--configId <id>', '发送配置 id')
|
.requiredOption('--configId <id>', 'AccountConfig id (从 integration configList 获取)')
|
||||||
.option('--email <e>', '目标邮箱')
|
.option('--email <e>', '目标邮箱 (必填, 必填收件人)', '[email protected]')
|
||||||
|
.option('--title <t>', '测试邮件标题', 'Test from dacli')
|
||||||
|
.option('--content <c>', '测试邮件内容', 'This is a test email sent by dacli.')
|
||||||
.action(async (opts: EmailTestOpts) => {
|
.action(async (opts: EmailTestOpts) => {
|
||||||
const c = await JnpfClient.fromToken()
|
const c = await JnpfClient.fromToken()
|
||||||
const r = await c.postJson('/message/SendMessageConfig/testSendConfig', {
|
|
||||||
id: opts.configId,
|
// 1. 拉取 config 详情 (AccountConfig/testSendMail 需要 config dataForm)
|
||||||
email: opts.email,
|
const configR = await c.get<Record<string, unknown>>(`/message/AccountConfig/${opts.configId}`)
|
||||||
})
|
if (configR.code !== 200 || !configR.data) {
|
||||||
|
log.error(`integration emailtest 配置拉取失败: ${configR.msg || 'id 不存在'}`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
const config = configR.data
|
||||||
|
|
||||||
|
// 2. 拼装 test 请求 (web Test.vue 模式: {...config, testSendEmail, testEmailTitle, testEmailContent, testType})
|
||||||
|
const body = {
|
||||||
|
...config,
|
||||||
|
testSendEmail: [opts.email],
|
||||||
|
testEmailTitle: opts.title,
|
||||||
|
testEmailContent: opts.content,
|
||||||
|
testType: 'testSendMail',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 走 AccountConfig/testSendMail (web 端真实端点)
|
||||||
|
const r = await c.postJson('/message/AccountConfig/testSendMail', body)
|
||||||
if (r.code !== 200) {
|
if (r.code !== 200) {
|
||||||
log.error(`integration emailtest 失败: ${r.msg}`)
|
log.error(`integration emailtest 失败: ${r.msg}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
log.info(`✓ 邮件测试发送 OK (configId=${opts.configId})`)
|
log.info(`✓ 邮件测试发送 OK (configId=${opts.configId}, to=${opts.email})`)
|
||||||
})
|
})
|
||||||
installAiHelpHook(cmd, {
|
installAiHelpHook(cmd, {
|
||||||
purpose: '邮件测试发送 (决策 8: 邮件通道)',
|
purpose: '邮件测试发送 (修复 v0.10 假 PASS 端点)',
|
||||||
required: { '--configId': '发送配置 id' },
|
required: { '--configId': 'AccountConfig id' },
|
||||||
optional: { '--email': '目标邮箱' },
|
optional: {
|
||||||
|
'--email': '目标邮箱',
|
||||||
|
'--title': '测试邮件标题',
|
||||||
|
'--content': '测试邮件内容',
|
||||||
|
},
|
||||||
example: 'dacli integration emailtest --configId=123 [email protected]',
|
example: 'dacli integration emailtest --configId=123 [email protected]',
|
||||||
source: {
|
source: {
|
||||||
web: 'web/apps/jnpf-web-apps-main/src/views/integrationCenter/email/index.vue',
|
web: 'web/apps/jnpf-web-apps-main/src/views/integrationCenter/email/Test.vue',
|
||||||
api: 'POST /api/message/SendMessageConfig/testSendConfig',
|
api: 'POST /api/message/AccountConfig/testSendMail',
|
||||||
ref: 'doc/v0.8-endpoints.md §3.3',
|
ref: 'web/.../api/msgCenter/accountConfig.ts:29 testConfig()',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return cmd
|
return cmd
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* commands/integration/smstest.ts — 短信测试发送
|
* commands/integration/smstest.ts — 短信测试发送
|
||||||
*
|
*
|
||||||
* API: POST /api/system/SmsTemplate/testSent
|
* 走 JNPF AccountConfig 端点 (web 真实端点, v0.11+ P0 修复)
|
||||||
|
*
|
||||||
|
* 修复历史:
|
||||||
|
* - v0.10 错误端点: /system/SmsTemplate/testSent (与 web 端不一致)
|
||||||
|
* - v0.11+ 正确端点: /message/AccountConfig/testSendSms (web api/msgCenter/accountConfig.ts)
|
||||||
*/
|
*/
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import { JnpfClient } from '../../core/client.ts'
|
import { JnpfClient } from '../../core/client.ts'
|
||||||
@@ -9,40 +13,61 @@ import { installAiHelpHook } from '../../core/help.ts'
|
|||||||
import { log } from '../../core/log.ts'
|
import { log } from '../../core/log.ts'
|
||||||
|
|
||||||
interface SmsTestOpts {
|
interface SmsTestOpts {
|
||||||
templateId: string
|
configId: string
|
||||||
phone?: string
|
phone?: string
|
||||||
json?: boolean
|
templateId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildIntegrationSmsTestCommand(): Command {
|
export function buildIntegrationSmsTestCommand(): Command {
|
||||||
const cmd = new Command('smsTest')
|
const cmd = new Command('smsTest')
|
||||||
.alias('sms-test')
|
.alias('sms-test')
|
||||||
.description('短信测试发送 (走 SmsTemplate/testSent 端点)')
|
.description('短信测试发送 (走 AccountConfig/testSendSms)')
|
||||||
.requiredOption('--templateId <id>', '短信模板 id')
|
.requiredOption('--configId <id>', 'AccountConfig id')
|
||||||
.option('--phone <n>', '目标手机号')
|
.option('--phone <n>', '目标手机号', '13800138000')
|
||||||
|
.option('--templateId <t>', '短信模板 ID (覆盖 config 默认模板)')
|
||||||
.action(async (opts: SmsTestOpts) => {
|
.action(async (opts: SmsTestOpts) => {
|
||||||
const c = await JnpfClient.fromToken()
|
const c = await JnpfClient.fromToken()
|
||||||
const r = await c.postJson('/system/SmsTemplate/testSent', {
|
|
||||||
templateId: opts.templateId,
|
// 1. 拉取 config 详情
|
||||||
phone: opts.phone,
|
const configR = await c.get<Record<string, unknown>>(`/message/AccountConfig/${opts.configId}`)
|
||||||
})
|
if (configR.code !== 200 || !configR.data) {
|
||||||
|
log.error(`integration smstest 配置拉取失败: ${configR.msg || 'id 不存在'}`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
const config = configR.data
|
||||||
|
|
||||||
|
// 2. 拼装 test 请求
|
||||||
|
const body: Record<string, unknown> = {
|
||||||
|
...config,
|
||||||
|
testPhone: opts.phone,
|
||||||
|
testType: 'testSendSms',
|
||||||
|
}
|
||||||
|
if (opts.templateId) {
|
||||||
|
body.testTemplateId = opts.templateId
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 走 AccountConfig/testSendSms
|
||||||
|
const r = await c.postJson('/message/AccountConfig/testSendSms', body)
|
||||||
if (r.code !== 200) {
|
if (r.code !== 200) {
|
||||||
log.error(`integration smstest 失败: ${r.msg}`)
|
log.error(`integration smstest 失败: ${r.msg}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
log.info(`✓ 短信测试发送 OK (templateId=${opts.templateId})`)
|
log.info(`✓ 短信测试发送 OK (configId=${opts.configId}, to=${opts.phone})`)
|
||||||
})
|
})
|
||||||
installAiHelpHook(cmd, {
|
installAiHelpHook(cmd, {
|
||||||
purpose: '短信测试发送 (决策 8: 短信通道)',
|
purpose: '短信测试发送 (修复 v0.10 假 PASS 端点)',
|
||||||
required: { '--templateId': '短信模板 id' },
|
required: { '--configId': 'AccountConfig id' },
|
||||||
optional: { '--phone': '目标手机号' },
|
optional: {
|
||||||
example: 'dacli integration smstest --templateId=123 --phone=13800138000',
|
'--phone': '目标手机号',
|
||||||
source: {
|
'--templateId': '短信模板 ID',
|
||||||
web: 'web/apps/jnpf-web-apps-main/src/views/integrationCenter/sms/index.vue',
|
|
||||||
api: 'POST /api/system/SmsTemplate/testSent',
|
|
||||||
ref: 'doc/v0.8-endpoints.md §3.3',
|
|
||||||
},
|
},
|
||||||
notes: ['**决策 8**: 短信走 integrationCenter/sms, 不用 msgCenter'],
|
example: 'dacli integration smstest --configId=123 --phone=13800138000',
|
||||||
|
source: {
|
||||||
|
web: 'web/apps/jnpf-web-apps-main/src/api/msgCenter/accountConfig.ts:29 testConfig()',
|
||||||
|
api: 'POST /api/message/AccountConfig/testSendSms',
|
||||||
|
ref: 'dacli/docs/cmd-review/integration.md §端点错误',
|
||||||
|
},
|
||||||
|
notes: ['v0.10 端点 `/system/SmsTemplate/testSent` 已被 web 端废弃, v0.11+ 修复'],
|
||||||
})
|
})
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* commands/integration/webhooktest.ts — Webhook 测试发送
|
* commands/integration/webhooktest.ts — Webhook 测试发送
|
||||||
|
*
|
||||||
|
* 走 JNPF AccountConfig 端点 (web 真实端点, v0.11+ P0 修复)
|
||||||
|
*
|
||||||
|
* 修复历史:
|
||||||
|
* - v0.10 错误端点: /message/SendMessageConfig/testSendConfig (web 端不存在 webhook 测试)
|
||||||
|
* - v0.11+ 正确端点: /message/AccountConfig/testSendWebhook
|
||||||
*/
|
*/
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import { JnpfClient } from '../../core/client.ts'
|
import { JnpfClient } from '../../core/client.ts'
|
||||||
@@ -7,48 +13,76 @@ import { installAiHelpHook } from '../../core/help.ts'
|
|||||||
import { log } from '../../core/log.ts'
|
import { log } from '../../core/log.ts'
|
||||||
|
|
||||||
interface WebhookTestOpts {
|
interface WebhookTestOpts {
|
||||||
url: string
|
configId?: string
|
||||||
|
url?: string
|
||||||
payload?: string
|
payload?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildIntegrationWebhookTestCommand(): Command {
|
export function buildIntegrationWebhookTestCommand(): Command {
|
||||||
const cmd = new Command('webhookTest')
|
const cmd = new Command('webhookTest')
|
||||||
.alias('webhook-test')
|
.alias('webhook-test')
|
||||||
.description('Webhook 测试发送')
|
.description('Webhook 测试发送 (走 AccountConfig/testSendWebhook)')
|
||||||
.requiredOption('--url <u>', '目标 URL')
|
.option('--configId <id>', 'AccountConfig id (已配置 webhook 账号)')
|
||||||
.option('--payload <p>', 'JSON payload (字符串)')
|
.option('--url <u>', '临时 webhook URL (不依赖 config, 单独测试)')
|
||||||
|
.option('--payload <p>', 'JSON payload (字符串)', '{}')
|
||||||
.action(async (opts: WebhookTestOpts) => {
|
.action(async (opts: WebhookTestOpts) => {
|
||||||
|
if (!opts.configId && !opts.url) {
|
||||||
|
log.error('必须传 --configId 或 --url 之一')
|
||||||
|
process.exit(2)
|
||||||
|
}
|
||||||
|
|
||||||
const c = await JnpfClient.fromToken()
|
const c = await JnpfClient.fromToken()
|
||||||
let payload: unknown = { test: true }
|
let body: Record<string, unknown>
|
||||||
|
|
||||||
|
if (opts.configId) {
|
||||||
|
// 走 AccountConfig 模式: 拉取 config + 测试
|
||||||
|
const configR = await c.get<Record<string, unknown>>(`/message/AccountConfig/${opts.configId}`)
|
||||||
|
if (configR.code !== 200 || !configR.data) {
|
||||||
|
log.error(`integration webhooktest 配置拉取失败: ${configR.msg || 'id 不存在'}`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
body = {
|
||||||
|
...configR.data,
|
||||||
|
testType: 'testSendWebhook',
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 直发模式: 仅传 url + payload
|
||||||
|
body = {
|
||||||
|
webhookUrl: opts.url,
|
||||||
|
testType: 'testSendWebhook',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.payload) {
|
if (opts.payload) {
|
||||||
try {
|
try {
|
||||||
payload = JSON.parse(opts.payload)
|
body = { ...body, ...JSON.parse(opts.payload) }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(`--payload JSON 解析失败: ${(e as Error).message}`)
|
log.error(`--payload JSON 解析失败: ${(e as Error).message}`)
|
||||||
process.exit(2)
|
process.exit(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 走 SendMessageConfig/testSendConfig (channel=webhook)
|
|
||||||
const r = await c.postJson('/message/SendMessageConfig/testSendConfig', {
|
const r = await c.postJson('/message/AccountConfig/testSendWebhook', body)
|
||||||
url: opts.url,
|
|
||||||
channel: 'webhook',
|
|
||||||
payload,
|
|
||||||
})
|
|
||||||
if (r.code !== 200) {
|
if (r.code !== 200) {
|
||||||
log.error(`integration webhooktest 失败: ${r.msg}`)
|
log.error(`integration webhooktest 失败: ${r.msg}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
log.info(`✓ Webhook 测试发送 OK (url=${opts.url})`)
|
log.info(`✓ Webhook 测试发送 OK (configId=${opts.configId || '-'}, url=${opts.url || '(from config)'})`)
|
||||||
})
|
})
|
||||||
installAiHelpHook(cmd, {
|
installAiHelpHook(cmd, {
|
||||||
purpose: 'Webhook 测试发送',
|
purpose: 'Webhook 测试发送 (修复 v0.10 假 PASS 端点)',
|
||||||
required: { '--url': '目标 URL' },
|
required: {},
|
||||||
optional: { '--payload': 'JSON payload' },
|
optional: {
|
||||||
example: 'dacli integration webhooktest --url=https://example.com/hook --payload=\'{"key":"value"}\'',
|
'--configId': 'AccountConfig id (已配置 webhook 账号)',
|
||||||
|
'--url': '临时 webhook URL (不依赖 config)',
|
||||||
|
'--payload': 'JSON payload (字符串)',
|
||||||
|
},
|
||||||
|
example:
|
||||||
|
'dacli integration webhooktest --configId=123\n dacli integration webhooktest --url=https://example.com/hook --payload=\'{"key":"value"}\'',
|
||||||
source: {
|
source: {
|
||||||
web: 'web/apps/jnpf-web-apps-main/src/views/integrationCenter/webhook/index.vue',
|
web: 'web/apps/jnpf-web-apps-main/src/api/msgCenter/accountConfig.ts:29 testConfig()',
|
||||||
api: 'POST /api/message/SendMessageConfig/testSendConfig',
|
api: 'POST /api/message/AccountConfig/testSendWebhook',
|
||||||
ref: 'doc/v0.8-endpoints.md §3.3',
|
ref: 'dacli/docs/cmd-review/integration.md §端点错误',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return cmd
|
return cmd
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* commands/msg/templatecreate.ts — 新建消息模板
|
* commands/msg/templatecreate.ts — 新建消息模板
|
||||||
*
|
*
|
||||||
* API: POST /api/system/MessageTemplate
|
* 走 JNPF MessageTemplateConfig 端点 (web 真实端点, v0.11+ P0 修复)
|
||||||
|
*
|
||||||
|
* 修复历史:
|
||||||
|
* - v0.10 错误端点: /api/system/MessageTemplate (web 端不存在)
|
||||||
|
* - v0.11+ 正确端点: /api/message/MessageTemplateConfig (web api/msgCenter/msgTemplate.ts)
|
||||||
*/
|
*/
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import { JnpfClient } from '../../core/client.ts'
|
import { JnpfClient } from '../../core/client.ts'
|
||||||
@@ -11,26 +15,32 @@ import { log, printJson } from '../../core/log.ts'
|
|||||||
interface CreateOpts {
|
interface CreateOpts {
|
||||||
fullName: string
|
fullName: string
|
||||||
enCode: string
|
enCode: string
|
||||||
|
category?: string
|
||||||
|
content?: string
|
||||||
json?: boolean
|
json?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildMsgTemplateCreateCommand(): Command {
|
export function buildMsgTemplateCreateCommand(): Command {
|
||||||
const cmd = new Command('templateCreate')
|
const cmd = new Command('templateCreate')
|
||||||
.alias('template-create')
|
.alias('template-create')
|
||||||
.description('新建消息模板')
|
.description('新建消息模板 (走 MessageTemplateConfig)')
|
||||||
.requiredOption('--fullName <name>', '模板名称')
|
.requiredOption('--fullName <name>', '模板名称')
|
||||||
.requiredOption('--enCode <code>', '模板编码')
|
.requiredOption('--enCode <code>', '模板编码 (全平台唯一)')
|
||||||
|
.option('--category <c>', '分类 (1=系统 2=业务)', '1')
|
||||||
|
.option('--content <text>', '模板内容 (可选)')
|
||||||
.option('--json', '原始 JSON 输出', false)
|
.option('--json', '原始 JSON 输出', false)
|
||||||
.action(async (opts: CreateOpts) => {
|
.action(async (opts: CreateOpts) => {
|
||||||
const c = await JnpfClient.fromToken()
|
const c = await JnpfClient.fromToken()
|
||||||
const body = {
|
const body = {
|
||||||
fullName: opts.fullName,
|
fullName: opts.fullName,
|
||||||
enCode: opts.enCode,
|
enCode: opts.enCode,
|
||||||
category: '1', // 1=系统 2=业务
|
category: opts.category || '1',
|
||||||
enabledMark: 1,
|
enabledMark: 1,
|
||||||
sortCode: 0,
|
sortCode: 0,
|
||||||
|
...(opts.content ? { content: opts.content } : {}),
|
||||||
}
|
}
|
||||||
const r = await c.postJson<{ id?: string }>('/system/MessageTemplate', body)
|
// web 端真实端点: /api/message/MessageTemplateConfig
|
||||||
|
const r = await c.postJson<{ id?: string }>('/message/MessageTemplateConfig', body)
|
||||||
if (r.code !== 200) {
|
if (r.code !== 200) {
|
||||||
log.error(`msg templatecreate 失败 (code=${r.code}): ${r.msg}`)
|
log.error(`msg templatecreate 失败 (code=${r.code}): ${r.msg}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
@@ -38,7 +48,7 @@ export function buildMsgTemplateCreateCommand(): Command {
|
|||||||
let id = r.data?.id
|
let id = r.data?.id
|
||||||
if (!id) {
|
if (!id) {
|
||||||
const listR = await c.get<{ list: { id: string; enCode: string; fullName: string }[] }>(
|
const listR = await c.get<{ list: { id: string; enCode: string; fullName: string }[] }>(
|
||||||
'/system/MessageTemplate',
|
'/message/MessageTemplateConfig',
|
||||||
{ keyword: opts.enCode, pageSize: '50' },
|
{ keyword: opts.enCode, pageSize: '50' },
|
||||||
)
|
)
|
||||||
const found = (listR.data?.list || []).find(
|
const found = (listR.data?.list || []).find(
|
||||||
@@ -50,14 +60,19 @@ export function buildMsgTemplateCreateCommand(): Command {
|
|||||||
if (opts.json) printJson({ ...(r.data as object), id })
|
if (opts.json) printJson({ ...(r.data as object), id })
|
||||||
})
|
})
|
||||||
installAiHelpHook(cmd, {
|
installAiHelpHook(cmd, {
|
||||||
purpose: '新建消息模板',
|
purpose: '新建消息模板 (修复 v0.10 错误端点)',
|
||||||
required: { '--fullName': '模板名称', '--enCode': '模板编码' },
|
required: { '--fullName': '模板名称', '--enCode': '模板编码' },
|
||||||
example: 'dacli msg templatecreate --fullName=系统告警模板 --enCode=sys_alert',
|
optional: {
|
||||||
source: {
|
'--category': '分类 (1=系统 2=业务)',
|
||||||
web: 'web/apps/jnpf-web-apps-main/src/views/msgCenter/msgTemplate/Form.vue',
|
'--content': '模板内容',
|
||||||
api: 'POST /api/system/MessageTemplate',
|
|
||||||
ref: 'doc/v0.8-endpoints.md §2.4',
|
|
||||||
},
|
},
|
||||||
|
example: 'dacli msg templatecreate --fullName=系统告警 --enCode=sys_alert --content=系统告警: {msg}',
|
||||||
|
source: {
|
||||||
|
web: 'web/apps/jnpf-web-apps-main/src/api/msgCenter/msgTemplate.ts:14 create()',
|
||||||
|
api: 'POST /api/message/MessageTemplateConfig',
|
||||||
|
ref: 'dacli/docs/cmd-review/msg.md §端点错误',
|
||||||
|
},
|
||||||
|
notes: ['v0.10 端点 `/api/system/MessageTemplate` 已被 web 端废弃, v0.11+ 修复'],
|
||||||
})
|
})
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user