-
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.
* fix: user type PHD 추가 * feat: createPhD API 구현 * fix: 학생 엑셀 업로드 양식에 박사과정 학생 등록 방식 설명 추가 * feat: createPhDExcel API 구현 * feat: PHD UserType에 일부 API 권한 부여 * feat: 연구실적 서비스 로직에 PHD UserType 추가 * fix: 연구실적 DB 구조 수정 * fix: 연구실적 등록 시 지도교수 최대 2명 설정 가능 * fix: 연구실적 엑셀 다운로드 시 학위과정, 지도교수 이름 포함
- Loading branch information
Showing
11 changed files
with
415 additions
and
35 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
Binary file not shown.
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ export enum UserType { | |
STUDENT = "STUDENT", | ||
PROFESSOR = "PROFESSOR", | ||
ADMIN = "ADMIN", | ||
PHD = "PHD", | ||
} |
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,43 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { Type } from "class-transformer"; | ||
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString } from "class-validator"; | ||
import { IsKoreanPhoneNumber } from "src/common/decorators/is-kr-phone-number.decorator"; | ||
|
||
export class CreatePhDDto { | ||
// 사용자 정보 | ||
@ApiProperty({ description: "로그인 아이디(학번)", example: "2022000000" }) | ||
@IsNotEmpty() | ||
@IsString() | ||
loginId: string; | ||
|
||
@ApiProperty({ description: "비밀번호(생년월일)", example: "010101" }) | ||
@IsNotEmpty() | ||
@IsString() | ||
password: string; | ||
|
||
@ApiProperty({ description: "학생 이름", example: "홍길동" }) | ||
@IsNotEmpty() | ||
@IsString() | ||
name: string; | ||
|
||
@ApiProperty({ description: "학생 이메일", example: "abc@gmail.com", required: false }) | ||
@IsOptional() | ||
@IsNotEmpty() | ||
@IsString() | ||
@IsEmail() | ||
email: string; | ||
|
||
@ApiProperty({ description: "학생 전화번호", example: "010-1111-1222", required: false }) | ||
@IsOptional() | ||
@IsNotEmpty() | ||
@IsString() | ||
@IsKoreanPhoneNumber() | ||
phone: string; | ||
|
||
@ApiProperty({ description: "학과 아이디", example: "1" }) | ||
@IsNotEmpty() | ||
@Type(() => Number) | ||
@IsPositive() | ||
@IsInt() | ||
deptId: number; | ||
} |
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,30 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { Department, User, UserType } from "@prisma/client"; | ||
import { DepartmentDto } from "src/modules/departments/dtos/department.dto"; | ||
|
||
export class PhDDto { | ||
constructor(phdData: Partial<User> & { department: Department }) { | ||
this.id = phdData.id; | ||
this.loginId = phdData.loginId; | ||
this.name = phdData.name; | ||
this.email = phdData.email; | ||
this.phone = phdData.phone; | ||
this.type = phdData.type; | ||
this.department = phdData.department ? new DepartmentDto(phdData.department) : undefined; | ||
} | ||
|
||
@ApiProperty({ description: "아이디" }) | ||
id: number; | ||
@ApiProperty({ description: "로그인 아이디" }) | ||
loginId: string; | ||
@ApiProperty({ description: "이름" }) | ||
name: string; | ||
@ApiProperty({ description: "이메일" }) | ||
email?: string; | ||
@ApiProperty({ description: "연락처" }) | ||
phone?: string; | ||
@ApiProperty({ description: "사용자 유형", enum: UserType, example: UserType.PHD }) | ||
type: UserType; | ||
@ApiProperty({ description: "학과" }) | ||
department: DepartmentDto; | ||
} |
Oops, something went wrong.