-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (25 loc) · 1.24 KB
/
test.py
File metadata and controls
32 lines (25 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
CodeCraft PMS Backend Project
파일명 : test.py
생성자 : 김창환
생성일 : 2024/10/31
업데이트 : 2024/10/31
설명 : Frontend Axios에서 API 통신 테스트를 위한 라우터
"""
from fastapi import APIRouter, HTTPException, Request
from fastapi.responses import JSONResponse
from pydantic import BaseModel
from typing import Dict, Any
from logger import logger
router = APIRouter()
@router.get("/test/get")
async def test_get():
return {"RESULT_CODE": 200,
"RESULT_MSG": "Success",
"PAYLOADS": {
"Message": "Hi there!"
}}
@router.post("/test/post")
async def test_post(request: Request):
data: Dict[str, Any] = await request.json()
return {"received_data": data}