123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- import 'liveConsultation.m.dart';
- import 'notification.m.dart';
- import 'device.m.dart';
- class PeripheralDeviceDTO {
- String? code;
- String? key;
- String? name;
- bool enable;
- PeripheralDeviceDTO({
- this.code,
- this.key,
- this.name,
- this.enable = false,
- });
- factory PeripheralDeviceDTO.fromJson(Map<String, dynamic> map) {
- return PeripheralDeviceDTO(
- code: map['Code'],
- key: map['Key'],
- name: map['Name'],
- enable: map['Enable'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (code != null) {
- map['Code'] = code;
- }
- if (key != null) {
- map['Key'] = key;
- }
- if (name != null) {
- map['Name'] = name;
- }
- map['Enable'] = enable;
- return map;
- }
- }
- class CreateDeviceRequest2 extends TokenRequest{
- String? code;
- String? serialNumber;
- String? model;
- String? softwareVersion;
- String? oSVersion;
- String? description;
- String? organizationCode;
- String? teamCode;
- List<PeripheralDeviceDTO>? peripheralPermissions;
- CreateDeviceRequest2({
- this.code,
- this.serialNumber,
- this.model,
- this.softwareVersion,
- this.oSVersion,
- this.description,
- this.organizationCode,
- this.teamCode,
- this.peripheralPermissions,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateDeviceRequest2.fromJson(Map<String, dynamic> map) {
- return CreateDeviceRequest2(
- code: map['Code'],
- serialNumber: map['SerialNumber'],
- model: map['Model'],
- softwareVersion: map['SoftwareVersion'],
- oSVersion: map['OSVersion'],
- description: map['Description'],
- organizationCode: map['OrganizationCode'],
- teamCode: map['TeamCode'],
- peripheralPermissions: map['PeripheralPermissions'] != null ? (map['PeripheralPermissions'] as List).map((e)=>PeripheralDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if (model != null)
- map['Model'] = model;
- if (softwareVersion != null)
- map['SoftwareVersion'] = softwareVersion;
- if (oSVersion != null)
- map['OSVersion'] = oSVersion;
- if (description != null)
- map['Description'] = description;
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if (teamCode != null)
- map['TeamCode'] = teamCode;
- if (peripheralPermissions != null)
- map['PeripheralPermissions'] = peripheralPermissions;
- return map;
- }
- }
- class DeviceDTO extends BaseDTO{
- String? code;
- String? uniqueCode;
- String? serialNumber;
- String? model;
- String? softwareVersion;
- String? oSVersion;
- String? description;
- String? organizationCode;
- String? organizationName;
- String? teamCode;
- String? teamName;
- List<PeripheralDeviceDTO>? peripheralPermissions;
- DeviceDTO({
- this.code,
- this.uniqueCode,
- this.serialNumber,
- this.model,
- this.softwareVersion,
- this.oSVersion,
- this.description,
- this.organizationCode,
- this.organizationName,
- this.teamCode,
- this.teamName,
- this.peripheralPermissions,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory DeviceDTO.fromJson(Map<String, dynamic> map) {
- return DeviceDTO(
- code: map['Code'],
- uniqueCode: map['UniqueCode'],
- serialNumber: map['SerialNumber'],
- model: map['Model'],
- softwareVersion: map['SoftwareVersion'],
- oSVersion: map['OSVersion'],
- description: map['Description'],
- organizationCode: map['OrganizationCode'],
- organizationName: map['OrganizationName'],
- teamCode: map['TeamCode'],
- teamName: map['TeamName'],
- peripheralPermissions: map['PeripheralPermissions'] != null ? (map['PeripheralPermissions'] as List).map((e)=>PeripheralDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- 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 (uniqueCode != null)
- map['UniqueCode'] = uniqueCode;
- if (serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if (model != null)
- map['Model'] = model;
- if (softwareVersion != null)
- map['SoftwareVersion'] = softwareVersion;
- if (oSVersion != null)
- map['OSVersion'] = oSVersion;
- if (description != null)
- map['Description'] = description;
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if (organizationName != null)
- map['OrganizationName'] = organizationName;
- if (teamCode != null)
- map['TeamCode'] = teamCode;
- if (teamName != null)
- map['TeamName'] = teamName;
- if (peripheralPermissions != null)
- map['PeripheralPermissions'] = peripheralPermissions;
- return map;
- }
- }
- class GetDeviceRequest2 extends TokenRequest{
- String? code;
- GetDeviceRequest2({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory GetDeviceRequest2.fromJson(Map<String, dynamic> map) {
- return GetDeviceRequest2(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetDeviceByUniqueCodeRequest extends TokenRequest{
- String? uniqueCode;
- GetDeviceByUniqueCodeRequest({
- this.uniqueCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetDeviceByUniqueCodeRequest.fromJson(Map<String, dynamic> map) {
- return GetDeviceByUniqueCodeRequest(
- uniqueCode: map['UniqueCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (uniqueCode != null)
- map['UniqueCode'] = uniqueCode;
- return map;
- }
- }
- class GetDeviceBySerialNumberRequest extends TokenRequest{
- String? uniqueCode;
- GetDeviceBySerialNumberRequest({
- this.uniqueCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetDeviceBySerialNumberRequest.fromJson(Map<String, dynamic> map) {
- return GetDeviceBySerialNumberRequest(
- uniqueCode: map['UniqueCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (uniqueCode != null)
- map['UniqueCode'] = uniqueCode;
- return map;
- }
- }
- class SetDeviceOrganizationRequest extends TokenRequest{
- String? code;
- String? organizationCode;
- String? teamCode;
- SetDeviceOrganizationRequest({
- this.code,
- this.organizationCode,
- this.teamCode,
- String? token,
- }) : super(
- token: token,
- );
- factory SetDeviceOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return SetDeviceOrganizationRequest(
- code: map['Code'],
- organizationCode: map['OrganizationCode'],
- teamCode: map['TeamCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if (teamCode != null)
- map['TeamCode'] = teamCode;
- return map;
- }
- }
- class DevicePageRequest extends PageRequest{
- DevicePageRequest({
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory DevicePageRequest.fromJson(Map<String, dynamic> map) {
- return DevicePageRequest(
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class RemoveDeviceRequest extends TokenRequest{
- String? code;
- RemoveDeviceRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveDeviceRequest.fromJson(Map<String, dynamic> map) {
- return RemoveDeviceRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class UpdateDeviceRequest2 extends TokenRequest{
- String? code;
- String? model;
- String? softwareVersion;
- String? oSVersion;
- String? description;
- String? organizationCode;
- String? teamCode;
- UpdateDeviceRequest2({
- this.code,
- this.model,
- this.softwareVersion,
- this.oSVersion,
- this.description,
- this.organizationCode,
- this.teamCode,
- String? token,
- }) : super(
- token: token,
- );
- factory UpdateDeviceRequest2.fromJson(Map<String, dynamic> map) {
- return UpdateDeviceRequest2(
- code: map['Code'],
- model: map['Model'],
- softwareVersion: map['SoftwareVersion'],
- oSVersion: map['OSVersion'],
- description: map['Description'],
- organizationCode: map['OrganizationCode'],
- teamCode: map['TeamCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (model != null)
- map['Model'] = model;
- if (softwareVersion != null)
- map['SoftwareVersion'] = softwareVersion;
- if (oSVersion != null)
- map['OSVersion'] = oSVersion;
- if (description != null)
- map['Description'] = description;
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if (teamCode != null)
- map['TeamCode'] = teamCode;
- return map;
- }
- }
- class ReportingDeviceInfoRequest extends TokenRequest{
- String? serialNumber;
- String? model;
- String? softwareVersion;
- String? oSVersion;
- ReportingDeviceInfoRequest({
- this.serialNumber,
- this.model,
- this.softwareVersion,
- this.oSVersion,
- String? token,
- }) : super(
- token: token,
- );
- factory ReportingDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
- return ReportingDeviceInfoRequest(
- serialNumber: map['SerialNumber'],
- model: map['Model'],
- softwareVersion: map['SoftwareVersion'],
- oSVersion: map['OSVersion'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if (model != null)
- map['Model'] = model;
- if (softwareVersion != null)
- map['SoftwareVersion'] = softwareVersion;
- if (oSVersion != null)
- map['OSVersion'] = oSVersion;
- return map;
- }
- }
- class CreatePeripheralDeviceRequest extends TokenRequest{
- String? deviceCode;
- String? key;
- String? name;
- bool enable;
- CreatePeripheralDeviceRequest({
- this.deviceCode,
- this.key,
- this.name,
- this.enable = false,
- String? token,
- }) : super(
- token: token,
- );
- factory CreatePeripheralDeviceRequest.fromJson(Map<String, dynamic> map) {
- return CreatePeripheralDeviceRequest(
- deviceCode: map['DeviceCode'],
- key: map['Key'],
- name: map['Name'],
- enable: map['Enable'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if (key != null)
- map['Key'] = key;
- if (name != null)
- map['Name'] = name;
- map['Enable'] = enable;
- return map;
- }
- }
- class RemovePeripheralDeviceRequest extends TokenRequest{
- String? deviceCode;
- String? peripheralDeviceCode;
- RemovePeripheralDeviceRequest({
- this.deviceCode,
- this.peripheralDeviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory RemovePeripheralDeviceRequest.fromJson(Map<String, dynamic> map) {
- return RemovePeripheralDeviceRequest(
- deviceCode: map['DeviceCode'],
- peripheralDeviceCode: map['PeripheralDeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if (peripheralDeviceCode != null)
- map['PeripheralDeviceCode'] = peripheralDeviceCode;
- return map;
- }
- }
- class GetEnablePeripheralDeviceKeysRequest extends TokenRequest{
- String? deviceCode;
- GetEnablePeripheralDeviceKeysRequest({
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetEnablePeripheralDeviceKeysRequest.fromJson(Map<String, dynamic> map) {
- return GetEnablePeripheralDeviceKeysRequest(
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
|