ota 拓展功能-黑名单&灰色定向上线

This commit is contained in:
eafonyang
2026-06-30 18:15:25 +08:00
parent 08da279275
commit 864040f45b
16 changed files with 1872 additions and 9 deletions
+13
View File
@@ -0,0 +1,13 @@
const { z } = require('zod');
const BlackListCreateSchema = z.object({
ota_id: z.number().int({ message: 'ota_id 须为整数' }),
mac: z.string().min(1, 'MAC 地址不能为空').max(100, 'MAC 地址最多100字符'),
});
const BlackListUpdateSchema = z.object({
ota_id: z.number().int({ message: 'ota_id 须为整数' }).optional().nullable(),
mac: z.string().min(1).max(100).optional().nullable(),
});
module.exports = { BlackListCreateSchema, BlackListUpdateSchema };
+13
View File
@@ -0,0 +1,13 @@
const { z } = require('zod');
const OtaTargetDeviceCreateSchema = z.object({
ota_id: z.number().int({ message: 'ota_id 须为整数' }),
mac_addr: z.string().min(1, 'MAC 地址不能为空').max(17, 'MAC 地址最多17字符'),
});
const OtaTargetDeviceUpdateSchema = z.object({
ota_id: z.number().int({ message: 'ota_id 须为整数' }).optional().nullable(),
mac_addr: z.string().min(1).max(17).optional().nullable(),
});
module.exports = { OtaTargetDeviceCreateSchema, OtaTargetDeviceUpdateSchema };