123456789101112131415161718192021222324252627282930313233343536 |
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:vitalapp/rpc.dart';
- import 'package:vitalapp/store/store.dart';
- import 'interfaces/label.dart';
- import 'package:fis_common/logger/logger.dart';
- class LabelManager implements ILabelManager {
- @override
- Future<List<LabelDTO>?> getLabelListByKey(String key) async {
- try {
- final result = await rpc.label.getLabelListByKeyAsync(
- GetLabelListByKeyRequest(key: key, token: Store.user.token),
- );
- return result;
- } catch (e) {
- logger.e("LabelManager get labels by key-$key error.", e);
- return null;
- }
- }
- @override
- Future<List<LabelDTO>> getNormalCrowdLabels() async {
- return (await getLabelListByKey("RQFL")) ?? [];
- }
- @override
- Future<List<LabelDTO>> getDiseaseCrowdLabels() async {
- return (await getLabelListByKey("CJJB")) ?? [];
- }
- @override
- Future<List<LabelDTO>> getSpecialCareCrowdLabels() async {
- return (await getLabelListByKey("TSZG")) ?? [];
- }
- }
|