初始化

This commit is contained in:
wyf
2026-01-20 21:30:10 +08:00
commit c54f76cd0c
34 changed files with 5262 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

3
CHANGELOG.md Normal file
View File

@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.

30
analysis_options.yaml Normal file
View File

@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -0,0 +1,63 @@
class CommonVariables {
static bool isNetWorkOn = false;
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
// 企业微信客服拉起的url地址
// static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfc7d2337b9c07b1269";
// 企业微信ID
// static String wxCorpId = "wwc17348c75dbde1dc";
static String wxCorpId = "ww51feda6026280cd0";
//ICP备案号
static String ICPRightCode = "皖ICP备2024068219号-1A";
//公司名称
static String enterpriseName = "合肥眠花糖家具有限责任公司";
//备案时间
static String ICPTime = "2019-2029";
static String shoph5Url = "https://zhmht.swes.com.cn:1443";
static Map<String, Function(dynamic)> callMap = {};
static const String weather_apiKey =
'40e23445cf0a29561af2b5b7d506a38b'; // 替换为你的 API 密钥
static String shareText = "您的朋友邀请您使用《智慧眠花糖》APP请复制后面链接在浏览器中打开 " +
shoph5Url +
"/#/pages/download/download";
//容器圆角
static double filter_selector_border_radius = 50;
static double slider_container_border_radius = 10;
static double dialog_selector_border_radius = 6;
//列表数据(X秒内为刚刚数据)
static int recent_data_time = 60 * 5;
//表格间距
static int form_padding_small = 1;
static int form_padding_medium = 5;
static int form_padding_large = 8;
//内容容器最小高度百分比
static double text_height_small_percent = 0.036; //注释
static double text_height_medium_percent = 0.037; //正文
static double text_height_large_percent = 0.046; //标题/搜索栏
static double text_height_more_large_percent = 0.074; //菜单
static double icon_height_medium_percent = 0.014; //icon
static int default_page = 1;
static int default_limit_max = 999999;
static int default_limit = 10;
//下拉最大高度
static double dropdown_max_height = 200;
//详情弹窗左边字段显示宽度百分比
static double dialog_attribute_width_percent = 0.15;
static String default_gender = "1";
static bool default_vibrate = true;
static int default_weight = 65;
static int default_age = 30;
static String default_phone = "18612345678";
static int default_height = 170;
static String default_username = "眠眠";
}

9
bin/const/Constants.dart Normal file
View File

@@ -0,0 +1,9 @@
class Constants {
static const int port = 9200;
static const String serviceName = "vsbs_room";
static int default_page = 1;
static int default_limit_max = 999999;
static int default_limit = 10;
}

View File

@@ -0,0 +1,4 @@
class HttpStatusCode {
static const int ok = 200; // 请求成功,服务器已返回请求的数据。
static const int internalServerError = 500; // 服务器内部错误。
}

View File

@@ -0,0 +1,10 @@
class MessageConstants {
// 成功提示
static const String DELETE_ERROR = "删除失败,请联系管理员";
static const String UPDATE_ERROR = "更新失败,请联系管理员";
static const String ADD_ERROR = "添加失败,请联系管理员";
static const String ADD_SUCCESS = "添加成功";
static const String UPDATE_SUCCESS = "更新成功";
static const String DELETE_SUCCESS = "删除成功";
}

View File

@@ -0,0 +1,13 @@
enum MessageType {
instant_alarm("1", "实时体征消息"), // 实时体征消息
check_in("2", "入住消息"), // 入住消息
service("3", "服务消息"), // 服务消息
system("4", "系统消息"); // 系统消息
// 枚举的值
final String code; // 整数值
final String description; // 字符串描述
// 构造函数
const MessageType(this.code, this.description);
}

View File

@@ -0,0 +1,4 @@
class ResponseJsonCode {
static const int success = 200; // 操作成功
static const int fail = 400; // 操作失败
}

View File

@@ -0,0 +1,12 @@
enum RuzhuMessageType {
reservation("1", "预约消息"), // 预约消息
check_in("2", "入住消息"), // 入住消息
check_out("3", "退住消息"); // 退住消息
// 枚举的值
final String code; // 整数值
final String description; // 字符串描述
// 构造函数
const RuzhuMessageType(this.code, this.description);
}

View File

@@ -0,0 +1,38 @@
class ServiceConstant {
//基础地址
// static const String baseHost = "vsbs.he-info.cn";
// static const String baseHost = "vsbst-api.he-info.cn";
static const String baseHost = "vsbs-test.he-info.cn";
static const String apibaseHost = "songxia.he-info.com";
//服务地址
static String service_address = "https://$apibaseHost";
static String web_service_address = "http://$baseHost";
static String app_server_service = "/wx/app/bizreport/app"; //服务名称
//服务名称及api
//房间类型
//房间
static const String room_service = "/vsbs_room";
static const String room_list = "/room/roomList"; //房间列表
static const String disease_range_data = "/statistics/disease";
//日志
static String logService = "$web_service_address/vsbs_log";
//websocket网关
static const String webSocketService = "wss://$baseHost/vsbs_ws_gateway/ws";
//数据中心
static String dataCenterService = "$service_address/vsbs_data_center";
static const String sleepReportData = "/api/sleep/data/list"; //睡眠报告数据
//机构数据
static String agency_service = "$service_address/vsbs_agency"; //机构服务
static const String agency_list = "/agency/allAgencyList"; //获取机构列表
//用户中心
static String userCenterService = "$service_address/vsbs_user_center";
//添加报警
static const String addMessage = "/api/message/info";
static const String message_service = "/vsbs_message_center";
static const String message_list = "/api/message/info"; //查询消息
set serviceAddress(String host) {
service_address = host;
}
}

