feat:广播同步
This commit is contained in:
1 parent
e5100b46b1
commit
5613a2fa9e
3 files changed
+22
-2
No files matched your search
@@ -141,4 +141,15 @@ abstract class HardApi {
|
||||
if (res.data == null) return null;
|
||||
return ServiceBroadcastTodayPage.fromJson(res.data);
|
||||
}
|
||||
|
||||
/// android完成一轮广播
|
||||
static Future<ServiceBroadcastTodayPage?> broadcast(
|
||||
dynamic formData,
|
||||
) async {
|
||||
final res = await HttpManage()
|
||||
.dio
|
||||
.post("/hard/hard-broadcast/ad/broadcast", data: formData);
|
||||
if (res.data == null) return null;
|
||||
return ServiceBroadcastTodayPage.fromJson(res.data);
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,16 @@ abstract class SyncTakeFoodBroadcastTool {
|
||||
v.broadcastCount++;
|
||||
await broadcastDao.edit(v);
|
||||
}
|
||||
// 发送mq消息
|
||||
// 通知服务端
|
||||
if (AppNetworkTool.isAutoNetwork()) {
|
||||
final serviceCodeList = currentGroup
|
||||
.map(
|
||||
(e) => e.serviceCode,
|
||||
)
|
||||
.toList();
|
||||
final pa = {"ids": serviceCodeList, "count": 1};
|
||||
await HardApi.broadcast(pa);
|
||||
}
|
||||
}
|
||||
} catch (e, stack) {
|
||||
logger.e("|$_tag|检查广播,广播错误,error:|$e|stack:|$stack|");
|
||||
|
||||
@@ -12,7 +12,7 @@ class Constants {
|
||||
/// 服务 url
|
||||
// static const apiUrl = 'https://stgl.pj.gov.cn/api';
|
||||
|
||||
static const apiUrl = 'http://192.168.101.107:9999';
|
||||
static const apiUrl = 'http://192.168.101.123:9999';
|
||||
|
||||
/// 静态资源 url
|
||||
static const ossUrl = apiUrl;
|
||||
|
||||
Reference in new issue
Block a user