работаем бля работаем

This commit is contained in:
2026-05-09 03:21:44 +06:00
parent f845777bac
commit 0b148c6a7d
169 changed files with 15816 additions and 1005 deletions

View File

@@ -2,6 +2,8 @@ import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox'
import * as fs from 'node:fs'
import * as path from 'node:path'
import { Type } from 'typebox'
import { GetAttachmentParamsSchema } from '../plugins/schemas/attachment.ts'
import { TypeboxRef } from '../utils/typebox-ref.ts'
const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
const uploadDir = path.join(process.cwd(), 'uploads')
@@ -18,6 +20,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
tags: ['Attachment'],
operationId: 'attachment.upload',
description: 'Pass file to multipart/form-data',
consumes: ['multipart/form-data'],
response: {
200: Type.String({ format: 'uuid', description: 'Attachment UUID' }),
},
@@ -62,9 +65,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
summary: 'Get attachment',
tags: ['Attachment'],
operationId: 'attachment.get',
params: Type.Object({
id: Type.String({ format: 'uuid' }),
}),
params: TypeboxRef(GetAttachmentParamsSchema),
response: {
200: Type.Any({ description: 'Attachment content' }),
},