-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
62 impl post apis for organization team submodules #63
Changes from all commits
fb628d6
716e12b
ed98af3
50a051c
b8b2c4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Controller } from "@nestjs/common"; | ||
|
||
import { ExampleService } from "../service/example.service"; | ||
|
||
@Controller() | ||
export class ExampleController { | ||
constructor(private readonly exampleService: ExampleService) {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Module } from "@nestjs/common"; | ||
|
||
import { DrizzleModule } from "src/drizzle/drizzle.module"; | ||
import { ExampleService } from "./service/example.service"; | ||
import { ExampleController } from "./controller/example.controller"; | ||
import { ExampleRepository } from "./repository/example.repository"; | ||
|
||
@Module({ | ||
imports: [DrizzleModule], | ||
controllers: [ExampleController], | ||
providers: [ExampleService, ExampleRepository], | ||
exports: [], | ||
}) | ||
export class ExampleModule {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Injectable, Inject } from "@nestjs/common"; | ||
|
||
import { MySql2Database } from "drizzle-orm/mysql2"; | ||
import { DrizzleAsyncProvider } from "src/drizzle/drizzle.provider"; | ||
|
||
@Injectable() | ||
export class ExampleRepository { | ||
constructor( | ||
@Inject(DrizzleAsyncProvider) private readonly db: MySql2Database, | ||
) {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Injectable } from "@nestjs/common"; | ||
import { ExampleRepository } from "../repository/example.repository"; | ||
|
||
@Injectable() | ||
export class ExampleService { | ||
constructor(private readonly exampleRepository: ExampleRepository) {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { Module, forwardRef } from "@nestjs/common"; | ||
|
||
import { DrizzleModule } from "src/drizzle/drizzle.module"; | ||
import { SemesterModule } from "src/feature/semester/semester.module"; | ||
|
@@ -7,9 +7,17 @@ import { OrganizationService } from "./service/organization.service"; | |
import { OrganizationController } from "./controller/organization.controller"; | ||
import { OrganizationPublicService } from "./service/organization.public.service"; | ||
import { OrganizationRepository } from "./repository/organization.repository"; | ||
/* eslint-disable import/no-cycle */ | ||
import { TeamModule } from "./team/team.module"; | ||
/* eslint-disable import/no-cycle */ | ||
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이게 위아랫줄이 다 필요했던가..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다른 순환참조를 막으려고 일단 한줄에만 걸었어요 |
||
|
||
@Module({ | ||
imports: [DrizzleModule, SemesterModule, UserModule], | ||
imports: [ | ||
DrizzleModule, | ||
SemesterModule, | ||
UserModule, | ||
forwardRef(() => TeamModule), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 이거 하마랑 어제 논의했던 내용인데 알아서 잘 썼군 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어쨌든 organization 하위 모듈에서 상위모듈 꺼가 필요해서 발생하는 일이라 순환참조해도 괜찮지 않을까 싶었슴다 |
||
], | ||
controllers: [OrganizationController], | ||
providers: [ | ||
OrganizationService, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Body, Controller, Post, UsePipes } from "@nestjs/common"; | ||
import { | ||
ApiOrg007RequestBody, | ||
ApiOrg007RequestUrl, | ||
ApiOrg007ResponseCreated, | ||
ApiOrg008RequestBody, | ||
ApiOrg008RequestUrl, | ||
ApiOrg008ResponseCreated, | ||
ApiOrg009RequestBody, | ||
ApiOrg009RequestUrl, | ||
ApiOrg009ResponseCreated, | ||
apiOrg007, | ||
apiOrg008, | ||
apiOrg009, | ||
Comment on lines
+3
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 확실히 깔끔하다 |
||
} from "@sparcs-students/interface/api/organization/index"; | ||
import { ZodPipe } from "@sparcs-students/api/common/pipes/zod-pipe"; | ||
|
||
import { TeamService } from "../service/team.service"; | ||
|
||
@Controller() | ||
export class TeamController { | ||
constructor(private readonly teamService: TeamService) {} | ||
|
||
@Post(ApiOrg007RequestUrl) | ||
@UsePipes(new ZodPipe(apiOrg007)) | ||
async postTeam( | ||
@Body() body: ApiOrg007RequestBody, | ||
): Promise<ApiOrg007ResponseCreated> { | ||
return this.teamService.postTeam(body); | ||
} | ||
|
||
@Post(ApiOrg008RequestUrl) | ||
@UsePipes(new ZodPipe(apiOrg008)) | ||
async postTeamMember( | ||
@Body() body: ApiOrg008RequestBody, | ||
): Promise<ApiOrg008ResponseCreated> { | ||
return this.teamService.postTeamMember(body); | ||
} | ||
|
||
@Post(ApiOrg009RequestUrl) | ||
@UsePipes(new ZodPipe(apiOrg009)) | ||
async postTeamLeader( | ||
@Body() body: ApiOrg009RequestBody, | ||
): Promise<ApiOrg009ResponseCreated> { | ||
return this.teamService.postTeamLeader(body); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example 쭉 만든건 예시용으로 이번에 만든건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 매번 복사하기도 귀찮고 템플릿으로 만들면 좋을 것 같아서요