From 5ce397237560645ea30ee5ba9422338f08cc85a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EC=A0=95=EC=9A=A9?= Date: Thu, 16 Nov 2023 20:36:10 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20lint=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BackEnd/src/app.controller.ts | 4 +- BackEnd/src/app.module.ts | 4 +- BackEnd/src/posts/entities/posts.entity.ts | 80 ++++++++--------- .../src/profiles/entities/profiles.entity.ts | 4 +- .../src/records/entities/records.entity.ts | 88 +++++++++---------- BackEnd/src/users/entities/users.entity.ts | 4 +- 6 files changed, 90 insertions(+), 94 deletions(-) diff --git a/BackEnd/src/app.controller.ts b/BackEnd/src/app.controller.ts index bfaa2aa6..cce879ee 100755 --- a/BackEnd/src/app.controller.ts +++ b/BackEnd/src/app.controller.ts @@ -3,9 +3,7 @@ import { AppService } from './app.service'; @Controller() export class AppController { - constructor( - private readonly appService: AppService, - ) {} + constructor(private readonly appService: AppService) {} @Get() getHello(): string { diff --git a/BackEnd/src/app.module.ts b/BackEnd/src/app.module.ts index 28207294..b5861f68 100755 --- a/BackEnd/src/app.module.ts +++ b/BackEnd/src/app.module.ts @@ -6,9 +6,7 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { LoggerMiddleware } from './middlewares/logger.middleware'; @Module({ - imports: [ - TypeOrmModule.forRoot(typeOrmConfig), - ], + imports: [TypeOrmModule.forRoot(typeOrmConfig)], controllers: [AppController], providers: [AppService], }) diff --git a/BackEnd/src/posts/entities/posts.entity.ts b/BackEnd/src/posts/entities/posts.entity.ts index cfadb5a5..bb99dc0b 100644 --- a/BackEnd/src/posts/entities/posts.entity.ts +++ b/BackEnd/src/posts/entities/posts.entity.ts @@ -1,43 +1,43 @@ import { - Entity, - PrimaryGeneratedColumn, - Column, - CreateDateColumn, - UpdateDateColumn, - ManyToOne, - OneToOne, - JoinColumn - } from 'typeorm'; + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + OneToOne, + JoinColumn, +} from 'typeorm'; import { RecordModel } from 'src/records/entities/records.entity'; import { ProfileModel } from 'src/profiles/entities/profiles.entity'; - - @Entity() - export class PostModel { - @PrimaryGeneratedColumn() - id: number; - - @Column() - publicId: string; - - @Column() - content: string; - - @Column({ nullable: true }) - like: number; - - @CreateDateColumn() - createdAt: Date; - - @UpdateDateColumn() - updatedAt: Date; - - @Column() - deletedAt: Date; - - @OneToOne(() => RecordModel) - @JoinColumn() - record: RecordModel; - - @ManyToOne(() => ProfileModel, (profile) => profile.posts) - profile: ProfileModel; - } \ No newline at end of file + +@Entity() +export class PostModel { + @PrimaryGeneratedColumn() + id: number; + + @Column() + publicId: string; + + @Column() + content: string; + + @Column({ nullable: true }) + like: number; + + @CreateDateColumn() + createdAt: Date; + + @UpdateDateColumn() + updatedAt: Date; + + @Column() + deletedAt: Date; + + @OneToOne(() => RecordModel) + @JoinColumn() + record: RecordModel; + + @ManyToOne(() => ProfileModel, (profile) => profile.posts) + profile: ProfileModel; +} diff --git a/BackEnd/src/profiles/entities/profiles.entity.ts b/BackEnd/src/profiles/entities/profiles.entity.ts index 10f7afef..b5bb60e7 100644 --- a/BackEnd/src/profiles/entities/profiles.entity.ts +++ b/BackEnd/src/profiles/entities/profiles.entity.ts @@ -9,7 +9,7 @@ import { UpdateDateColumn, Generated, OneToOne, - OneToMany + OneToMany, } from 'typeorm'; @Entity() @@ -44,4 +44,4 @@ export class ProfileModel { @OneToMany(() => PostModel, (post) => post.profile) posts: PostModel[]; -} \ No newline at end of file +} diff --git a/BackEnd/src/records/entities/records.entity.ts b/BackEnd/src/records/entities/records.entity.ts index 560b5882..bf373e7f 100644 --- a/BackEnd/src/records/entities/records.entity.ts +++ b/BackEnd/src/records/entities/records.entity.ts @@ -1,47 +1,47 @@ import { - Entity, - PrimaryGeneratedColumn, - Column, - CreateDateColumn, - ManyToOne, - OneToOne, - } from 'typeorm'; - - import { UserModel } from 'src/users/entities/users.entity'; + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + OneToOne, +} from 'typeorm'; + +import { UserModel } from 'src/users/entities/users.entity'; import { PostModel } from 'src/posts/entities/posts.entity'; import { ProfileModel } from 'src/profiles/entities/profiles.entity'; - @Entity() - export class RecordModel { - @PrimaryGeneratedColumn() - id: number; - - @Column() - exercise: string; - - @Column() - runningTime: number; - - @Column() - distance: number; - - @Column({ nullable: true }) - avgBpm: number; - - @Column({ nullable: true }) - minBpm: number; - - @Column({ nullable: true }) - maxBpm: number; - - @CreateDateColumn() - createdAt: Date; - - @Column() - checker: boolean; - - @ManyToOne(() => ProfileModel, (profile) => profile.records) //manyToOne이 항상 외래키를 갖고 있음 - profile: ProfileModel; - - @OneToOne(() => PostModel, (post) => post.record) - post: PostModel; - } \ No newline at end of file +@Entity() +export class RecordModel { + @PrimaryGeneratedColumn() + id: number; + + @Column() + exercise: string; + + @Column() + runningTime: number; + + @Column() + distance: number; + + @Column({ nullable: true }) + avgBpm: number; + + @Column({ nullable: true }) + minBpm: number; + + @Column({ nullable: true }) + maxBpm: number; + + @CreateDateColumn() + createdAt: Date; + + @Column() + checker: boolean; + + @ManyToOne(() => ProfileModel, (profile) => profile.records) //manyToOne이 항상 외래키를 갖고 있음 + profile: ProfileModel; + + @OneToOne(() => PostModel, (post) => post.record) + post: PostModel; +} diff --git a/BackEnd/src/users/entities/users.entity.ts b/BackEnd/src/users/entities/users.entity.ts index efea37fe..1cc00a63 100644 --- a/BackEnd/src/users/entities/users.entity.ts +++ b/BackEnd/src/users/entities/users.entity.ts @@ -17,10 +17,10 @@ export class UserModel { @Column() provider: string; - @OneToOne(() => ProfileModel, (profile)=> profile.user, { + @OneToOne(() => ProfileModel, (profile) => profile.user, { eager: true, cascade: true, }) @JoinColumn() profile: ProfileModel; -} \ No newline at end of file +}