Merge branch 'master' of https://git.oa00.com/austin_dai/project_telephony
commit
71e40bb694
@ -0,0 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
part 'exclude_pn_model.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class ExcludePnModel extends Equatable{
|
||||
final String? phone;
|
||||
final String? remark;
|
||||
factory ExcludePnModel.fromJson(Map<String, dynamic> json) =>_$ExcludePnModelFromJson(json);
|
||||
|
||||
|
||||
const ExcludePnModel({
|
||||
required this.phone,
|
||||
required this.remark,
|
||||
});
|
||||
@override
|
||||
List<Object?> get props => [phone,remark];
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'exclude_pn_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ExcludePnModel _$ExcludePnModelFromJson(Map<String, dynamic> json) =>
|
||||
ExcludePnModel(
|
||||
phone: json['phone'] as String,
|
||||
remark: json['remark'] as String,
|
||||
);
|
@ -0,0 +1,33 @@
|
||||
import 'package:project_telephony/constants/api.dart';
|
||||
import 'package:project_telephony/model/network/api_client.dart';
|
||||
import 'package:project_telephony/model/network/base_model.dart';
|
||||
import 'package:project_telephony/utils/inner_model/base_list_model.dart';
|
||||
|
||||
import '../../../../model/exclude_phone_model.dart';
|
||||
import '../../../../model/exclude_pn_model.dart';
|
||||
import '../../../../utils/toast/cloud_toast.dart';
|
||||
|
||||
class ExcludeFunc {
|
||||
// 查看手机号码
|
||||
static Future<List<ExcludePhoneModel>> getContacts() async {
|
||||
BaseListModel res=await apiClient.requestList(API.exclude.find,);
|
||||
if(res.code==0){
|
||||
return res.nullSafetyList.map((e) => ExcludePhoneModel.fromJson(e)).toList();
|
||||
}else{
|
||||
CloudToast.show(res.msg);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
//添加手机号码
|
||||
static Future<bool> getContactsList(List numList) async{
|
||||
BaseModel res=await apiClient.request(API.exclude.add,data: {"exclude":numList});
|
||||
if(res.code==0){
|
||||
return true;
|
||||
}else{
|
||||
CloudToast.show(res.msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue