Skip to content

Commit

Permalink
Merge pull request #44 from Handoni/hotfix/api
Browse files Browse the repository at this point in the history
fix: update API
  • Loading branch information
Handoni authored May 31, 2024
2 parents 7f2191a + 5354553 commit 73418d3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions backend/app/api/routers/disease_prediction_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 2 additions & 5 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 메서드 허용
Expand Down
2 changes: 1 addition & 1 deletion frontend/build/web/flutter_bootstrap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions frontend/build/web/flutter_service_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/build/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = "3108374681";
const serviceWorkerVersion = "3683019194";
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
Expand Down
4 changes: 2 additions & 2 deletions frontend/build/web/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/gptchat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _GptPageState extends State<GptPage> {
// 백엔드로 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 요청의 바디 (메시지 데이터)
Expand Down Expand Up @@ -203,7 +203,7 @@ class _GptPageState extends State<GptPage> {
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 전송
Expand Down

0 comments on commit 73418d3

Please sign in to comment.