From 5354553a6bc815ee17e5eb19edf2e04849791f24 Mon Sep 17 00:00:00 2001 From: Handoni Date: Fri, 31 May 2024 22:07:27 +0900 Subject: [PATCH] feat: Update API endpoints for disease prediction --- backend/app/api/routers/disease_prediction_router.py | 4 ++-- backend/app/main.py | 7 ++----- frontend/build/web/flutter_bootstrap.js | 2 +- frontend/build/web/flutter_service_worker.js | 8 ++++---- frontend/build/web/index.html | 2 +- frontend/build/web/main.dart.js | 4 ++-- frontend/lib/gptchat.dart | 4 ++-- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/backend/app/api/routers/disease_prediction_router.py b/backend/app/api/routers/disease_prediction_router.py index f48c92e..b9a5d69 100644 --- a/backend/app/api/routers/disease_prediction_router.py +++ b/backend/app/api/routers/disease_prediction_router.py @@ -16,12 +16,12 @@ @router.post( - "/primary_disease_prediction/", response_model=PrimaryDiseasePredictionResponse + "/api/primary_disease_prediction/", response_model=PrimaryDiseasePredictionResponse ) async def disease_prediction_endpoint(input_data: UserSymptomInput): return await primary_disease_prediction(input_data) -@router.post("/secondary_disease_prediction/", response_model=PredictedDisease) +@router.post("/api/secondary_disease_prediction/", response_model=PredictedDisease) async def secondary_disease_prediction_endpoint(input_data: UserQuestionResponse): return await secondary_disease_prediction(input_data) diff --git a/backend/app/main.py b/backend/app/main.py index e70eac1..712ff9f 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -12,11 +12,8 @@ app.add_middleware( CORSMiddleware, allow_origins=[ - "https://apayo-d426b.firebaseapp.com/", - "https://apayo-d426b.web.app/", - "http://localhost:3000", - "http://localhost:8000", - "http://localhost:8080", + "http://52.79.91.82", + "http://52.79.91.82:80", ], allow_credentials=True, allow_methods=["*"], # 모든 HTTP 메서드 허용 diff --git a/frontend/build/web/flutter_bootstrap.js b/frontend/build/web/flutter_bootstrap.js index df1a94e..b5d3356 100644 --- a/frontend/build/web/flutter_bootstrap.js +++ b/frontend/build/web/flutter_bootstrap.js @@ -11,6 +11,6 @@ _flutter.buildConfig = {"engineRevision":"55eae6864b296dd9f43b2cc7577ec256e5c32a _flutter.loader.load({ serviceWorkerSettings: { - serviceWorkerVersion: "3108374681" + serviceWorkerVersion: "3683019194" } }); diff --git a/frontend/build/web/flutter_service_worker.js b/frontend/build/web/flutter_service_worker.js index 09e7dfa..8340215 100644 --- a/frontend/build/web/flutter_service_worker.js +++ b/frontend/build/web/flutter_service_worker.js @@ -28,14 +28,14 @@ const RESOURCES = {"assets/AssetManifest.bin": "7b6d93ba23c81c20fb76a338b61f6e05 "canvaskit/skwasm.worker.js": "bfb704a6c714a75da9ef320991e88b03", "favicon.png": "5dcef449791fa27946b3d35ad8803796", "flutter.js": "383e55f7f3cce5be08fcf1f3881f585c", -"flutter_bootstrap.js": "394f80cc4e8d2e1d05a148b73510bc01", +"flutter_bootstrap.js": "2fb023b320906da68d0ed770d3cfee96", "icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1", "icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1", "icons/Icon-maskable-192.png": "c457ef57daa1d16f64b27b786ec2ea3c", "icons/Icon-maskable-512.png": "301a7604d45b3e739efc881eb04896ea", -"index.html": "8ac276bed52673116655328a4b841c2c", -"/": "8ac276bed52673116655328a4b841c2c", -"main.dart.js": "8b0c7c418cabf519f2bca925a0f888d3", +"index.html": "8af7ae254f4d3753878438bfb614a64a", +"/": "8af7ae254f4d3753878438bfb614a64a", +"main.dart.js": "fabf14b47eca5057d91f4de19c99cf09", "manifest.json": "0030ff64be1c3181710c3014b11018a8", "version.json": "2b521e10dfa0f067561de489a19d6620"}; // The application shell files that are downloaded before a service worker can diff --git a/frontend/build/web/index.html b/frontend/build/web/index.html index 346aae3..eecc66c 100644 --- a/frontend/build/web/index.html +++ b/frontend/build/web/index.html @@ -34,7 +34,7 @@ diff --git a/frontend/build/web/main.dart.js b/frontend/build/web/main.dart.js index b8c961a..604c8f9 100644 --- a/frontend/build/web/main.dart.js +++ b/frontend/build/web/main.dart.js @@ -83658,7 +83658,7 @@ A4(){var s=0,r=A.P(t.bU),q,p=2,o,n=this,m,l,k,j,i,h,g,f,e,d var $async$A4=A.Q(function(a,b){if(a===1){o=b s=p}while(true)switch(s){case 0:n.Q.on(B.OM) p=4 -h=A.f3("http://52.79.91.82/primary_disease_prediction/") +h=A.f3("http://52.79.91.82/api/primary_disease_prediction/") g=t.N f=A.as(["Content-Type","application/json"],g,g) s=7 @@ -83710,7 +83710,7 @@ var $async$A3=A.Q(function(a,b){if(a===1){o=b s=p}while(true)switch(s){case 0:p=4 g=t.N A.je(n.d.l1(0,new A.aeC(),g,g)) -f=A.f3("http://52.79.91.82/secondary_disease_prediction/") +f=A.f3("http://52.79.91.82/api/secondary_disease_prediction/") e=A.as(["Content-Type","application/json"],g,g) s=7 return A.Y(A.ao8(f,B.bA.kB(A.as(["session_id",$.as5,"responses",n.d.l1(0,new A.aeD(),g,g)],g,t.K)),e),$async$A3) diff --git a/frontend/lib/gptchat.dart b/frontend/lib/gptchat.dart index 85a4d94..83ba93a 100644 --- a/frontend/lib/gptchat.dart +++ b/frontend/lib/gptchat.dart @@ -108,7 +108,7 @@ class _GptPageState extends State { // 백엔드로 POST 요청 보내기 try { http.Response response = await http.post( - Uri.parse('http://52.79.91.82/primary_disease_prediction/'), + Uri.parse('http://52.79.91.82/api/primary_disease_prediction/'), headers: {'Content-Type': 'application/json'}, // POST 요청의 헤더 body: json.encode( {'user_id': '777', 'symptoms': text}), // POST 요청의 바디 (메시지 데이터) @@ -203,7 +203,7 @@ class _GptPageState extends State { print(cardSelections .map((key, value) => MapEntry(key, value ? 'yes' : 'no'))); http.Response response = await http.post( - Uri.parse('http://52.79.91.82/secondary_disease_prediction/'), + Uri.parse('http://52.79.91.82/api/secondary_disease_prediction/'), headers: {'Content-Type': 'application/json'}, body: json.encode({ 'session_id': SessionID, // 세션 ID 전송