View File

@@ -0,0 +1,241 @@
import 'dart:convert';
import 'package:EasyDartModule/EasyDartModule.dart';
import 'package:EasyDartModule/base/webserver/WebServer.dart';
import '../const/HttpStatusCode.dart';
import '../const/MessageConstants.dart';
import '../const/ResponseJsonCode.dart';
import '../model/ApiResponse.dart';
import '../service/AreaService.dart';
part 'AreaController.route.dart';
@RequestMapping(path: "/report")
class AreaController {
final AreaService areaService = AreaService();
set callHandler(handler) => _callHandler = handler;
Map<HttpMethod, List<List>> get routeMap => routes;
AreaController();
// 获取实时数据
@RequestMapping(path: "/getInstantData", method: HttpMethod.GET,auth: false)
Future<Response> getInstantData(
Request request, Map<String, dynamic> jwt) async {
ApiResponse<List> apiResponse = ApiResponse();
try {
var queryParameters = request.requestedUri.queryParameters;
String? mac = queryParameters['mac'];
String? openId = queryParameters['openId'];
if (mac == null || mac.isEmpty) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "查询失败设备mac不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
if (openId == null || openId.isEmpty) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "查询失败设备openId不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
Map result = await areaService.getInstantData(mac,openId);
if (result['flag'] == 1) {
// 成功
// apiResponse.code = ResponseJsonCode.success;
// apiResponse.message = result['msg'] ?? "查询成功";
// apiResponse.data = result['data'];
apiResponse.code = ResponseJsonCode.success;
apiResponse.message = result['msg'] ?? "查询成功";
// 2. 将 result['data'] 包装成 List<Map<String, dynamic>>
if (result['data'] != null) {
// result['data'] 是一个 Map包装成 List
Map<String, dynamic> dataMap =
Map<String, dynamic>.from(result['data']);
// 可以在这里添加一些额外字段(可选)
dataMap['responseTime'] = DateTime.now().millisecondsSinceEpoch;
// 将单个 Map 放入 List 中
apiResponse.data = [dataMap];
} else {
apiResponse.data = [];
}
} else {
// 失败
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = result['msg'] ?? "查询失败";
apiResponse.data = null;
}
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
} catch (e) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "查询失败: $e";
return Response(
HttpStatusCode.internalServerError,
body: apiResponse.serialize(),
);
}
}
// 开始体验设备
@RequestMapping(path: "/start", method: HttpMethod.POST,auth: false)
Future<Response> start(Request request) async {
ApiResponse<String> apiResponse = ApiResponse();
try {
var data = jsonDecode(await request.readAsString());
if (data == null || data.isEmpty || data['mac'] == null) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "请求失败设备mac不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
if (data == null || data.isEmpty || data['openId'] == null) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "请求失败设备openId不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
Map result = await areaService.startKuaijian(data);
if (result['flag'] == 1) {
apiResponse.code = ResponseJsonCode.success;
apiResponse.message = result['msg'] ?? MessageConstants.ADD_SUCCESS;
} else {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = result['msg'] ?? "操作失败";
}
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
} catch (e) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "添加失败: $e";
return Response(
HttpStatusCode.internalServerError,
body: apiResponse.serialize(),
);
}
}
// 结束体验设备
@RequestMapping(path: "/end", method: HttpMethod.POST,auth: false)
Future<Response> end(Request request) async {
ApiResponse<String> apiResponse = ApiResponse();
try {
var data = jsonDecode(await request.readAsString());
if (data == null || data.isEmpty || data['mac'] == null) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "请求失败设备mac不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
if (data == null || data.isEmpty || data['openId'] == null) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "请求失败设备openId不能为空";
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
}
Map result = await areaService.endKuaijian(data);
if (result['flag'] == 1) {
apiResponse.code = ResponseJsonCode.success;
apiResponse.message = result['msg'] ?? MessageConstants.ADD_SUCCESS;
} else {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = result['msg'] ?? "操作失败";
}
return Response(
HttpStatusCode.ok,
body: apiResponse.serialize(),
);
} catch (e) {
apiResponse.code = ResponseJsonCode.fail;
apiResponse.message = "添加失败: $e";
return Response(
HttpStatusCode.internalServerError,
body: apiResponse.serialize(),
);
}
}
// // 更新区域
// @RequestMapping(path: "/updateArea", method: HttpMethod.PUT)
// Future<Response> updateArea(Request request) async {
// ApiResponse<String> apiResponse = ApiResponse();
// try {
// var data = jsonDecode(await request.readAsString());
// var areaId = data['_id'];
// var updatedArea = Area.fromJson(data);
// if (updatedArea.id == null || updatedArea.id!.isEmpty) {
// apiResponse.code = ResponseJsonCode.fail;
// apiResponse.message = "区域ID不能为空";
// String serializedJson = apiResponse.serialize();
// return Response(HttpStatusCode.ok, body: serializedJson);
// }
// var result = await areaService.updateArea(areaId, updatedArea);
// apiResponse.code = 1;
// apiResponse.message = result;
// String serializedJson = apiResponse.serialize();
// return Response(200, body: serializedJson); // 发送成功响应
// } catch (e) {
// apiResponse.code = -1;
// apiResponse.message = "更新失败: $e"; // 包含异常信息
// String serializedJson = apiResponse.serialize();
// return Response(500, body: serializedJson); // 发送失败响应
// }
// }
// 删除区域
// @RequestMapping(path: "/deleteArea", method: HttpMethod.DELETE)
// Future<Response> deleteArea(Request request) async {
// ApiResponse<String> apiResponse = ApiResponse();
// try {
// var data = jsonDecode(await request.readAsString());
// var areaId = data['areaId'];
// var result = await areaService.deleteArea(areaId);
// apiResponse.code = 1;
// if (result.isEmpty) {
// apiResponse.code = ResponseJsonCode.success;
// apiResponse.message = MessageConstants.DELETE_SUCCESS;
// String serializedJson = apiResponse.serialize();
// return Response(HttpStatusCode.ok, body: serializedJson); // 发送成功响应
// }
// apiResponse.code = ResponseJsonCode.fail;
// apiResponse.message = result;
// String serializedJson = apiResponse.serialize();
// return Response(HttpStatusCode.ok, body: serializedJson);
// } catch (e) {
// apiResponse.code = -1;
// apiResponse.message = "删除失败: $e"; // 包含异常信息
// String serializedJson = apiResponse.serialize();
// return Response(500, body: serializedJson); // 发送失败响应
// }
// }
}

