Files
one-pipe-system/src/api/modules/shopPackageAllocation.ts
luo 68aa03b538
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 9m23s
feat: 套餐分配生效条件选择
2026-07-22 14:21:15 +08:00

41 lines
1.1 KiB
TypeScript

/**
* 店铺套餐分配 API 服务
*/
import { BaseService } from '../BaseService'
import type {
BaseResponse,
CreateShopPackageAllocationRequest,
ShopPackageAllocationResponse,
UpdateShopPackageAllocationExpiryBaseRequest
} from '@/types/api'
export class ShopPackageAllocationService extends BaseService {
/**
* 创建店铺套餐分配
* POST /api/admin/shop-package-allocations
*/
static createShopPackageAllocation(
data: CreateShopPackageAllocationRequest
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
return this.post<BaseResponse<ShopPackageAllocationResponse>>(
'/api/admin/shop-package-allocations',
data
)
}
/**
* 更新店铺套餐分配生效条件
* PATCH /api/admin/shop-package-allocations/{id}/expiry-base
*/
static updateShopPackageAllocationExpiryBase(
id: number,
data: UpdateShopPackageAllocationExpiryBaseRequest
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
return this.patch<BaseResponse<ShopPackageAllocationResponse>>(
`/api/admin/shop-package-allocations/${id}/expiry-base`,
data
)
}
}