fetch(add): 订单管理-企业设备
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m30s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m30s
This commit is contained in:
@@ -61,6 +61,24 @@ export class BaseService {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* PATCH 请求
|
||||
* @param url 请求URL
|
||||
* @param data 请求数据
|
||||
* @param config 额外配置
|
||||
*/
|
||||
protected static patch<T = any>(
|
||||
url: string,
|
||||
data?: Record<string, any>,
|
||||
config?: Record<string, any>
|
||||
): Promise<T> {
|
||||
return request.patch<T>({
|
||||
url,
|
||||
data,
|
||||
...config
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE 请求
|
||||
* @param url 请求URL
|
||||
|
||||
@@ -354,4 +354,17 @@ export class CardService extends BaseService {
|
||||
static getAssetAllocationRecordDetail(id: number): Promise<BaseResponse<any>> {
|
||||
return this.getOne(`/api/admin/asset-allocation-records/${id}`)
|
||||
}
|
||||
|
||||
// ========== 批量设置卡的套餐系列绑定相关 ==========
|
||||
|
||||
/**
|
||||
* 批量设置卡的套餐系列绑定
|
||||
* @param data 请求参数
|
||||
*/
|
||||
static batchSetCardSeriesBinding(data: {
|
||||
iccids: string[]
|
||||
series_allocation_id: number
|
||||
}): Promise<BaseResponse<any>> {
|
||||
return this.patch('/api/admin/iot-cards/series-binding', data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,11 @@ import type {
|
||||
SubmitWithdrawalParams,
|
||||
ShopCommissionRecordPageResult,
|
||||
ShopCommissionSummaryQueryParams,
|
||||
ShopCommissionSummaryPageResult
|
||||
ShopCommissionSummaryPageResult,
|
||||
MyCommissionStatsQueryParams,
|
||||
MyCommissionStatsResponse,
|
||||
MyDailyCommissionStatsQueryParams,
|
||||
DailyCommissionStatsItem
|
||||
} from '@/types/api/commission'
|
||||
|
||||
export class CommissionService extends BaseService {
|
||||
@@ -130,6 +134,32 @@ export class CommissionService extends BaseService {
|
||||
return this.post<BaseResponse>('/api/admin/my/withdrawal-requests', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的佣金统计
|
||||
* GET /api/admin/my/commission-stats
|
||||
*/
|
||||
static getMyCommissionStats(
|
||||
params?: MyCommissionStatsQueryParams
|
||||
): Promise<BaseResponse<MyCommissionStatsResponse>> {
|
||||
return this.get<BaseResponse<MyCommissionStatsResponse>>(
|
||||
'/api/admin/my/commission-stats',
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的每日佣金统计
|
||||
* GET /api/admin/my/commission-daily-stats
|
||||
*/
|
||||
static getMyDailyCommissionStats(
|
||||
params?: MyDailyCommissionStatsQueryParams
|
||||
): Promise<BaseResponse<DailyCommissionStatsItem[]>> {
|
||||
return this.get<BaseResponse<DailyCommissionStatsItem[]>>(
|
||||
'/api/admin/my/commission-daily-stats',
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
// ==================== 代理商佣金管理 ====================
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,4 +154,17 @@ export class DeviceService extends BaseService {
|
||||
static getImportTaskDetail(id: number): Promise<BaseResponse<DeviceImportTaskDetail>> {
|
||||
return this.getOne<DeviceImportTaskDetail>(`/api/admin/devices/import/tasks/${id}`)
|
||||
}
|
||||
|
||||
// ========== 批量设置设备的套餐系列绑定相关 ==========
|
||||
|
||||
/**
|
||||
* 批量设置设备的套餐系列绑定
|
||||
* @param data 请求参数
|
||||
*/
|
||||
static batchSetDeviceSeriesBinding(data: {
|
||||
device_ids: number[]
|
||||
series_allocation_id: number
|
||||
}): Promise<BaseResponse<any>> {
|
||||
return this.patch('/api/admin/devices/series-binding', data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,14 @@ import type {
|
||||
RecallCardsRequest,
|
||||
RecallCardsResponse
|
||||
} from '@/types/api/enterpriseCard'
|
||||
import type {
|
||||
EnterpriseDeviceListParams,
|
||||
EnterpriseDevicePageResult,
|
||||
AllocateDevicesRequest,
|
||||
AllocateDevicesResponse,
|
||||
RecallDevicesRequest,
|
||||
RecallDevicesResponse
|
||||
} from '@/types/api/enterpriseDevice'
|
||||
|
||||
export class EnterpriseService extends BaseService {
|
||||
/**
|
||||
@@ -157,4 +165,51 @@ export class EnterpriseService extends BaseService {
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
// ========== 企业设备授权相关 ==========
|
||||
|
||||
/**
|
||||
* 授权设备给企业
|
||||
* @param enterpriseId 企业ID
|
||||
* @param data 授权请求数据
|
||||
*/
|
||||
static allocateDevices(
|
||||
enterpriseId: number,
|
||||
data: AllocateDevicesRequest
|
||||
): Promise<BaseResponse<AllocateDevicesResponse>> {
|
||||
return this.post<BaseResponse<AllocateDevicesResponse>>(
|
||||
`/api/admin/enterprises/${enterpriseId}/allocate-devices`,
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业设备列表
|
||||
* @param enterpriseId 企业ID
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getEnterpriseDevices(
|
||||
enterpriseId: number,
|
||||
params?: EnterpriseDeviceListParams
|
||||
): Promise<BaseResponse<EnterpriseDevicePageResult>> {
|
||||
return this.get<BaseResponse<EnterpriseDevicePageResult>>(
|
||||
`/api/admin/enterprises/${enterpriseId}/devices`,
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销设备授权
|
||||
* @param enterpriseId 企业ID
|
||||
* @param data 撤销请求数据
|
||||
*/
|
||||
static recallDevices(
|
||||
enterpriseId: number,
|
||||
data: RecallDevicesRequest
|
||||
): Promise<BaseResponse<RecallDevicesResponse>> {
|
||||
return this.post<BaseResponse<RecallDevicesResponse>>(
|
||||
`/api/admin/enterprises/${enterpriseId}/recall-devices`,
|
||||
data
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,12 @@ export { StorageService } from './storage'
|
||||
export { AuthorizationService } from './authorization'
|
||||
export { DeviceService } from './device'
|
||||
export { CarrierService } from './carrier'
|
||||
export { PackageSeriesService } from './packageSeries'
|
||||
export { PackageManageService } from './packageManage'
|
||||
export { MyPackageService } from './myPackage'
|
||||
export { ShopPackageAllocationService } from './shopPackageAllocation'
|
||||
export { ShopSeriesAllocationService } from './shopSeriesAllocation'
|
||||
export { OrderService } from './order'
|
||||
|
||||
// TODO: 按需添加其他业务模块
|
||||
// export { PackageService } from './package'
|
||||
// export { SettingService } from './setting'
|
||||
|
||||
45
src/api/modules/myPackage.ts
Normal file
45
src/api/modules/myPackage.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* 代理可售套餐 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
MyPackageResponse,
|
||||
MyPackageQueryParams,
|
||||
MySeriesAllocationResponse,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class MyPackageService extends BaseService {
|
||||
/**
|
||||
* 获取我的可售套餐列表
|
||||
* GET /api/admin/my-packages
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getMyPackages(
|
||||
params?: MyPackageQueryParams
|
||||
): Promise<PaginationResponse<MyPackageResponse>> {
|
||||
return this.getPage<MyPackageResponse>('/api/admin/my-packages', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的可售套餐详情
|
||||
* GET /api/admin/my-packages/{id}
|
||||
* @param id 套餐ID
|
||||
*/
|
||||
static getMyPackageDetail(id: number): Promise<BaseResponse<MyPackageResponse>> {
|
||||
return this.getOne<MyPackageResponse>(`/api/admin/my-packages/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的被分配系列列表
|
||||
* GET /api/admin/my-series-allocations
|
||||
* @param params 查询参数(支持分页)
|
||||
*/
|
||||
static getMySeriesAllocations(
|
||||
params?: Record<string, any>
|
||||
): Promise<PaginationResponse<MySeriesAllocationResponse>> {
|
||||
return this.getPage<MySeriesAllocationResponse>('/api/admin/my-series-allocations', params)
|
||||
}
|
||||
}
|
||||
47
src/api/modules/order.ts
Normal file
47
src/api/modules/order.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 订单管理相关 API
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
Order,
|
||||
OrderQueryParams,
|
||||
OrderListResponse,
|
||||
CreateOrderRequest,
|
||||
CreateOrderResponse,
|
||||
BaseResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class OrderService extends BaseService {
|
||||
/**
|
||||
* 获取订单列表
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getOrders(params?: OrderQueryParams): Promise<BaseResponse<OrderListResponse>> {
|
||||
return this.get<BaseResponse<OrderListResponse>>('/api/admin/orders', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
* @param id 订单ID
|
||||
*/
|
||||
static getOrderById(id: number): Promise<BaseResponse<Order>> {
|
||||
return this.getOne<Order>(`/api/admin/orders/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
* @param data 创建订单请求参数
|
||||
*/
|
||||
static createOrder(data: CreateOrderRequest): Promise<BaseResponse<CreateOrderResponse>> {
|
||||
return this.post<BaseResponse<CreateOrderResponse>>('/api/admin/orders', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param id 订单ID
|
||||
*/
|
||||
static cancelOrder(id: number): Promise<BaseResponse> {
|
||||
return this.post<BaseResponse>(`/api/admin/orders/${id}/cancel`, {})
|
||||
}
|
||||
}
|
||||
91
src/api/modules/packageManage.ts
Normal file
91
src/api/modules/packageManage.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 套餐管理 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
PackageResponse,
|
||||
PackageQueryParams,
|
||||
CreatePackageRequest,
|
||||
UpdatePackageRequest,
|
||||
UpdatePackageStatusRequest,
|
||||
UpdatePackageShelfStatusRequest,
|
||||
SeriesSelectOption,
|
||||
BaseResponse,
|
||||
PaginationResponse,
|
||||
ListResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class PackageManageService extends BaseService {
|
||||
/**
|
||||
* 获取套餐分页列表
|
||||
* GET /api/admin/packages
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getPackages(params?: PackageQueryParams): Promise<PaginationResponse<PackageResponse>> {
|
||||
return this.getPage<PackageResponse>('/api/admin/packages', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建套餐
|
||||
* POST /api/admin/packages
|
||||
* @param data 套餐数据
|
||||
*/
|
||||
static createPackage(data: CreatePackageRequest): Promise<BaseResponse<PackageResponse>> {
|
||||
return this.create<PackageResponse>('/api/admin/packages', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取套餐详情
|
||||
* GET /api/admin/packages/{id}
|
||||
* @param id 套餐ID
|
||||
*/
|
||||
static getPackageDetail(id: number): Promise<BaseResponse<PackageResponse>> {
|
||||
return this.getOne<PackageResponse>(`/api/admin/packages/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐
|
||||
* PUT /api/admin/packages/{id}
|
||||
* @param id 套餐ID
|
||||
* @param data 套餐数据
|
||||
*/
|
||||
static updatePackage(
|
||||
id: number,
|
||||
data: UpdatePackageRequest
|
||||
): Promise<BaseResponse<PackageResponse>> {
|
||||
return this.update<PackageResponse>(`/api/admin/packages/${id}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除套餐
|
||||
* DELETE /api/admin/packages/{id}
|
||||
* @param id 套餐ID
|
||||
*/
|
||||
static deletePackage(id: number): Promise<BaseResponse> {
|
||||
return this.remove(`/api/admin/packages/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐状态
|
||||
* PUT /api/admin/packages/{id}/status
|
||||
* @param id 套餐ID
|
||||
* @param status 状态 (1:启用, 2:禁用)
|
||||
*/
|
||||
static updatePackageStatus(id: number, status: number): Promise<BaseResponse> {
|
||||
const data: UpdatePackageStatusRequest = { status }
|
||||
return this.put<BaseResponse>(`/api/admin/packages/${id}/status`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐上架状态
|
||||
* PATCH /api/admin/packages/{id}/shelf
|
||||
* @param id 套餐ID
|
||||
* @param shelf_status 上架状态 (1:上架, 2:下架)
|
||||
*/
|
||||
static updatePackageShelfStatus(id: number, shelf_status: number): Promise<BaseResponse> {
|
||||
const data: UpdatePackageShelfStatusRequest = { shelf_status }
|
||||
return this.patch<BaseResponse>(`/api/admin/packages/${id}/shelf`, data)
|
||||
}
|
||||
|
||||
}
|
||||
83
src/api/modules/packageSeries.ts
Normal file
83
src/api/modules/packageSeries.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* 套餐系列管理 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
PackageSeriesResponse,
|
||||
PackageSeriesQueryParams,
|
||||
CreatePackageSeriesRequest,
|
||||
UpdatePackageSeriesRequest,
|
||||
UpdatePackageSeriesStatusRequest,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class PackageSeriesService extends BaseService {
|
||||
/**
|
||||
* 获取套餐系列分页列表
|
||||
* GET /api/admin/package-series
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getPackageSeries(
|
||||
params?: PackageSeriesQueryParams
|
||||
): Promise<PaginationResponse<PackageSeriesResponse>> {
|
||||
return this.getPage<PackageSeriesResponse>('/api/admin/package-series', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建套餐系列
|
||||
* POST /api/admin/package-series
|
||||
* @param data 套餐系列数据
|
||||
*/
|
||||
static createPackageSeries(
|
||||
data: CreatePackageSeriesRequest
|
||||
): Promise<BaseResponse<PackageSeriesResponse>> {
|
||||
return this.create<PackageSeriesResponse>('/api/admin/package-series', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取套餐系列详情
|
||||
* GET /api/admin/package-series/{id}
|
||||
* @param id 系列ID
|
||||
*/
|
||||
static getPackageSeriesDetail(id: number): Promise<BaseResponse<PackageSeriesResponse>> {
|
||||
return this.getOne<PackageSeriesResponse>(`/api/admin/package-series/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐系列
|
||||
* PUT /api/admin/package-series/{id}
|
||||
* @param id 系列ID
|
||||
* @param data 套餐系列数据
|
||||
*/
|
||||
static updatePackageSeries(
|
||||
id: number,
|
||||
data: UpdatePackageSeriesRequest
|
||||
): Promise<BaseResponse<PackageSeriesResponse>> {
|
||||
return this.update<PackageSeriesResponse>(`/api/admin/package-series/${id}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除套餐系列
|
||||
* DELETE /api/admin/package-series/{id}
|
||||
* @param id 系列ID
|
||||
*/
|
||||
static deletePackageSeries(id: number): Promise<BaseResponse> {
|
||||
return this.remove(`/api/admin/package-series/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐系列状态
|
||||
* PUT /api/admin/package-series/{id}/status
|
||||
* @param id 系列ID
|
||||
* @param status 状态 (1:启用, 2:禁用)
|
||||
*/
|
||||
static updatePackageSeriesStatus(
|
||||
id: number,
|
||||
status: number
|
||||
): Promise<BaseResponse> {
|
||||
const data: UpdatePackageSeriesStatusRequest = { status }
|
||||
return this.put<BaseResponse>(`/api/admin/package-series/${id}/status`, data)
|
||||
}
|
||||
}
|
||||
109
src/api/modules/shopPackageAllocation.ts
Normal file
109
src/api/modules/shopPackageAllocation.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 单套餐分配 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
ShopPackageAllocationResponse,
|
||||
ShopPackageAllocationQueryParams,
|
||||
CreateShopPackageAllocationRequest,
|
||||
UpdateShopPackageAllocationRequest,
|
||||
UpdateShopPackageAllocationStatusRequest,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class ShopPackageAllocationService extends BaseService {
|
||||
/**
|
||||
* 获取单套餐分配列表
|
||||
* GET /api/admin/shop-package-allocations
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getShopPackageAllocations(
|
||||
params?: ShopPackageAllocationQueryParams
|
||||
): Promise<PaginationResponse<ShopPackageAllocationResponse>> {
|
||||
return this.getPage<ShopPackageAllocationResponse>(
|
||||
'/api/admin/shop-package-allocations',
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建单套餐分配
|
||||
* POST /api/admin/shop-package-allocations
|
||||
* @param data 分配数据
|
||||
*/
|
||||
static createShopPackageAllocation(
|
||||
data: CreateShopPackageAllocationRequest
|
||||
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
|
||||
return this.create<ShopPackageAllocationResponse>(
|
||||
'/api/admin/shop-package-allocations',
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单套餐分配详情
|
||||
* GET /api/admin/shop-package-allocations/{id}
|
||||
* @param id 分配ID
|
||||
*/
|
||||
static getShopPackageAllocationDetail(
|
||||
id: number
|
||||
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
|
||||
return this.getOne<ShopPackageAllocationResponse>(
|
||||
`/api/admin/shop-package-allocations/${id}`
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新单套餐分配
|
||||
* PUT /api/admin/shop-package-allocations/{id}
|
||||
* @param id 分配ID
|
||||
* @param data 分配数据(只允许修改成本价)
|
||||
*/
|
||||
static updateShopPackageAllocation(
|
||||
id: number,
|
||||
data: UpdateShopPackageAllocationRequest
|
||||
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
|
||||
return this.update<ShopPackageAllocationResponse>(
|
||||
`/api/admin/shop-package-allocations/${id}`,
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单套餐分配
|
||||
* DELETE /api/admin/shop-package-allocations/{id}
|
||||
* @param id 分配ID
|
||||
*/
|
||||
static deleteShopPackageAllocation(id: number): Promise<BaseResponse> {
|
||||
return this.remove(`/api/admin/shop-package-allocations/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新单套餐分配成本价
|
||||
* PUT /api/admin/shop-package-allocations/{id}/cost-price
|
||||
* @param id 分配ID
|
||||
* @param costPrice 成本价(分)
|
||||
*/
|
||||
static updateShopPackageAllocationCostPrice(
|
||||
id: number,
|
||||
costPrice: number
|
||||
): Promise<BaseResponse<ShopPackageAllocationResponse>> {
|
||||
return this.put<BaseResponse<ShopPackageAllocationResponse>>(
|
||||
`/api/admin/shop-package-allocations/${id}/cost-price`,
|
||||
{ cost_price: costPrice }
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新单套餐分配状态
|
||||
* PUT /api/admin/shop-package-allocations/{id}/status
|
||||
* @param id 分配ID
|
||||
* @param status 状态 (1:启用, 2:禁用)
|
||||
*/
|
||||
static updateShopPackageAllocationStatus(id: number, status: number): Promise<BaseResponse> {
|
||||
const data: UpdateShopPackageAllocationStatusRequest = { status }
|
||||
return this.put<BaseResponse>(`/api/admin/shop-package-allocations/${id}/status`, data)
|
||||
}
|
||||
}
|
||||
88
src/api/modules/shopSeriesAllocation.ts
Normal file
88
src/api/modules/shopSeriesAllocation.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 套餐系列分配 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
ShopSeriesAllocationResponse,
|
||||
ShopSeriesAllocationQueryParams,
|
||||
CreateShopSeriesAllocationRequest,
|
||||
UpdateShopSeriesAllocationRequest,
|
||||
UpdateShopSeriesAllocationStatusRequest,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class ShopSeriesAllocationService extends BaseService {
|
||||
/**
|
||||
* 获取套餐系列分配分页列表
|
||||
* GET /api/admin/shop-series-allocations
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getShopSeriesAllocations(
|
||||
params?: ShopSeriesAllocationQueryParams
|
||||
): Promise<PaginationResponse<ShopSeriesAllocationResponse>> {
|
||||
return this.getPage<ShopSeriesAllocationResponse>(
|
||||
'/api/admin/shop-series-allocations',
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建套餐系列分配
|
||||
* POST /api/admin/shop-series-allocations
|
||||
* @param data 分配数据
|
||||
*/
|
||||
static createShopSeriesAllocation(
|
||||
data: CreateShopSeriesAllocationRequest
|
||||
): Promise<BaseResponse<ShopSeriesAllocationResponse>> {
|
||||
return this.create<ShopSeriesAllocationResponse>('/api/admin/shop-series-allocations', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取套餐系列分配详情
|
||||
* GET /api/admin/shop-series-allocations/{id}
|
||||
* @param id 分配ID
|
||||
*/
|
||||
static getShopSeriesAllocationDetail(
|
||||
id: number
|
||||
): Promise<BaseResponse<ShopSeriesAllocationResponse>> {
|
||||
return this.getOne<ShopSeriesAllocationResponse>(`/api/admin/shop-series-allocations/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐系列分配
|
||||
* PUT /api/admin/shop-series-allocations/{id}
|
||||
* @param id 分配ID
|
||||
* @param data 分配数据
|
||||
*/
|
||||
static updateShopSeriesAllocation(
|
||||
id: number,
|
||||
data: UpdateShopSeriesAllocationRequest
|
||||
): Promise<BaseResponse<ShopSeriesAllocationResponse>> {
|
||||
return this.update<ShopSeriesAllocationResponse>(
|
||||
`/api/admin/shop-series-allocations/${id}`,
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除套餐系列分配
|
||||
* DELETE /api/admin/shop-series-allocations/{id}
|
||||
* @param id 分配ID
|
||||
*/
|
||||
static deleteShopSeriesAllocation(id: number): Promise<BaseResponse> {
|
||||
return this.remove(`/api/admin/shop-series-allocations/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新套餐系列分配状态
|
||||
* PUT /api/admin/shop-series-allocations/{id}/status
|
||||
* @param id 分配ID
|
||||
* @param status 状态 (1:启用, 2:禁用)
|
||||
*/
|
||||
static updateShopSeriesAllocationStatus(id: number, status: number): Promise<BaseResponse> {
|
||||
const data: UpdateShopSeriesAllocationStatusRequest = { status }
|
||||
return this.put<BaseResponse>(`/api/admin/shop-series-allocations/${id}/status`, data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user