View File

@@ -0,0 +1,24 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// RouteGenerator
// **************************************************************************
part of 'AreaController.dart';
late var _callHandler;
final Map<HttpMethod, List<List>> routes = {
HttpMethod.GET: [
[
"/report/getInstantData",
HttpResponseType.JSON,
_callHandler.getInstantData,
2,
false
]
],
HttpMethod.POST: [
["/report/start", HttpResponseType.JSON, _callHandler.start, 1, false],
["/report/end", HttpResponseType.JSON, _callHandler.end, 1, false]
],
};

View File

@@ -0,0 +1,80 @@
/// 报告状态枚举
enum ReportStatus {
experienceing, // 0 - 体验中 ok
generating, // 1 - 生成报告中 ok
appNormalClose, // 2 - APP正常关闭 ok
appAbnormalClose, // 3 - APP异常关闭 ok 可以捕获到的异常
appActiveClose, // 4 - APP主动关闭 ok
reportExceptionClose,// 5 - 报告生成异常关闭 ok
completed, // 9 - 完成
//网络断掉了怎么办todo websocket心跳 弹窗提示 微信视频结束之后要将微信标志重置 监听网络状态
//网络 蓝牙 视频播放 设备连接
//todo 监听网络状态 失败了停止播放视频
//todo 监听蓝牙状态 断掉就停止播放视频并且发送异常关闭
//todo 重新打开app
}
/// 扩展方法,提供数字映射和文本描述
extension ReportStatusExtension on ReportStatus {
/// 获取对应的数字状态值
int get value {
switch (this) {
case ReportStatus.experienceing:
return 0;
case ReportStatus.generating:
return 1;
case ReportStatus.appNormalClose:
return 2;
case ReportStatus.appAbnormalClose:
return 3;
case ReportStatus.appActiveClose:
return 4;
case ReportStatus.reportExceptionClose:
return 5;
case ReportStatus.completed:
return 9;
}
}
/// 获取文本描述
String get label {
switch (this) {
case ReportStatus.experienceing:
return "体验中";
case ReportStatus.generating:
return "生成报告中";
case ReportStatus.appNormalClose:
return "APP正常关闭";
case ReportStatus.appAbnormalClose:
return "APP异常关闭";
case ReportStatus.appActiveClose:
return "APP主动关闭";
case ReportStatus.reportExceptionClose:
return "报告生成异常关闭";
case ReportStatus.completed:
return "完成";
}
}
/// 根据数字获取枚举
static ReportStatus fromValue(int value) {
switch (value) {
case 0:
return ReportStatus.experienceing;
case 1:
return ReportStatus.generating;
case 2:
return ReportStatus.appNormalClose;
case 3:
return ReportStatus.appAbnormalClose;
case 4:
return ReportStatus.appActiveClose;
case 5:
return ReportStatus.reportExceptionClose;
case 9:
return ReportStatus.completed;
default:
throw Exception("未知报告状态: $value");
}
}
}

