tomoya 7 місяців тому
батько
коміт
d245448ba8

+ 3 - 2
backend/app/app/api/api_v1/api.py

@@ -3,7 +3,7 @@ from fastapi import APIRouter
 from app.api.api_v1.endpoints import  login, users, utils, videos, images, reputations, ser_no
 from app.api.api_v1.endpoints import ytviewspayment, payment
 from app.api.api_v1.endpoints import ecpay
-
+from app.api.api_v1.endpoints import heartbeat
 
 api_router = APIRouter()
 api_router.include_router(login.router, tags=["login"])
@@ -15,4 +15,5 @@ api_router.include_router(reputations.router, prefix="/reputations", tags=["repu
 api_router.include_router(ser_no.router, prefix="/ser_nos", tags=["serial numbers"])
 api_router.include_router(ytviewspayment.router, prefix="/payment", tags=["yt views payment"])
 api_router.include_router(payment.router, prefix="/payment", tags=["payment"])
-api_router.include_router(ecpay.router, prefix="/ecpay", tags=["ecpay"])
+api_router.include_router(ecpay.router, prefix="/ecpay", tags=["ecpay"])
+api_router.include_router(heartbeat.router, prefix="/heartbeat", tags=["heartbeat"])

+ 7 - 0
backend/app/app/api/api_v1/endpoints/heartbeat.py

@@ -0,0 +1,7 @@
+from fastapi import Request, APIRouter
+
+router = APIRouter()
+
+@router.get('')
+def heartbeat(request:Request):
+    return 'active'

+ 1 - 1
backend/app/app/api/api_v1/endpoints/payment.py

@@ -340,7 +340,7 @@ CheckMacValue: {CheckMacValue}\
   
   if RtnCode==1:
     payment_id = int(CustomField1)
-    payment = crud.payment.get(db=db, id=int(payment_id))
+    payment = crud.payment.get(db=db, id=payment_id)
     remark = json.loads(payment.remark)
     remark['TradeNo'] = TradeNo
     content_string = CustomField3.replace("'",'"')

+ 1 - 1
backend/app/app/core/config.py

@@ -14,7 +14,7 @@ class Settings(BaseSettings):
     # BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
     # e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
     # "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
-    BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = ["https://cloud.choozmo:8080", "http://cloud.choozmo.com:8080", "https://cloud.choozmo.com", "http://cloud.choozmo.com","http://172.105.219.42", "http://local.ai-anchor.com:5173", "http://local.ai-anchor.com:8080", "http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:5173", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.ai-anchor.com:3000", "http://dev.ai-anchor.com:5173", "http://dev.ai-anchor.com:8080"]
+    BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = ["http://cmm.ai:3001/", "https://cloud.choozmo:8080", "http://cloud.choozmo.com:8080", "https://cloud.choozmo.com", "http://cloud.choozmo.com","http://172.105.219.42", "http://local.ai-anchor.com:5173", "http://local.ai-anchor.com:8080", "http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:5173", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.ai-anchor.com:3000", "http://dev.ai-anchor.com:5173", "http://dev.ai-anchor.com:8080"]
     
     @validator("BACKEND_CORS_ORIGINS", pre=True)
     def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]: