|
@@ -26,6 +26,19 @@ export const AdvertisementSchema = z.object({
|
|
|
description: '图片地址',
|
|
description: '图片地址',
|
|
|
example: '/uploads/banner.jpg'
|
|
example: '/uploads/banner.jpg'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ imageFileId: z.number().int().positive().nullable().openapi({
|
|
|
|
|
+ description: '图片文件ID',
|
|
|
|
|
+ example: 1
|
|
|
|
|
+ }),
|
|
|
|
|
+ imageFile: z.object({
|
|
|
|
|
+ id: z.number().int().positive().openapi({ description: '文件ID' }),
|
|
|
|
|
+ name: z.string().max(255).openapi({ description: '文件名', example: 'banner.jpg' }),
|
|
|
|
|
+ fullUrl: z.string().openapi({ description: '文件完整URL', example: 'https://example.com/banner.jpg' }),
|
|
|
|
|
+ type: z.string().nullable().openapi({ description: '文件类型', example: 'image/jpeg' }),
|
|
|
|
|
+ size: z.number().nullable().openapi({ description: '文件大小(字节)', example: 102400 })
|
|
|
|
|
+ }).nullable().optional().openapi({
|
|
|
|
|
+ description: '图片文件信息'
|
|
|
|
|
+ }),
|
|
|
sort: z.number().int().default(0).openapi({
|
|
sort: z.number().int().default(0).openapi({
|
|
|
description: '排序值',
|
|
description: '排序值',
|
|
|
example: 10
|
|
example: 10
|
|
@@ -70,6 +83,14 @@ export const CreateAdvertisementDto = z.object({
|
|
|
description: '图片地址',
|
|
description: '图片地址',
|
|
|
example: '/uploads/banner.jpg'
|
|
example: '/uploads/banner.jpg'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ imageFileId: z.coerce.number().int().positive().optional().openapi({
|
|
|
|
|
+ description: '图片文件ID',
|
|
|
|
|
+ example: 1
|
|
|
|
|
+ }),
|
|
|
|
|
+ imageFileId: z.coerce.number().int().positive().optional().openapi({
|
|
|
|
|
+ description: '图片文件ID',
|
|
|
|
|
+ example: 1
|
|
|
|
|
+ }),
|
|
|
sort: z.coerce.number().int().default(0).optional().openapi({
|
|
sort: z.coerce.number().int().default(0).optional().openapi({
|
|
|
description: '排序值',
|
|
description: '排序值',
|
|
|
example: 10
|
|
example: 10
|