View File

@@ -0,0 +1,17 @@
class MqttHandler {
// 报警处理 单独线程 todo
void message(String topic, String msg) {
// print("topic: $topic, msg:$msg");
try {
// statisticsService.saveDeviceStatus(msg);
// alarmRuleService.judgeInstantAlarm(msg);
} catch (e) {
// print(e);
}
//遍历路径获取匹配的topic 进行websocket数据转发
// _topicPathHandler.forwardMessageByTopic(topic, msg);
}
}

82
bin/main.dart Normal file
View File

@@ -0,0 +1,82 @@
import 'dart:convert';
import 'dart:io';
import 'package:EasyDartModule/EasyDartModule.dart';
import 'package:EasyDartModule/base/logger/Logger.dart';
import 'package:EasyDartModule/base/redis/redis.dart';
import 'package:EasyDartModule/base/websocket/WebSocket.dart';
import './controller/AreaController.dart';
import 'const/ServiceConstant.dart';
import './const/CommonVariables.dart';
void main(List<String> args) async {
initEasyDartModule();
}
Future<void> initEasyDartModule() async {
try {
String? web = Platform.environment["web_port"] ?? "9200";
List<String> redis =
(Platform.environment["redis"] ?? "127.0.0.1:6379").split(":");
if (redis.length == 1) {
redis.add("6379");
}
EasyDartModule.init(
loggerConfig: LoggerConfig(
host: ServiceConstant.logService, serviceName: "快检报告服务"),
redisConfig: RedisConfig(host: redis[0], port: int.parse(redis[1])),
webSocketConfig:
WebSocketConfig(ServiceConstant.webSocketService, (data) {
// 接收到服务消息
var json = jsonDecode(data);
// ef.log("[websokcet]:${json}");
EasyDartModule.logger.info("[websokcet数据]:${json}");
if (json['wsId'] != null) {
// ef.kvRoot.websocketId = json['wsId'];
}
if (json['code'] != null && json['code'] != 200) {
EasyDartModule.logger
.error("[websokcet数据]:websocket连接失败--》" + json['msg']);
}
if (json["path"] != null) {
var call = CommonVariables.callMap[json["path"]];
if (call != null) {
try {
if (json['path'] != "/smartbed/connect") {
call(json["data"]);
} else {
call(json);
}
} catch (e) {
print(e);
}
} else {
print("未找到当前路径: ${json["path"]} 回调函数");
EasyDartModule.logger.error("未找到当前路径: ${json["path"]} 回调函数");
}
}
// print(data);
}, onOpen: () {
// 连接建立完毕
// EasyDartModule.websocket
// .sendData(jsonEncode({"path": "/aa/bb", "type": 1}));
print("object");
}));
while (!EasyDartModule.redis.isConnected()) {
await Future.delayed(Duration(seconds: 1));
}
// EasyDartModule.webServer.addHandler(StatisticsController());
EasyDartModule.webServer.addHandler(AreaController());
EasyDartModule.webServer.start(
int.parse(web),
);
} catch (e) {
print(e);
EasyDartModule.logger.error("websocket连接失败--》:$e");
}
}

View File

@@ -0,0 +1,66 @@
import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';
import 'package:fixnum/fixnum.dart'; // 用于处理 Int64 类型
part 'ApiResponse.g.dart';
@JsonSerializable(genericArgumentFactories: true)
class ApiResponse<T> {
int? code;
int? total;
T? data;
String? message;
ApiResponse();
// JSON 反序列化
factory ApiResponse.fromJson(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
_$ApiResponseFromJson(json, fromJsonT);
// JSON 序列化
Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
_$ApiResponseToJson(this, toJsonT);
// 添加自定义的 toJson 序列化方法,确保能正确序列化泛型数据
String serialize() {
// 手动处理 data 中的 Int64 转换为 int
var serializedData = _serializeData(data);
return jsonEncode({
'code': code,
'total': total,
'data': serializedData,
'message': message,
});
}
// 递归处理 data 中的每个项,转换 Int64 为 int
dynamic _serializeData(dynamic data) {
if (data is List) {
// 处理 List 中的 Int64 类型
return data.map((e) => _serializeData(e)).toList();
} else if (data is Map) {
// 处理 Map 中的 Int64 类型
var map = Map<String, dynamic>.from(data);
map.forEach((key, value) {
if (value is Int64) {
map[key] = value.toInt();
} else {
map[key] = _serializeData(value);
}
});
return map;
} else if (data is Int64) {
// 如果是 Int64 类型,转换为 int
return data.toInt();
}
return data;
}
@override
String toString() {
return serialize();
}
}

View File

@@ -0,0 +1,40 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'ApiResponse.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ApiResponse<T> _$ApiResponseFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
ApiResponse<T>()
..code = (json['code'] as num?)?.toInt()
..total = (json['total'] as num?)?.toInt()
..data = _$nullableGenericFromJson(json['data'], fromJsonT)
..message = json['message'] as String?;
Map<String, dynamic> _$ApiResponseToJson<T>(
ApiResponse<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'code': instance.code,
'total': instance.total,
'data': _$nullableGenericToJson(instance.data, toJsonT),
'message': instance.message,
};
T? _$nullableGenericFromJson<T>(
Object? input,
T Function(Object? json) fromJson,
) =>
input == null ? null : fromJson(input);
Object? _$nullableGenericToJson<T>(
T? input,
Object? Function(T value) toJson,
) =>
input == null ? null : toJson(input);

37
bin/model/Area.dart Normal file
View File

@@ -0,0 +1,37 @@
import 'package:json_annotation/json_annotation.dart';
part 'Area.g.dart';
@JsonSerializable()
class Area {
@JsonKey(name: '_id')
String? id; // 区域id
String? area_name; // 区域名称
String? area_desc; // 区域描述
int? created_at; // 创建时间(毫秒)
int? updated_at; // 更新时间(毫秒)
String? created_by_id; // 创建人ID
String? created_by_name; // 创建人名称
String? updated_by_id; // 更新人ID
String? updated_by_name; // 更新人名称
String? oid; // 机构ID
int? deleted; // 是否删除
String? points; // 坐标点集合
String? tid; // 所属机构
int? level; // 权限等级
Area();
static Area fromJson(Map<String, dynamic> json) => _$AreaFromJson(json);
Map<String, dynamic> toJson() => _$AreaToJson(this);
// 使用查询参数填充 Area 对象
static Area fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
var json = <String, dynamic>{};
queryParameters.forEach((key, value) {
json[key] = value;
});
json['tid'] = jwt['tid'];
json['level'] = jwt['level'];
return Area.fromJson(json);
}
}

