已完成用户APP首期功能开发

交付用户端首期页面、配套接口、后台资源及测试文档。用户APP构建、静态分析和三个管理后台构建通过;完整测试仍有2项失败,后端模型注释检查未通过,详见交付记录。
This commit is contained in:
czl231
2026-09-13 00:57:32 +08:00
parent a0a4bb1218
commit 3ef33b531d
793 changed files with 40959 additions and 1204 deletions

View File

@@ -0,0 +1,39 @@
// 功能描述充值待确认请求的存储隔离和损坏保护版本1.0.0。
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:user_app/data/services/recharge_draft_store.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
const draft = PendingRecharge(
request: 'request-1',
amount: 29,
channel: 'alipay',
payType: 'wap',
);
test('重开存储恢复同一请求,环境和账号分别隔离', () async {
FlutterSecureStorage.setMockInitialValues({});
final store = SecureRechargeDraftStore();
await store.write('api-a#alice', draft);
expect((await SecureRechargeDraftStore().read('api-a#alice'))?.request, 'request-1');
expect((await store.read('api-a#alice'))?.amount, 29);
expect(await store.read('api-a#bob'), isNull);
expect(await store.read('api-b#alice'), isNull);
await store.delete('api-a#bob');
expect(await store.read('api-a#alice'), isNotNull);
await store.delete('api-a#alice');
expect(await store.read('api-a#alice'), isNull);
});
test('损坏请求不能静默当作未创建禁止Mock渠道和无效金额', () {
for (final patch in <Map<String, Object?>>[
{'schema': 2},
{'request': ''},
{'amount': 0},
{'amount': 1.5},
{'channel': 'mock'},
{'channel': 'wechat', 'pay_type': 'wap'},
]) {
expect(() => PendingRecharge.fromJson({...draft.toJson(), ...patch}), throwsFormatException);
}
});
}