Skip to content

Commit

Permalink
chore: lint 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sjy982 committed Nov 16, 2023
1 parent 9301228 commit 5ce3972
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 94 deletions.
4 changes: 1 addition & 3 deletions BackEnd/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions BackEnd/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
Expand Down
80 changes: 40 additions & 40 deletions BackEnd/src/posts/entities/posts.entity.ts
Original file line number Diff line number Diff line change
@@ -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;
}

@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;
}
4 changes: 2 additions & 2 deletions BackEnd/src/profiles/entities/profiles.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
UpdateDateColumn,
Generated,
OneToOne,
OneToMany
OneToMany,
} from 'typeorm';

@Entity()
Expand Down Expand Up @@ -44,4 +44,4 @@ export class ProfileModel {

@OneToMany(() => PostModel, (post) => post.profile)
posts: PostModel[];
}
}
88 changes: 44 additions & 44 deletions BackEnd/src/records/entities/records.entity.ts
Original file line number Diff line number Diff line change
@@ -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;
}
@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;
}
4 changes: 2 additions & 2 deletions BackEnd/src/users/entities/users.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 5ce3972

Please sign in to comment.