40
bin/model/Area.g.dart Normal file
View File

@@ -0,0 +1,40 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'Area.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Area _$AreaFromJson(Map<String, dynamic> json) => Area()
..id = json['_id'] as String?
..area_name = json['area_name'] as String?
..area_desc = json['area_desc'] as String?
..created_at = (json['created_at'] as num?)?.toInt()
..updated_at = (json['updated_at'] as num?)?.toInt()
..created_by_id = json['created_by_id'] as String?
..created_by_name = json['created_by_name'] as String?
..updated_by_id = json['updated_by_id'] as String?
..updated_by_name = json['updated_by_name'] as String?
..oid = json['oid'] as String?
..deleted = (json['deleted'] as num?)?.toInt()
..points = json['points'] as String?
..tid = json['tid'] as String?
..level = (json['level'] as num?)?.toInt();
Map<String, dynamic> _$AreaToJson(Area instance) => <String, dynamic>{
'_id': instance.id,
'area_name': instance.area_name,
'area_desc': instance.area_desc,
'created_at': instance.created_at,
'updated_at': instance.updated_at,
'created_by_id': instance.created_by_id,
'created_by_name': instance.created_by_name,
'updated_by_id': instance.updated_by_id,
'updated_by_name': instance.updated_by_name,
'oid': instance.oid,
'deleted': instance.deleted,
'points': instance.points,
'tid': instance.tid,
'level': instance.level,
};

View File

@@ -0,0 +1,18 @@
import 'package:json_annotation/json_annotation.dart';
part 'WebSocketMessage.g.dart';
@JsonSerializable()
class WebSocketMessage {
String path;
int? type;
dynamic data;
String? to;
String? mac;
WebSocketMessage({required this.path, this.type, this.data, this.to,this.mac});
static WebSocketMessage fromJson(Map<String, dynamic> json) =>
_$WebSocketMessageFromJson(json);
Map<String, dynamic> toJson() => _$WebSocketMessageToJson(this);
}

View File

@@ -0,0 +1,25 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'WebSocketMessage.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
WebSocketMessage _$WebSocketMessageFromJson(Map<String, dynamic> json) =>
WebSocketMessage(
path: json['path'] as String,
type: (json['type'] as num?)?.toInt(),
data: json['data'],
to: json['to'] as String?,
mac: json['mac'] as String?,
);
Map<String, dynamic> _$WebSocketMessageToJson(WebSocketMessage instance) =>
<String, dynamic>{
'path': instance.path,
'type': instance.type,
'data': instance.data,
'to': instance.to,
'mac': instance.mac,
};

View File

@@ -0,0 +1,29 @@
class ApiResponse<T> {
int? code;
T? data;
String? msg;
int? total;
dynamic rawResponse; // 原始 Dio 响应对象
ApiResponse({
required this.code,
this.data,
this.msg,
this.total,
this.rawResponse,
});
factory ApiResponse.fromJson(
Map<String, dynamic> json,
T Function(Object?) fromJsonT, {
dynamic rawResponse,
}) {
return ApiResponse<T>(
code: json['code'] as int?,
data: json['data'] != null ? fromJsonT(json['data']) : null,
msg: json['msg'] as String?,
total: json['total'] as int?,
rawResponse: rawResponse, // 保留 Dio 原始响应对象
);
}
}

View File

