Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/controllers/certificateInquiry.controller.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//certification2.controller.ts
import { Request, Response, NextFunction } from "express";
import { StatusCodes } from "http-status-codes";
import { responseFromCertificationSummary, responseFromCertification } from "../dtos/certificateInquiry.dto.js";
import { CertificationService } from "../services/certificateInquiry.service.js";

const service = new CertificationService();

// GET: 전체 자격증 목록 (요약 정보만 제공)
// 전체 자격증 목록 조회
export const handleGetAllCertifications = async (req: Request, res: Response, next: NextFunction): Promise<void> => {
console.log("전체 자격증 요약 조회 요청");

Expand All @@ -29,7 +28,7 @@ export const handleGetAllCertifications = async (req: Request, res: Response, ne
}
};

// GET: 카테고리별 자격증 조회 (요약 정보만 제공)
// 카테고리별 자격증 조회
export const handleGetCertificationsByCategory = async (req: Request, res: Response, next: NextFunction): Promise<void> => {
console.log("카테고리별 자격증 조회 요청");

Expand Down Expand Up @@ -61,7 +60,7 @@ export const handleGetCertificationsByCategory = async (req: Request, res: Respo
}
};

// GET: 자격증 상세 조회
// 자격증 상세 조회
export const handleGetCertificationById = async (req: Request, res: Response, next: NextFunction): Promise<void> => {
console.log("자격증 상세 조회 요청");

Expand Down
5 changes: 2 additions & 3 deletions src/dtos/certification.dto.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// 요청에서 받아온 데이터를 DTO로 매핑
export const mapQueryToCertificationSearch = (query: any) => {
return {
query: query.query as string,
category: query.category as string | undefined,
};
};

// 자격증 데이터를 응답 형식으로 변환

export const responseFromCertification = (certification: any) => {
return {
id: certification.id,
Expand All @@ -15,7 +14,7 @@ export const responseFromCertification = (certification: any) => {
};
};

// 자격증 목록 데이터를 응답 형식으로 변환

export const responseFromCertifications = (certifications: any[]) => {
return certifications.map(responseFromCertification);
};
2 changes: 0 additions & 2 deletions src/repositories/certificateInquiry.repository.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//certification2.repository.ts
import { prisma } from "../db.config.js";

export class CertificationRepository {
// 요약 정보 조회
async findAllSummaries() {
return prisma.certification.findMany({
select: {
Expand Down