对接家政服务接口

hmxc
张萌 3 years ago
parent 3ab174c275
commit dda81c802d

@ -0,0 +1,66 @@
import 'package:equatable/equatable.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'house_keeping_list_model.g.dart';
@JsonSerializable()
class HouseKeepingListModel extends Equatable {
final int id;
final String proposerName;
final String proposerTel;
final String roomName;
final int type;
final String content;
final int status;
final int? completion;
final String? processDescription;
final String? handlingTime;
final double? payFee;
final int? evaluation;
final String? evaluationContent;
final String? evaluationTime;
final String createDate;
final List<ImgModel> submitImgList;
HouseKeepingListModel({
required this.id,
required this.proposerName,
required this.proposerTel,
required this.roomName,
required this.type,
required this.content,
required this.status,
this.completion,
this.processDescription,
this.handlingTime,
this.payFee,
this.evaluation,
this.evaluationContent,
this.evaluationTime,
required this.createDate,
required this.submitImgList,
});
factory HouseKeepingListModel.fromJson(Map<String, dynamic> json) =>
_$HouseKeepingListModelFromJson(json);
@override
List<Object?> get props {
return [
id,
proposerName,
proposerTel,
roomName,
type,
content,
status,
completion,
processDescription,
handlingTime,
payFee,
evaluation,
evaluationContent,
evaluationTime,
createDate,
submitImgList,
];
}
}

@ -0,0 +1,31 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'house_keeping_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HouseKeepingListModel _$HouseKeepingListModelFromJson(
Map<String, dynamic> json) {
return HouseKeepingListModel(
id: json['id'] as int,
proposerName: json['proposerName'] as String,
proposerTel: json['proposerTel'] as String,
roomName: json['roomName'] as String,
type: json['type'] as int,
content: json['content'] as String,
status: json['status'] as int,
completion: json['completion'] as int?,
processDescription: json['processDescription'] as String?,
handlingTime: json['handlingTime'] as String?,
payFee: (json['payFee'] as num?)?.toDouble(),
evaluation: json['evaluation'] as int?,
evaluationContent: json['evaluationContent'] as String?,
evaluationTime: json['evaluationTime'] as String?,
createDate: json['createDate'] as String,
submitImgList: (json['submitImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

@ -0,0 +1,20 @@
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
class HouseKeepingFunc {
static Future submitHouseKeeping(
int estateId,
int type,
String content,
List<String> urls
) async {
BaseModel baseModel = await NetUtil().post(API.manager.submitHouseKeeping,
params: {"estateId": estateId, "type": type, "content": content,"submitImgUrls":urls});
if (baseModel.status ?? false) {
return true;
} else {
return false;
}
}
}
Loading…
Cancel
Save