-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 경로 이름 수정 entity->entities * feat: category 엔티티 생성 * feat: reason 모델 생성 및 각 테이블 relation 설정 * feat: 각 테이블 relation 수정 및 의존성 주입 * feat: relation 방식 변경으로 인한folders.service.ts 메서드 수정, 의존성 주입
- Loading branch information
1 parent
462fe15
commit 6f0b7a8
Showing
19 changed files
with
143 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { CategoriesService } from './categories.service'; | ||
import { CategoriesController } from './categories.controller'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { CategoryModel } from './entities/category.entity'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([CategoryModel])], | ||
controllers: [CategoriesController], | ||
providers: [CategoriesService], | ||
exports: [TypeOrmModule], | ||
}) | ||
export class CategoriesModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; | ||
import { BaseModel } from '../../common/entities/base.entity'; | ||
|
||
@Entity() | ||
export class CategoryModel extends BaseModel { | ||
@PrimaryGeneratedColumn() | ||
categoryId: number; | ||
|
||
@Column() | ||
mainCategory: string; | ||
|
||
@Column() | ||
subCategory: string; | ||
|
||
@Column() | ||
minorCategory: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
server/src/checklist-ai/entities/ai-checklist-item-naver-reason.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'; | ||
import { BaseModel } from '../../common/entities/base.entity'; | ||
import { AiChecklistItemModel } from './ai-checklist-item'; | ||
|
||
@Entity() | ||
export class AiChecklistItemNaverReasonModel extends BaseModel { | ||
@PrimaryGeneratedColumn() | ||
aiChecklistItemNaverReasonid: number; | ||
|
||
@Column() | ||
reason: string; | ||
|
||
@ManyToOne( | ||
() => AiChecklistItemModel, | ||
(aiChecklistItem) => aiChecklistItem.reasons, | ||
{ | ||
nullable: false, | ||
}, | ||
) | ||
aiChecklistItem: AiChecklistItemModel; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
Column, | ||
Entity, | ||
JoinColumn, | ||
ManyToOne, | ||
OneToMany, | ||
PrimaryGeneratedColumn, | ||
} from 'typeorm'; | ||
import { AiChecklistItemNaverReasonModel } from './ai-checklist-item-naver-reason.entity'; | ||
import { BaseModel } from '../../common/entities/base.entity'; | ||
import { CategoryModel } from '../../categories/entities/category.entity'; | ||
|
||
@Entity() | ||
export class AiChecklistItemModel extends BaseModel { | ||
@PrimaryGeneratedColumn() | ||
aiChecklistItemId: number; | ||
|
||
@Column() | ||
content: string; | ||
|
||
@Column({ default: 0 }) | ||
selected_count_by_user: number; | ||
|
||
@Column({ default: 0 }) | ||
selected_count_by_naver_ai: number; | ||
|
||
@Column({ default: 0 }) | ||
evaluated_count_by_naver_ai: number; | ||
|
||
// final_score는 user_selected_count + naver_ai_selected_count + naver_ai_evaluate_count | ||
@Column({ default: 0 }) | ||
final_score: number; | ||
|
||
@ManyToOne(() => CategoryModel) | ||
@JoinColumn({ name: 'categoryId' }) | ||
category: CategoryModel; | ||
|
||
@OneToMany( | ||
() => AiChecklistItemNaverReasonModel, | ||
(reason) => reason.aiChecklistItem, | ||
) | ||
reasons: AiChecklistItemNaverReasonModel[]; | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { BaseModel } from './base.entity'; | ||
import { Column, JoinColumn, ManyToOne } from 'typeorm'; | ||
import { CategoryModel } from '../../categories/entities/category.entity'; | ||
|
||
export abstract class ChecklistModel extends BaseModel { | ||
@Column() | ||
title: string; | ||
|
||
@ManyToOne(() => CategoryModel) | ||
@JoinColumn({ name: 'categoryId' }) | ||
category: CategoryModel; | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server/src/folders/private-checklists/entities/private-checklist.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server/src/shared-checklists/entities/shared-checklist-item.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters