123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- import 'package:fis_jsonrpc/utils.dart';
- class BaseDTO {
- DateTime? createTime;
- DateTime? updateTime;
- BaseDTO({
- this.createTime,
- this.updateTime,
- });
- factory BaseDTO.fromJson(Map<String, dynamic> map) {
- return BaseDTO(
- createTime:
- map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime:
- map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (createTime != null)
- map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
- if (updateTime != null)
- map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
- return map;
- }
- }
- class OrganizationBaseDTO extends BaseDTO {
- String? organizationCode;
- String? organizationName;
- OrganizationBaseDTO({
- this.organizationCode,
- this.organizationName,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrganizationBaseDTO.fromJson(Map<String, dynamic> map) {
- return OrganizationBaseDTO(
- organizationCode: map['OrganizationCode'],
- organizationName: map['OrganizationName'],
- 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 (organizationCode != null) map['OrganizationCode'] = organizationCode;
- if (organizationName != null) map['OrganizationName'] = organizationName;
- return map;
- }
- }
- class OrganizationBasicDTO extends OrganizationBaseDTO {
- String? regionCode;
- String? parentCode;
- String? logoUrl;
- OrganizationBasicDTO({
- this.regionCode,
- this.parentCode,
- this.logoUrl,
- String? organizationCode,
- String? organizationName,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- organizationCode: organizationCode,
- organizationName: organizationName,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrganizationBasicDTO.fromJson(Map<String, dynamic> map) {
- return OrganizationBasicDTO(
- regionCode: map['RegionCode'],
- parentCode: map['ParentCode'],
- logoUrl: map['LogoUrl'],
- organizationCode: map['OrganizationCode'],
- organizationName: map['OrganizationName'],
- 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 (regionCode != null) map['RegionCode'] = regionCode;
- if (parentCode != null) map['ParentCode'] = parentCode;
- if (logoUrl != null) map['LogoUrl'] = logoUrl;
- return map;
- }
- }
- enum OrganizationTypeEnum {
- Corporation,
- Department,
- Section,
- }
- class OrganizationDTO extends OrganizationBasicDTO {
- String? description;
- String? rootCode;
- OrganizationTypeEnum organizationType;
- List<String>? authorityGroups;
- String? nautica;
- OrganizationDTO({
- this.description,
- this.rootCode,
- this.organizationType = OrganizationTypeEnum.Corporation,
- this.authorityGroups,
- this.nautica,
- String? regionCode,
- String? parentCode,
- String? logoUrl,
- String? organizationCode,
- String? organizationName,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- regionCode: regionCode,
- parentCode: parentCode,
- logoUrl: logoUrl,
- organizationCode: organizationCode,
- organizationName: organizationName,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrganizationDTO.fromJson(Map<String, dynamic> map) {
- return OrganizationDTO(
- description: map['Description'],
- rootCode: map['RootCode'],
- organizationType: OrganizationTypeEnum.values
- .firstWhere((e) => e.index == map['OrganizationType']),
- authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
- nautica: map['Nautica'],
- regionCode: map['RegionCode'],
- parentCode: map['ParentCode'],
- logoUrl: map['LogoUrl'],
- organizationCode: map['OrganizationCode'],
- organizationName: map['OrganizationName'],
- 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 (description != null) map['Description'] = description;
- if (rootCode != null) map['RootCode'] = rootCode;
- map['OrganizationType'] = organizationType.index;
- if (authorityGroups != null) map['AuthorityGroups'] = authorityGroups;
- if (nautica != null) map['Nautica'] = nautica;
- return map;
- }
- }
- class SearchOrganizationsRequest {
- String? keyword;
- String? parentCode;
- OrganizationTypeEnum organizationType;
- SearchOrganizationsRequest({
- this.keyword,
- this.parentCode,
- this.organizationType = OrganizationTypeEnum.Corporation,
- });
- factory SearchOrganizationsRequest.fromJson(Map<String, dynamic> map) {
- return SearchOrganizationsRequest(
- keyword: map['Keyword'],
- parentCode: map['ParentCode'],
- organizationType: OrganizationTypeEnum.values
- .firstWhere((e) => e.index == map['OrganizationType']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (keyword != null) map['Keyword'] = keyword;
- if (parentCode != null) map['ParentCode'] = parentCode;
- map['OrganizationType'] = organizationType.index;
- return map;
- }
- }
- class GetOrganizationByCodeRequest {
- String? organizationCode;
- GetOrganizationByCodeRequest({
- this.organizationCode,
- });
- factory GetOrganizationByCodeRequest.fromJson(Map<String, dynamic> map) {
- return GetOrganizationByCodeRequest(
- organizationCode: map['OrganizationCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (organizationCode != null) map['OrganizationCode'] = organizationCode;
- return map;
- }
- }
- class BaseRequest {
- BaseRequest();
- factory BaseRequest.fromJson(Map<String, dynamic> map) {
- return BaseRequest();
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- return map;
- }
- }
- class TokenRequest extends BaseRequest {
- String? token;
- TokenRequest({
- this.token,
- }) : super();
- factory TokenRequest.fromJson(Map<String, dynamic> map) {
- return TokenRequest(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (token != null) map['Token'] = token;
- return map;
- }
- }
- class GetParentOrganizationListRequest extends TokenRequest {
- GetParentOrganizationListRequest({
- String? token,
- }) : super(
- token: token,
- );
- factory GetParentOrganizationListRequest.fromJson(Map<String, dynamic> map) {
- return GetParentOrganizationListRequest(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class GetPersonOrganizationRequest extends TokenRequest {
- GetPersonOrganizationRequest({
- String? token,
- }) : super(
- token: token,
- );
- factory GetPersonOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return GetPersonOrganizationRequest(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class SavePersonOrganizationRequest extends OrganizationBasicDTO {
- String? token;
- SavePersonOrganizationRequest({
- this.token,
- String? regionCode,
- String? parentCode,
- String? logoUrl,
- String? organizationCode,
- String? organizationName,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- regionCode: regionCode,
- parentCode: parentCode,
- logoUrl: logoUrl,
- organizationCode: organizationCode,
- organizationName: organizationName,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory SavePersonOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return SavePersonOrganizationRequest(
- token: map['Token'],
- regionCode: map['RegionCode'],
- parentCode: map['ParentCode'],
- logoUrl: map['LogoUrl'],
- organizationCode: map['OrganizationCode'],
- organizationName: map['OrganizationName'],
- 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 (token != null) map['Token'] = token;
- return map;
- }
- }
- class OrganizationItemDTO {
- String? organizationName;
- String? parentCode;
- String? extendsData;
- OrganizationItemDTO({
- this.organizationName,
- this.parentCode,
- this.extendsData,
- });
- factory OrganizationItemDTO.fromJson(Map<String, dynamic> map) {
- return OrganizationItemDTO(
- organizationName: map['OrganizationName'],
- parentCode: map['ParentCode'],
- extendsData: map['ExtendsData'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (organizationName != null) map['OrganizationName'] = organizationName;
- if (parentCode != null) map['ParentCode'] = parentCode;
- if (extendsData != null) map['ExtendsData'] = extendsData;
- return map;
- }
- }
- class AddOrganizationsRequest extends TokenRequest {
- List<OrganizationItemDTO>? organizationInfos;
- AddOrganizationsRequest({
- this.organizationInfos,
- String? token,
- }) : super(
- token: token,
- );
- factory AddOrganizationsRequest.fromJson(Map<String, dynamic> map) {
- return AddOrganizationsRequest(
- organizationInfos: map['OrganizationInfos']
- .map((e) => OrganizationItemDTO.fromJson(e as Map<String, dynamic>))
- .toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (organizationInfos != null) map['OrganizationInfos'] = organizationInfos;
- return map;
- }
- }
- class RemoveOrganizationsRequest extends TokenRequest {
- List<String>? organizationCodes;
- RemoveOrganizationsRequest({
- this.organizationCodes,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveOrganizationsRequest.fromJson(Map<String, dynamic> map) {
- return RemoveOrganizationsRequest(
- organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (organizationCodes != null) map['OrganizationCodes'] = organizationCodes;
- return map;
- }
- }
|