migrate ci and postgress
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing

This commit is contained in:
2026-02-08 20:09:53 +03:00
parent 448b63a59f
commit 9d2d30e991
22 changed files with 11409 additions and 8243 deletions

View File

@ -1,84 +1,37 @@
import {ApiProperty} from '@nestjs/swagger/dist/decorators';
import {Document} from 'mongoose';
import {Prop, Schema, SchemaFactory} from '@nestjs/mongoose';
import {Author, Image} from './types';
import { ApiProperty } from '@nestjs/swagger';
import { Author, Image } from './types';
export class AuthRequest {
@ApiProperty()
login: string;
@ApiProperty()
login: string;
}
export class ImageCreateRequest {
@ApiProperty()
url: string;
@ApiProperty()
url: string;
}
export class AuthorResponse implements Author {
@ApiProperty()
login: string;
@ApiProperty()
login: string;
@ApiProperty()
token: string;
@ApiProperty()
token: string;
}
export class ImageResponse implements Image {
@ApiProperty()
url: string;
@ApiProperty()
url: string;
@ApiProperty()
author: string;
@ApiProperty()
author: string;
@ApiProperty()
likes: string[];
@ApiProperty()
likes: string[];
@ApiProperty()
id: string;
@ApiProperty()
id: string;
@ApiProperty()
create_at: string;
@ApiProperty()
create_at: string;
}
@Schema()
export class AuthorDocument extends Document {
@Prop({
type: String,
required: true,
})
login: string;
@Prop({
type: String,
required: true,
})
token: string;
}
@Schema()
export class ImageDocument extends Document {
@Prop({
type: String,
required: true,
})
url: string;
@Prop({
type: String,
required: true,
})
author: string;
@Prop({
type: [String],
required: true,
})
likes: string[];
@Prop({
type: String,
required: true,
})
create_at: string;
}
export const ImageScheme = SchemaFactory.createForClass(ImageDocument);
export const AuthorScheme = SchemaFactory.createForClass(AuthorDocument);