123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- import 'liveConsultation.m.dart';
- import 'notification.m.dart';
- import 'device.m.dart';
- class CreateResidenceRequest extends TokenRequest{
- String? code;
- String? townCode;
- String? name;
- CreateResidenceRequest({
- this.code,
- this.townCode,
- this.name,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateResidenceRequest.fromJson(Map<String, dynamic> map) {
- return CreateResidenceRequest(
- code: map['Code'],
- townCode: map['TownCode'],
- name: map['Name'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (name != null)
- map['Name'] = name;
- return map;
- }
- }
- class ResidenceDTO extends BaseDTO{
- String? code;
- String? provinceCode;
- String? cityCode;
- String? districtCode;
- String? townName;
- String? townCode;
- String? name;
- ResidenceDTO({
- this.code,
- this.provinceCode,
- this.cityCode,
- this.districtCode,
- this.townName,
- this.townCode,
- this.name,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory ResidenceDTO.fromJson(Map<String, dynamic> map) {
- return ResidenceDTO(
- code: map['Code'],
- provinceCode: map['ProvinceCode'],
- cityCode: map['CityCode'],
- districtCode: map['DistrictCode'],
- townName: map['TownName'],
- townCode: map['TownCode'],
- name: map['Name'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (provinceCode != null)
- map['ProvinceCode'] = provinceCode;
- if (cityCode != null)
- map['CityCode'] = cityCode;
- if (districtCode != null)
- map['DistrictCode'] = districtCode;
- if (townName != null)
- map['TownName'] = townName;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (name != null)
- map['Name'] = name;
- return map;
- }
- }
- class GetResidenceRequest extends TokenRequest{
- String? code;
- GetResidenceRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory GetResidenceRequest.fromJson(Map<String, dynamic> map) {
- return GetResidenceRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetResidenceByKeyRequest extends TokenRequest{
- String? key;
- String? value;
- GetResidenceByKeyRequest({
- this.key,
- this.value,
- String? token,
- }) : super(
- token: token,
- );
- factory GetResidenceByKeyRequest.fromJson(Map<String, dynamic> map) {
- return GetResidenceByKeyRequest(
- key: map['Key'],
- value: map['Value'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (key != null)
- map['Key'] = key;
- if (value != null)
- map['Value'] = value;
- return map;
- }
- }
- class ResidencePageRequest extends PageRequest{
- ResidencePageRequest({
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory ResidencePageRequest.fromJson(Map<String, dynamic> map) {
- return ResidencePageRequest(
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class RemoveResidenceRequest extends TokenRequest{
- String? code;
- RemoveResidenceRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveResidenceRequest.fromJson(Map<String, dynamic> map) {
- return RemoveResidenceRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetResidenceListRequest extends TokenRequest{
- List<String>? codes;
- GetResidenceListRequest({
- this.codes,
- String? token,
- }) : super(
- token: token,
- );
- factory GetResidenceListRequest.fromJson(Map<String, dynamic> map) {
- return GetResidenceListRequest(
- codes: map['Codes']?.cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (codes != null)
- map['Codes'] = codes;
- return map;
- }
- }
- class UpdateResidenceRequest extends TokenRequest{
- String? code;
- String? townCode;
- String? name;
- UpdateResidenceRequest({
- this.code,
- this.townCode,
- this.name,
- String? token,
- }) : super(
- token: token,
- );
- factory UpdateResidenceRequest.fromJson(Map<String, dynamic> map) {
- return UpdateResidenceRequest(
- code: map['Code'],
- townCode: map['TownCode'],
- name: map['Name'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (name != null)
- map['Name'] = name;
- return map;
- }
- }
- class GetResidencePageByTownRequest extends PageRequest{
- String? townCode;
- GetResidencePageByTownRequest({
- this.townCode,
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory GetResidencePageByTownRequest.fromJson(Map<String, dynamic> map) {
- return GetResidencePageByTownRequest(
- townCode: map['TownCode'],
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (townCode != null)
- map['TownCode'] = townCode;
- return map;
- }
- }
|