diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-08 03:08:19 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-08 03:08:19 +0000 |
| commit | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (patch) | |
| tree | f84750fa6cac954d5e31221fc47a54c655fc06a9 /app/api/cron | |
| parent | 230ce796836c25df26c130dbcd616ef97d12b2ec (diff) | |
로그인 및 미들웨어 처리. 구조 변경
Diffstat (limited to 'app/api/cron')
| -rw-r--r-- | app/api/cron/forms/route.ts | 21 | ||||
| -rw-r--r-- | app/api/cron/object-classes/route.ts | 21 | ||||
| -rw-r--r-- | app/api/cron/projects/route.ts | 21 | ||||
| -rw-r--r-- | app/api/cron/tag-types/route.ts | 20 |
4 files changed, 83 insertions, 0 deletions
diff --git a/app/api/cron/forms/route.ts b/app/api/cron/forms/route.ts new file mode 100644 index 00000000..f58c146b --- /dev/null +++ b/app/api/cron/forms/route.ts @@ -0,0 +1,21 @@ +// src/app/api/cron/tag-form-mappings/route.ts +import { syncTagFormMappings } from '@/lib/sedp/sync-form'; +import { NextRequest } from 'next/server'; + +export async function GET(request: NextRequest) { + try { + console.log('태그 폼 매핑 동기화 API 호출됨:', new Date().toISOString()); + + // syncTagFormMappings 함수 호출 + const result = await syncTagFormMappings(); + + // 성공 시 결과와 함께 200 OK 반환 + return Response.json({ success: true, result }, { status: 200 }); + } catch (error: any) { + console.error('태그 폼 매핑 동기화 API 에러:', error); + + // 에러 시에는 message를 담아 500 반환 + const message = error.message || 'Something went wrong'; + return Response.json({ success: false, error: message }, { status: 500 }); + } +}
\ No newline at end of file diff --git a/app/api/cron/object-classes/route.ts b/app/api/cron/object-classes/route.ts new file mode 100644 index 00000000..9a574b1b --- /dev/null +++ b/app/api/cron/object-classes/route.ts @@ -0,0 +1,21 @@ +// src/app/api/cron/object-classes/route.ts +import { syncObjectClasses } from '@/lib/sedp/sync-object-class'; +import { NextRequest } from 'next/server'; + +export async function GET(request: NextRequest) { + try { + console.log('오브젝트 클래스 동기화 API 호출됨:', new Date().toISOString()); + + // syncObjectClasses 함수 호출 + const result = await syncObjectClasses(); + + // 성공 시 결과와 함께 200 OK 반환 + return Response.json({ success: true, result }, { status: 200 }); + } catch (error: any) { + console.error('오브젝트 클래스 동기화 API 에러:', error); + + // 에러 시에는 message를 담아 500 반환 + const message = error.message || 'Something went wrong'; + return Response.json({ success: false, error: message }, { status: 500 }); + } +}
\ No newline at end of file diff --git a/app/api/cron/projects/route.ts b/app/api/cron/projects/route.ts new file mode 100644 index 00000000..d8e6af51 --- /dev/null +++ b/app/api/cron/projects/route.ts @@ -0,0 +1,21 @@ +// src/app/api/cron/projects/route.ts +import { syncProjects } from '@/lib/sedp/sync-projects'; +import { NextRequest } from 'next/server'; + +export async function GET(request: NextRequest) { + try { + console.log('프로젝트 동기화 API 호출됨:', new Date().toISOString()); + + // syncProjects 함수 호출 + const result = await syncProjects(); + + // 성공 시 결과와 함께 200 OK 반환 + return Response.json({ success: true, result }, { status: 200 }); + } catch (error: any) { + console.error('프로젝트 동기화 API 에러:', error); + + // 에러 시에는 message를 담아 500 반환 + const message = error.message || 'Something went wrong'; + return Response.json({ success: false, error: message }, { status: 500 }); + } +}
\ No newline at end of file diff --git a/app/api/cron/tag-types/route.ts b/app/api/cron/tag-types/route.ts new file mode 100644 index 00000000..35145984 --- /dev/null +++ b/app/api/cron/tag-types/route.ts @@ -0,0 +1,20 @@ +import { syncTagSubfields } from '@/lib/sedp/sync-tag-types'; +import { NextRequest } from 'next/server'; + +export async function GET(request: NextRequest) { + try { + console.log('태그 서브필드 동기화 API 호출됨:', new Date().toISOString()); + + // syncTagSubfields 함수 호출 + const result = await syncTagSubfields(); + + // 성공 시 결과와 함께 200 OK 반환 + return Response.json({ success: true, result }, { status: 200 }); + } catch (error: any) { + console.error('태그 서브필드 동기화 API 에러:', error); + + // 에러 시에는 message를 담아 500 반환 + const message = error.message || 'Something went wrong'; + return Response.json({ success: false, error: message }, { status: 500 }); + } +}
\ No newline at end of file |
