fetch(add): 订单管理-企业设备
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m30s

This commit is contained in:
sexygoat
2026-01-29 15:43:45 +08:00
parent 1812b7a6c4
commit 841cf0442b
58 changed files with 8948 additions and 1164 deletions

View File

@@ -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
)
}
}