|
|
@@ -46,6 +46,7 @@ from app.schemas.webhook import SMSHelperWebhookPayload
|
|
|
from app.schemas.vas_task import VasTaskCreate, VasTaskUpdate, VasTaskOut
|
|
|
from app.schemas.ticket import VasTicketCreate, VasTicketOut, VasTicketStatusUpdate, VasTicketMessageCreate, VasTicketMessageOut
|
|
|
from app.schemas.slot_snapshot import SlotSnapshotCreate, SlotSnapshotOut
|
|
|
+from app.schemas.slot_refresh_status import RefreshBase, RefreshFail, RefreshStatusOut
|
|
|
from app.schemas.telegram import TelegramIn
|
|
|
from app.schemas.wechat import WechatIn
|
|
|
from app.schemas.resource import FileUploadOut
|
|
|
@@ -81,7 +82,7 @@ from app.services.wechat_service import WechatService
|
|
|
from app.services.slot_snapshot_service import SlotSnapshotService
|
|
|
from app.services.statistics_service import StatisticsService
|
|
|
from app.services.llm_service import LlmService
|
|
|
-
|
|
|
+from app.services.slot_refresh_status_service import SlotRefreshStatusService
|
|
|
|
|
|
# 公共路由
|
|
|
public_router = APIRouter()
|
|
|
@@ -680,6 +681,29 @@ async def slots_report(
|
|
|
res = await SlotSnapshotService.report(db, redis_client, payload)
|
|
|
return success(data=res)
|
|
|
|
|
|
+@admin_required_router.post("/slot_refresh/start", summary="刷新slot开始", tags=["Slot Monitor 监控"], response_model=ApiResponse[RefreshStatusOut])
|
|
|
+async def slot_refresh_start(data: RefreshBase, db: AsyncSession = Depends(get_db)
|
|
|
+):
|
|
|
+ data = await SlotRefreshStatusService.refresh_start(db, data)
|
|
|
+ return success(data=data)
|
|
|
+
|
|
|
+@admin_required_router.post("/slot_refresh/success", summary="刷新slot成功", tags=["Slot Monitor 监控"], response_model=ApiResponse[RefreshStatusOut])
|
|
|
+async def slot_refresh_success(data: RefreshBase, db: AsyncSession = Depends(get_db)
|
|
|
+):
|
|
|
+ data = await SlotRefreshStatusService.refresh_success(db, data)
|
|
|
+ return success(data=data)
|
|
|
+
|
|
|
+@admin_required_router.post("/slot_refresh/fail", summary="刷新slot失败", tags=["Slot Monitor 监控"], response_model=ApiResponse[RefreshStatusOut])
|
|
|
+async def slot_refresh_fail(data: RefreshFail,db: AsyncSession = Depends(get_db)
|
|
|
+):
|
|
|
+ data = await SlotRefreshStatusService.refresh_fail(db, data)
|
|
|
+ return success(data=data)
|
|
|
+
|
|
|
+@admin_required_router.get("/slot_refresh/status", summary="查询刷新纪录", tags=["Slot Monitor 监控"], response_model=ApiResponse[List[RefreshStatusOut]])
|
|
|
+async def slot_refresh_status(db: AsyncSession = Depends(get_db)):
|
|
|
+ data = await SlotRefreshStatusService.list_all(db)
|
|
|
+ return success(data=data)
|
|
|
+
|
|
|
@public_router.post("/webhook/smshelper", summary="双开助手Webhook", tags=["webhook"], response_model=ApiResponse)
|
|
|
async def webhook_smshelper(
|
|
|
payload: SMSHelperWebhookPayload,
|