|
|
@@ -14,9 +14,18 @@ export const AdvertisementSchema = z.object({
|
|
|
description: '链接地址',
|
|
|
example: 'https://example.com'
|
|
|
}),
|
|
|
- imageUrl: z.string().url().openapi({
|
|
|
- description: '图片地址',
|
|
|
- example: 'https://example.com/image.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: '图片文件信息'
|
|
|
}),
|
|
|
title: z.string().min(1).max(255).openapi({
|
|
|
description: '广告标题',
|
|
|
@@ -74,9 +83,9 @@ export const CreateAdvertisementDto = z.object({
|
|
|
description: '链接地址',
|
|
|
example: 'https://example.com'
|
|
|
}),
|
|
|
- imageUrl: z.string().url().openapi({
|
|
|
- description: '图片地址',
|
|
|
- example: 'https://example.com/image.jpg'
|
|
|
+ imageFileId: z.coerce.number().int().positive().nullable().optional().openapi({
|
|
|
+ description: '图片文件ID',
|
|
|
+ example: 1
|
|
|
}),
|
|
|
title: z.string().min(1).max(255).openapi({
|
|
|
description: '广告标题',
|
|
|
@@ -114,9 +123,9 @@ export const UpdateAdvertisementDto = z.object({
|
|
|
description: '链接地址',
|
|
|
example: 'https://example.com'
|
|
|
}),
|
|
|
- imageUrl: z.string().url().optional().openapi({
|
|
|
- description: '图片地址',
|
|
|
- example: 'https://example.com/image.jpg'
|
|
|
+ imageFileId: z.coerce.number().int().positive().nullable().optional().openapi({
|
|
|
+ description: '图片文件ID',
|
|
|
+ example: 1
|
|
|
}),
|
|
|
title: z.string().min(1).max(255).optional().openapi({
|
|
|
description: '广告标题',
|