@@ -0,0 +1,19 @@
// lib/http_status_codes.dart
class HttpStatusCodes {
// Success codes
static const int ok = 200;
static const int created = 201;
static const int accepted = 202;
// Client error codes
static const int badRequest = 400;
static const int unauthorized = 401;//401 参数错误
static const int forbidden = 403;//403 禁止,多条数据,不允许修改
static const int notFound = 404;//404 没有报告
// Server error codes
static const int internalServerError = 500;//500 内部异常
static const int notImplemented = 501;
static const int serviceUnavailable = 503;
}

File diff suppressed because it is too large Load Diff

1717
bin/service/AreaService.dart Normal file

File diff suppressed because it is too large Load Diff

95
bin/util/MyUtils.dart Normal file
View File

@@ -0,0 +1,95 @@
import '../model/api_response.dart';
import '../model/app_uri_status.dart';
class MyUtils {
static ApiResponse formatResponse(
ApiResponse res,
String successMsg,
String errorMsg,
) {
if (res.code == HttpStatusCodes.ok) {
// 成功但 msg 为空时填默认成功提示
if (res.msg == null || res.msg!.isEmpty) {
res.msg = successMsg;
}
} else {
// 失败且 msg 为空时填默认失败提示
if (res.msg == null || res.msg!.isEmpty) {
res.msg = errorMsg;
}
}
return res;
}
// 获取最近24小时的开始时间的毫秒数
static int getStartOfLast24HoursMilliseconds() {
DateTime now = DateTime.now();
DateTime startOfLast24Hours = now.subtract(Duration(hours: 24));
return startOfLast24Hours.millisecondsSinceEpoch;
}
// 获取当前时间的毫秒数作为最近24小时的结束时间
static int getEndOfLast24HoursMilliseconds() {
DateTime now = DateTime.now();
return now.millisecondsSinceEpoch;
}
static int getStartRangeFromNDaysAgoToNextDay(int n) {
DateTime now = DateTime.now();
DateTime start = DateTime(now.year, now.month, now.day - n - 1, 18, 0, 0);
DateTime end = start.add(Duration(hours: 24));
return start.millisecondsSinceEpoch;
}
static int getEndRangeFromNDaysAgoToNextDay(int n) {
DateTime now = DateTime.now();
DateTime start = DateTime(now.year, now.month, now.day - n - 1, 18, 0, 0);
DateTime end = start.add(Duration(hours: 24));
return end.millisecondsSinceEpoch;
}
// 获取当天前一天的下午18:00的时间戳
static int getYesterday18Milliseconds() {
DateTime now = DateTime.now();
DateTime yesterday18 = DateTime(now.year, now.month, now.day - 1, 18, 0, 0);
return yesterday18.millisecondsSinceEpoch;
}
// 获取当天17:00的时间戳
static int getToday17Milliseconds() {
DateTime now = DateTime.now();
DateTime today17 = DateTime(now.year, now.month, now.day, 17, 0, 0);
return today17.millisecondsSinceEpoch;
}
// 获取前一天的开始时间戳前一天的00:00:00
static int getStartOfYesterdayMilliseconds() {
DateTime now = DateTime.now();
DateTime startOfYesterday =
DateTime(now.year, now.month, now.day - 1, 0, 0, 0);
return startOfYesterday.millisecondsSinceEpoch;
}
// 获取前一天的结束时间戳前一天的23:59:59
static int getEndOfYesterdayMilliseconds() {
DateTime now = DateTime.now();
DateTime endOfYesterday =
DateTime(now.year, now.month, now.day - 1, 23, 59, 59);
return endOfYesterday.millisecondsSinceEpoch;
}
// 获取前一天的开始时间戳前一天的00:00:00
static int getStartOfCurrentMilliseconds() {
DateTime now = DateTime.now();
DateTime startOfYesterday = DateTime(now.year, now.month, now.day, 0, 0, 0);
return startOfYesterday.millisecondsSinceEpoch;
}
// 获取前一天的结束时间戳前一天的23:59:59
static int getEndOfCurrentMilliseconds() {
DateTime now = DateTime.now();
DateTime endOfYesterday =
DateTime(now.year, now.month, now.day, 23, 59, 59);
return endOfYesterday.millisecondsSinceEpoch;
}
}

View File

