功能:隔离五类测试业务链路
This commit is contained in:
@@ -13,6 +13,8 @@ from common.enums import BusinessType
|
||||
from common.router import APIRouterPro
|
||||
from common.vo import DataResponseModel, PageResponseModel
|
||||
from module_admin.entity.vo.user_vo import CurrentUserModel
|
||||
from module_business.dependency.test_batch_dependency import TestBatchScopeDependency
|
||||
from module_business.domain.test_batch_scope import TestBatchScope
|
||||
from module_business.entity.vo.operation_vo import (
|
||||
BusinessOptionModel,
|
||||
PalletScanResponseModel,
|
||||
@@ -43,11 +45,13 @@ async def get_business_usage_list(
|
||||
usage_page_query: Annotated[UsagePageQueryModel, Query()],
|
||||
query_db: Annotated[AsyncSession, DBSessionDependency()],
|
||||
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
|
||||
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
|
||||
) -> Response:
|
||||
result = await UsageService.get_usage_list_services(
|
||||
query_db,
|
||||
usage_page_query,
|
||||
current_user,
|
||||
test_scope,
|
||||
is_page=True,
|
||||
)
|
||||
return ResponseUtil.success(model_content=result)
|
||||
@@ -65,8 +69,9 @@ async def get_business_usage_line_options(
|
||||
site_id: Annotated[int, Query(alias='siteId', gt=0, description='客户现场ID')],
|
||||
query_db: Annotated[AsyncSession, DBSessionDependency()],
|
||||
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
|
||||
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
|
||||
) -> Response:
|
||||
result = await UsageService.get_line_options_services(query_db, site_id, current_user)
|
||||
result = await UsageService.get_line_options_services(query_db, site_id, current_user, test_scope)
|
||||
return ResponseUtil.success(data=result)
|
||||
|
||||
|
||||
@@ -85,8 +90,9 @@ async def scan_business_usage_pallet(
|
||||
],
|
||||
query_db: Annotated[AsyncSession, DBSessionDependency()],
|
||||
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
|
||||
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
|
||||
) -> Response:
|
||||
result = await UsageService.scan_usage_pallet_services(query_db, qr_token, current_user)
|
||||
result = await UsageService.scan_usage_pallet_services(query_db, qr_token, current_user, test_scope)
|
||||
return ResponseUtil.success(data=result)
|
||||
|
||||
|
||||
@@ -102,8 +108,9 @@ async def query_detail_business_usage(
|
||||
usage_id: Annotated[int, Path(gt=0, description='使用记录ID')],
|
||||
query_db: Annotated[AsyncSession, DBSessionDependency()],
|
||||
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
|
||||
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
|
||||
) -> Response:
|
||||
result = await UsageService.usage_detail_services(query_db, usage_id, current_user)
|
||||
result = await UsageService.usage_detail_services(query_db, usage_id, current_user, test_scope)
|
||||
return ResponseUtil.success(data=result)
|
||||
|
||||
|
||||
@@ -120,6 +127,7 @@ async def add_business_usage(
|
||||
add_usage: UsageCreateModel,
|
||||
query_db: Annotated[AsyncSession, DBSessionDependency()],
|
||||
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
|
||||
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
|
||||
) -> Response:
|
||||
result = await UsageService.record_usage_services(query_db, add_usage, current_user)
|
||||
result = await UsageService.record_usage_services(query_db, add_usage, current_user, test_scope)
|
||||
return ResponseUtil.success(msg=result.message, data=result.result)
|
||||
|
||||
Reference in New Issue
Block a user