完成部分API路由以及文档
This commit is contained in:
104
routers/controllers/vas.py
Normal file
104
routers/controllers/vas.py
Normal file
@@ -0,0 +1,104 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from middleware.auth import SignRequired
|
||||
from models.response import ResponseModel
|
||||
|
||||
vas_router = APIRouter(
|
||||
prefix="/vas",
|
||||
tags=["vas"]
|
||||
)
|
||||
|
||||
@vas_router.get(
|
||||
path='/pack',
|
||||
summary='获取容量包及配额信息',
|
||||
description='Get information about storage packs and quotas.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_pack() -> ResponseModel:
|
||||
"""
|
||||
Get information about storage packs and quotas.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for storage packs and quotas.
|
||||
"""
|
||||
...
|
||||
|
||||
@vas_router.get(
|
||||
path='/product',
|
||||
summary='获取商品信息,同时返回支付信息',
|
||||
description='Get product information along with payment details.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_product() -> ResponseModel:
|
||||
"""
|
||||
Get product information along with payment details.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for products and payment information.
|
||||
"""
|
||||
...
|
||||
|
||||
@vas_router.post(
|
||||
path='/order',
|
||||
summary='新建支付订单',
|
||||
description='Create an order for a product.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_order() -> ResponseModel:
|
||||
"""
|
||||
Create an order for a product.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for the created order.
|
||||
"""
|
||||
...
|
||||
|
||||
@vas_router.get(
|
||||
path='/order/{id}',
|
||||
summary='查询订单状态',
|
||||
description='Get information about a specific payment order by ID.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_order_get(id: str) -> ResponseModel:
|
||||
"""
|
||||
Get information about a specific payment order by ID.
|
||||
|
||||
Args:
|
||||
id (str): The ID of the order to retrieve information for.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for the specified order.
|
||||
"""
|
||||
...
|
||||
|
||||
@vas_router.get(
|
||||
path='/redeem',
|
||||
summary='获取兑换码信息',
|
||||
description='Get information about a specific redemption code.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_redeem(code: str) -> ResponseModel:
|
||||
"""
|
||||
Get information about a specific redemption code.
|
||||
|
||||
Args:
|
||||
code (str): The redemption code to retrieve information for.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for the specified redemption code.
|
||||
"""
|
||||
...
|
||||
|
||||
@vas_router.post(
|
||||
path='/redeem',
|
||||
summary='执行兑换',
|
||||
description='Redeem a redemption code for a product or service.',
|
||||
dependencies=[Depends(SignRequired)]
|
||||
)
|
||||
def router_vas_redeem_post() -> ResponseModel:
|
||||
"""
|
||||
Redeem a redemption code for a product or service.
|
||||
|
||||
Returns:
|
||||
ResponseModel: A model containing the response data for the redeemed code.
|
||||
"""
|
||||
...
|
||||
Reference in New Issue
Block a user