@@ -0,0 +1,102 @@
import 'dart:convert';
import 'package:EasyDartModule/EasyDartModule.dart';
import '../model/api_response.dart';
import '../model/app_uri_status.dart';
import '../util/MyUtils.dart';
Future<ApiResponse> requestWithLog({
required String logTitle,
required MyHttpMethod method,
required String queryUrl,
Map<String, dynamic>? data,
String successMsg = "操作成功",
String errorMsg = "操作失败",
void Function(ApiResponse res)? onSuccess,
void Function(ApiResponse res)? onFailure,
}) async {
EasyDartModule.logger.info(logTitle);
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败");
try {
String? language = "";
if (language != null && language.isNotEmpty) {
if (queryUrl.contains("?")) {
queryUrl += "&lang=$language";
} else {
queryUrl += "?lang=$language";
}
}
successMsg = successMsg;
errorMsg = errorMsg;
var response;
switch (method) {
case MyHttpMethod.get:
response = await EasyDartModule.dio.get(queryUrl);
break;
case MyHttpMethod.post:
response = data != null
? await EasyDartModule.dio.post(queryUrl, data: jsonEncode(data))
: await EasyDartModule.dio.post(queryUrl);
break;
case MyHttpMethod.put:
response = data != null
? await EasyDartModule.dio.put(queryUrl, data: jsonEncode(data))
: await EasyDartModule.dio.put(queryUrl);
break;
case MyHttpMethod.delete:
response = data != null
? await EasyDartModule.dio.delete(queryUrl, data: jsonEncode(data))
: await EasyDartModule.dio.delete(queryUrl);
break;
}
if (response != null) {
final responseData =
response.data is String ? jsonDecode(response.data) : response.data;
apiResponse = ApiResponse.fromJson(responseData, (object) => object,
rawResponse: response);
if (apiResponse.code == HttpStatusCodes.ok || apiResponse.code == 20000) {
MyUtils.formatResponse(apiResponse, successMsg, errorMsg);
onSuccess?.call(apiResponse);
} else {
print("[网络请求失败:$response]");
apiResponse.msg = responseData['msg'] ?? errorMsg;
onFailure?.call(apiResponse);
}
return apiResponse;
} else {
apiResponse = ApiResponse(code: -1, msg: "失败");
onFailure?.call(apiResponse);
return apiResponse;
}
} catch (e) {
print("[网络请求异常:$e]");
EasyDartModule.logger.error("$logTitle 失败->$e");
onFailure?.call(apiResponse);
return apiResponse;
}
}
enum MyHttpMethod { get, post, put, delete }
extension HttpMethodExtension on MyHttpMethod {
String get name {
switch (this) {
case MyHttpMethod.get:
return 'GET';
case MyHttpMethod.post:
return 'POST';
case MyHttpMethod.put:
return 'PUT';
case MyHttpMethod.delete:
return 'DELETE';
}
}
}

View File

@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}

795
pubspec.lock Normal file
View File

