Sfoglia il codice sorgente

🐛 fix(files): 增加文件类型字段长度限制

- 将file.entity.ts中type字段长度从50调整为100
- 将file.schema.ts中type字段最大长度从50调整为100
- 将CreateFileDto中type字段最大长度从50调整为100
yourname 3 mesi fa
parent
commit
bd640d2a53

+ 1 - 1
src/server/modules/files/file.entity.ts

@@ -11,7 +11,7 @@ export class File {
   @Column({ name: 'name', type: 'varchar', length: 255 })
   name!: string;
 
-  @Column({ name: 'type', type: 'varchar', length: 50, nullable: true, comment: '文件类型' })
+  @Column({ name: 'type', type: 'varchar', length: 100, nullable: true, comment: '文件类型' })
   type!: string | null;
 
   @Column({ name: 'size', type: 'int', unsigned: true, nullable: true, comment: '文件大小,单位字节' })

+ 2 - 2
src/server/modules/files/file.schema.ts

@@ -10,7 +10,7 @@ export const FileSchema = z.object({
     description: '文件名称',
     example: '项目计划书.pdf'
   }),
-  type: z.string().max(50).nullable().openapi({
+  type: z.string().max(100).nullable().openapi({
     description: '文件类型',
     example: 'application/pdf'
   }),
@@ -58,7 +58,7 @@ export const CreateFileDto = z.object({
     description: '文件名称',
     example: '项目计划书.pdf'
   }),
-  type: z.string().max(50).nullable().optional().openapi({
+  type: z.string().max(100).nullable().optional().openapi({
     description: '文件类型',
     example: 'application/pdf'
   }),