-
-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(): refactor reproduce of #87, but it passed on 4.x
- Loading branch information
Showing
10 changed files
with
267 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Column, Entity, ManyToOne } from 'typeorm'; | ||
|
||
import { BaseEntity } from '../base-entity'; | ||
import { User } from '../users/user.entity'; | ||
import { Company } from '../companies/company.entity'; | ||
import { Project } from '../projects/project.entity'; | ||
|
||
@Entity('tasks') | ||
export class Task extends BaseEntity { | ||
@Column({ type: 'varchar', length: 100, nullable: false }) | ||
name: string; | ||
|
||
@Column({ type: 'varchar', nullable: false }) | ||
status: string; | ||
|
||
@Column({ nullable: false }) | ||
companyId: number; | ||
|
||
@Column({ nullable: false }) | ||
projectId: number; | ||
|
||
@Column({ nullable: false }) | ||
userId: number; | ||
|
||
/** | ||
* Relations | ||
*/ | ||
|
||
@ManyToOne(() => Company, o => o.tasks) | ||
company: Company; | ||
|
||
@ManyToOne(() => Project, o => o.tasks) | ||
project: Project; | ||
|
||
@ManyToOne(() => User, o => o.tasks) | ||
user: User; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Created by Diluka on 2019-06-13. | ||
* | ||
* | ||
* ----------- 神 兽 佑 我 ----------- | ||
* ┏┓ ┏┓+ + | ||
* ┏┛┻━━━━━━┛┻┓ + + | ||
* ┃ ┃ | ||
* ┣ ━ ┃ ++ + + + | ||
* ████━████ ┃+ | ||
* ┃ ┃ + | ||
* ┃ ┴ ┃ | ||
* ┃ ┃ + + | ||
* ┗━┓ ┏━┛ Code is far away from bug | ||
* ┃ ┃ with the animal protecting | ||
* ┃ ┃ + + + + | ||
* ┃ ┃ | ||
* ┃ ┃ + | ||
* ┃ ┃ + + | ||
* ┃ ┃ + | ||
* ┃ ┗━━━┓ + + | ||
* ┃ ┣┓ | ||
* ┃ ┏┛ | ||
* ┗┓┓┏━━━━┳┓┏┛ + + + + | ||
* ┃┫┫ ┃┫┫ | ||
* ┗┻┛ ┗┻┛+ + + + | ||
* ----------- 永 无 BUG ------------ | ||
*/ | ||
import { Company } from '../../../../integration/crud-typeorm/companies'; | ||
import { Project } from '../../../../integration/crud-typeorm/projects'; | ||
import { User } from '../../../../integration/crud-typeorm/users'; | ||
import { UserProfile } from '../../../../integration/crud-typeorm/users-profiles'; | ||
import { Task } from '../../../../integration/crud-typeorm/tasks/task.entity'; | ||
|
||
export const Entities = [Company, Project, User, UserProfile, Task]; |
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 { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
|
||
import { TypeOrmCrudService } from '../../../crud-typeorm/src/typeorm-crud.service'; | ||
import { Task } from '../../../../integration/crud-typeorm/tasks/task.entity'; | ||
|
||
@Injectable() | ||
export class TasksService extends TypeOrmCrudService<Task> { | ||
constructor(@InjectRepository(Task) repo) { | ||
super(repo); | ||
} | ||
} |
Oops, something went wrong.