@@ -0,0 +1,795 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
EasyDartModule:
dependency: "direct main"
description:
path: "."
ref: master
resolved-ref: a34d58f93eb692c976d1be165920a03a54dea027
url: "https://git.he-info.cn/qmqz/easy_dart_module.git"
source: git
version: "1.0.0"
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.flutter-io.cn"
source: hosted
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
adaptive_number:
dependency: transitive
description:
name: adaptive_number
sha256: "3a567544e9b5c9c803006f51140ad544aedc79604fd4f3f2c1380003f97c1d77"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.11.0"
args:
dependency: transitive
description:
name: args
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.7.0"
async:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.13.0"
basic_utils:
dependency: transitive
description:
name: basic_utils
sha256: "2064b21d3c41ed7654bc82cc476fd65542e04d60059b74d5eed490a4da08fc6c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.7.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
bson:
dependency: transitive
description:
name: bson
sha256: f8c80be7a62a88f4add7c48cc83567c36a77532de107224df8328ef71f125045
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.7"
buffer:
dependency: transitive
description:
name: buffer
sha256: "389da2ec2c16283c8787e0adaede82b1842102f8c8aae2f49003a766c5c6b3d1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.3"
build:
dependency: transitive
description:
name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
charcode:
dependency: transitive
description:
name: charcode
sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.0"
cli_config:
dependency: transitive
description:
name: cli_config
sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.0"
clock:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.19.1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.2"
coverage:
dependency: transitive
description:
name: coverage
sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
crypto:
dependency: transitive
description:
name: crypto
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.7"
csslib:
dependency: transitive
description:
name: csslib
sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
dart_jsonwebtoken:
dependency: transitive
description:
name: dart_jsonwebtoken
sha256: "00a0812d2aeaeb0d30bcbc4dd3cee57971dbc0ab2216adf4f0247f37793f15ef"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.17.0"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.7"
decimal:
dependency: transitive
description:
name: decimal
sha256: fc706a5618b81e5b367b01dd62621def37abc096f2b46a9bd9068b64c1fa36d0
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.4"
dio:
dependency: transitive
description:
name: dio
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.9.0"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
ed25519_edwards:
dependency: transitive
description:
name: ed25519_edwards
sha256: "6ce0112d131327ec6d42beede1e5dfd526069b18ad45dcf654f15074ad9276cd"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.1"
event_bus:
dependency: transitive
description:
name: event_bus
sha256: "1a55e97923769c286d295240048fc180e7b0768902c3c2e869fe059aafa15304"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
google_identity_services_web:
dependency: transitive
description:
name: google_identity_services_web
sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.3+1"
googleapis_auth:
dependency: transitive
description:
name: googleapis_auth
sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.0"
grpc:
dependency: transitive
description:
name: grpc
sha256: "2dde469ddd8bbd7a33a0765da417abe1ad2142813efce3a86c512041294e2b26"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.0"
html:
dependency: transitive
description:
name: html
sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.15.6"
http:
dependency: transitive
description:
name: http
sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.0"
http2:
dependency: transitive
description:
name: http2
sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.1"
http_methods:
dependency: transitive
description:
name: http_methods
sha256: "6bccce8f1ec7b5d701e7921dca35e202d425b57e317ba1a37f2638590e29e566"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.2"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.2"
intl:
dependency: transitive
description:
name: intl
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.20.2"
io:
dependency: transitive
description:
name: io
sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.9.0"
lints:
dependency: "direct dev"
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.17"
meta:
dependency: transitive
description:
name: meta
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.18.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
minio:
dependency: transitive
description:
name: minio
sha256: ee2ce47766e46c7d164f960f2f5ed6a9a82844d877f6b82574f6876ec50c56d1
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.8"
mongo_dart:
dependency: transitive
description:
name: mongo_dart
sha256: "43b62b43c6449a0159bf138fba27653cb35acd92d3587ad26d1ec068cd645559"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.10.5"
mongo_dart_query:
dependency: transitive
description:
name: mongo_dart_query
sha256: "7a0f3981c3d1df467040e5654696cb0bfde6ec6db86ba313118fb3e873cee657"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.2"
mqtt5_client:
dependency: transitive
description:
name: mqtt5_client
sha256: "9e15d1cd888035bcd5b204325c6678b32858ea3fc94bc1e41d5aa99d3a43f49f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.11.0"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
name: package_config
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
packages_extensions:
dependency: transitive
description:
name: packages_extensions
sha256: "1fb328695a9828c80d275ce1650a2bb5947690070de082dfa1dfac7429378daf"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.1"
path:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.1"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.0"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.9.1"
pool:
dependency: transitive
description:
name: pool
sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.2"
power_extensions:
dependency: transitive
description:
name: power_extensions
sha256: ad0e8b2420090d996fe8b7fd32cdf02b9b924b6d4fc0fb0b559ff6aa5e24d5b0
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.3"
protobuf:
dependency: transitive
description:
name: protobuf
sha256: fbb0c37d435641d0b84813c1dad41e6fa61ddc880a320bce16b3063ecec35aa6
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
rational:
dependency: transitive
description:
name: rational
sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.3"
redis:
dependency: transitive
description:
name: redis
sha256: "4a8218ef7b0642ff499147c7a105591208259e2f55f07db0101ace7f82f66cf9"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
sasl_scram:
dependency: transitive
description:
name: sasl_scram
sha256: a47207a436eb650f8fdcf54a2e2587b850dc3caef9973ce01f332b07a6fc9cb9
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.1"
saslprep:
dependency: transitive
description:
name: saslprep
sha256: "3d421d10be9513bf4459c17c5e70e7b8bc718c9fc5ad4ba5eb4f5fd27396f740"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
shelf:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.2"
shelf_multipart:
dependency: transitive
description:
name: shelf_multipart
sha256: "6f195cd9a6a0e44887cf00ed9943551de3a3ce889118690bd461b9cebf20382f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.2"
shelf_router:
dependency: transitive
description:
name: shelf_router
sha256: f5e5d492440a7fb165fe1e2e1a623f31f734d3370900070b2b1e0d0428d59864
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.4"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.10.13"
source_span:
dependency: transitive
description:
name: source_span
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.2"
test:
dependency: "direct dev"
description:
name: test
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.26.3"
test_api:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.7"
test_core:
dependency: transitive
description:
name: test_core
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.12"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.0"
universal_html:
dependency: transitive
description:
name: universal_html
sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.4"
universal_io:
dependency: transitive
description:
name: universal_io
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.2"
unorm_dart:
dependency: transitive
description:
name: unorm_dart
sha256: "0c69186b03ca6addab0774bcc0f4f17b88d4ce78d9d4d8f0619e30a99ead58e7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.2"
uuid:
dependency: transitive
description:
name: uuid
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.5.2"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
url: "https://pub.flutter-io.cn"
source: hosted
version: "15.0.2"
vy_string_utils:
dependency: transitive
description:
name: vy_string_utils
sha256: "03f4f2ebba283b32623459fa9c47d5c70e085253c7891f5ef7d4fd539c41c078"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.6"
watcher:
dependency: transitive
description:
name: watcher
sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.3"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
xml:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.5.0"
yaml:
dependency: transitive
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.5.4 <4.0.0"

19
pubspec.yaml Normal file
View File

@@ -0,0 +1,19 @@
name: report_data_service
description: A sample command-line application.
version: 1.0.0
# repository: https://github.com/my_org/my_repo
environment:
sdk: ^3.5.4
# Add regular dependencies here.
dependencies:
# path: ^1.8.0
EasyDartModule:
git:
url: https://git.he-info.cn/qmqz/easy_dart_module.git
ref: master
dev_dependencies:
lints: ^4.0.0
test: ^1.24.0

View File

@@ -0,0 +1,8 @@
import 'package:report_data_service/report_data_service.dart';
import 'package:test/test.dart';
void main() {
test('calculate', () {
expect(calculate(), 42);
});
}