summaryrefslogtreecommitdiff
path: root/app/api/cron/object-classes
diff options
context:
space:
mode:
Diffstat (limited to 'app/api/cron/object-classes')
-rw-r--r--app/api/cron/object-classes/route.ts21
1 files changed, 21 insertions, 0 deletions
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