feat:消费机更新
feat:人员调用钱包部门不调动的bug
This commit is contained in:
1 parent
842402e364
commit
60d9380a65
144 files changed
+27832
-1666
No files matched your search
@@ -75,6 +75,104 @@ abstract class UserApi {
|
||||
.toList();
|
||||
}
|
||||
|
||||
/// 按固定主键上界游标读取本部门及子部门的 V3 人脸权威快照。
|
||||
static Future<ServiceFaceSyncSnapshot> getFaceSyncSnapshot(
|
||||
Map<String, dynamic> requestBody,
|
||||
) async {
|
||||
final res = await HttpManage().dio.post(
|
||||
"/admin/user-face/ad/v3/sync-snapshot",
|
||||
data: requestBody,
|
||||
);
|
||||
if (res.data is! Map) {
|
||||
throw const FormatException('服务端未返回有效的人脸快照');
|
||||
}
|
||||
return ServiceFaceSyncSnapshot.fromJson(
|
||||
Map<String, dynamic>.from(res.data as Map),
|
||||
);
|
||||
}
|
||||
|
||||
/// 由当前设备请求删除服务端部门范围内的人脸,单批最多 500 条。
|
||||
///
|
||||
/// 服务端会以 DEVICE-ID 解析真实绑定部门;业务错误必须抛给调用方,确保终端
|
||||
/// 在未得到 deleted 或 alreadyAbsent 确认前不清理本地数据。
|
||||
static Future<ServiceTerminalFaceDeleteResult> deleteTerminalFaces(
|
||||
List<String> sampleIds,
|
||||
) async {
|
||||
final setting = await AppSettingTool.getSysSetting();
|
||||
final hardId = setting.serviceId;
|
||||
if (hardId == null) throw StateError('终端尚未绑定设备');
|
||||
final res = await HttpManage().dio.post(
|
||||
'/hard/hard-api/ad/face/delete',
|
||||
data: {'sampleIds': sampleIds},
|
||||
options: dio.Options(
|
||||
headers: {'DEVICE-ID': hardId},
|
||||
extra: {HttpManage.rejectBusinessErrorKey: true},
|
||||
),
|
||||
);
|
||||
if (res.data is! Map) {
|
||||
throw const FormatException('服务端未返回有效的人脸删除结果');
|
||||
}
|
||||
return ServiceTerminalFaceDeleteResult.fromJson(
|
||||
Map<String, dynamic>.from(res.data as Map),
|
||||
);
|
||||
}
|
||||
|
||||
/// 由当前设备批量上报在库人脸静态图片质量,单批最多 500 条。
|
||||
///
|
||||
/// 服务端通过 DEVICE-ID 解析可信设备和部门;业务失败必须抛出,但调用方应将
|
||||
/// 质量上报与既有人脸同步、注册和识别结果隔离,网络失败不得回滚本地质量。
|
||||
static Future<ServiceFaceQualityReportResult> reportTerminalFaceQuality(
|
||||
List<ServiceFaceQualityReportItem> items,
|
||||
) async {
|
||||
if (items.isEmpty) throw ArgumentError.value(items, 'items', '质量结果不能为空');
|
||||
if (items.length > 500) {
|
||||
throw ArgumentError.value(items.length, 'items', '单批最多上报500条质量结果');
|
||||
}
|
||||
final setting = await AppSettingTool.getSysSetting();
|
||||
final hardId = setting.serviceId;
|
||||
if (hardId == null) throw StateError('终端尚未绑定设备');
|
||||
final res = await HttpManage().dio.post(
|
||||
'/hard/hard-api/ad/face/quality/report',
|
||||
data: {
|
||||
'items': items.map((item) => item.toJson()).toList(growable: false),
|
||||
},
|
||||
options: dio.Options(
|
||||
headers: {'DEVICE-ID': hardId},
|
||||
extra: {HttpManage.rejectBusinessErrorKey: true},
|
||||
),
|
||||
);
|
||||
if (res.data is! Map) {
|
||||
throw const FormatException('服务端未返回有效的人脸质量上报结果');
|
||||
}
|
||||
return ServiceFaceQualityReportResult.fromJson(
|
||||
Map<String, dynamic>.from(res.data as Map),
|
||||
);
|
||||
}
|
||||
|
||||
/// 竞争当前商户部门的人脸质量上报租约。
|
||||
///
|
||||
/// Hardware 仍会在实际上报时二次验证租约;未取得租约不是业务失败,调用方应
|
||||
/// 直接跳过本轮质量批次,避免同一单位的多台终端重复发送相同在库结果。
|
||||
static Future<ServiceFaceQualityLease>
|
||||
acquireTerminalFaceQualityLease() async {
|
||||
final setting = await AppSettingTool.getSysSetting();
|
||||
final hardId = setting.serviceId;
|
||||
if (hardId == null) throw StateError('终端尚未绑定设备');
|
||||
final res = await HttpManage().dio.post(
|
||||
'/hard/hard-api/ad/face/quality/lease',
|
||||
options: dio.Options(
|
||||
headers: {'DEVICE-ID': hardId},
|
||||
extra: {HttpManage.rejectBusinessErrorKey: true},
|
||||
),
|
||||
);
|
||||
if (res.data is! Map) {
|
||||
throw const FormatException('服务端未返回有效的人脸质量租约');
|
||||
}
|
||||
return ServiceFaceQualityLease.fromJson(
|
||||
Map<String, dynamic>.from(res.data as Map),
|
||||
);
|
||||
}
|
||||
|
||||
/// 获取租户列表
|
||||
static Future<List<ServiceTenant>?> getTenantList() async {
|
||||
final res = await HttpManage().dio.get("/admin/tenant/list");
|
||||
|
||||
Reference in new issue
Block a user