| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import 'package:chicken_farm/apis/index.dart';
- import 'package:chicken_farm/core/utils/logger.dart';
- class Test {
- Future<void> insetTestData() async {
- for (int i = 0; i < 2; i++) {
- apis.breeding.submitApi
- .bindChicken({
- 'rfids': ['test_1$i', 'test_2$i', 'test_3$i'],
- 'batchNum': '666',
- 'familyId': '888',
- 'date': '2025-12-11',
- })
- .then(
- (r) => {
- if (r.success)
- {logger.d('submitApi bindChicken: success')}
- else
- {logger.d('submitApi bindChicken: fail $i ${r.message}')},
- },
- );
- apis.breeding.submitApi
- .cageChange({
- 'rfids': ['test_1$i', 'test_2$i', 'test_3$i'],
- 'targetCage': '23333',
- 'date': '2025-12-11',
- })
- .then(
- (r) => {
- if (r.success)
- {logger.d('submitApi cageChange: success')}
- else
- {logger.d('submitApi cageChange: fail $i ${r.message}')},
- },
- );
- apis.breeding.submitApi
- .weight({'rfid': 'test_$i', 'weight': '1.23', 'date': '2025-12-11'})
- .then(
- (r) => {
- if (r.success)
- {logger.d('submitApi weight: success')}
- else
- {logger.d('submitApi weight: fail $i ${r.message}')},
- },
- );
- apis.breeding.submitApi
- .cull({
- 'rfid': 'test_$i',
- 'cullReason': '1',
- 'disposalMethod': '1',
- 'date': '2025-12-11',
- })
- .then(
- (r) => {
- if (r.success)
- {logger.d('submitApi cull: success')}
- else
- {logger.d('submitApi cull: fail $i ${r.message}')},
- },
- );
- apis.breeding.submitApi
- .batchCull({
- 'rfids': ['test_1$i', 'test_2$i', 'test_3$i'],
- 'cullReason': '1',
- 'disposalMethod': '1',
- 'date': '2025-12-11',
- })
- .then(
- (r) => {
- if (r.success)
- {logger.d('submitApi batchCull: success')}
- else
- {logger.d('submitApi batchCull: fail $i ${r.message}')},
- },
- );
- }
- }
- }
|