OOContactModel.swift 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. //
  2. // OOContactModel.swift
  3. // o2app
  4. //
  5. // Created by 刘振兴 on 2017/11/20.
  6. // Copyright © 2017年 zone. All rights reserved.
  7. //
  8. import Foundation
  9. import HandyJSON
  10. class OOControl : NSObject, NSCoding, DataModel{
  11. var allowDelete : Bool?
  12. var allowEdit : Bool?
  13. required override init() {
  14. }
  15. /**
  16. * NSCoding required initializer.
  17. * Fills the data from the passed decoder
  18. */
  19. @objc required init(coder aDecoder: NSCoder)
  20. {
  21. allowDelete = aDecoder.decodeObject(forKey: "allowDelete") as? Bool
  22. allowEdit = aDecoder.decodeObject(forKey: "allowEdit") as? Bool
  23. }
  24. /**
  25. * NSCoding required method.
  26. * Encodes mode properties into the decoder
  27. */
  28. @objc func encode(with aCoder: NSCoder)
  29. {
  30. if allowDelete != nil{
  31. aCoder.encode(allowDelete, forKey: "allowDelete")
  32. }
  33. if allowEdit != nil{
  34. aCoder.encode(allowEdit, forKey: "allowEdit")
  35. }
  36. }
  37. }
  38. // 面包屑导航对象
  39. struct ContactBreadcrumbBean {
  40. var key: String = ""
  41. var name: String = ""
  42. var level: Int = 0
  43. }
  44. // 选择器使用的对象
  45. //组织对象
  46. class O2UnitPickerItem: NSObject, DataModel {
  47. @objc open var id : String?
  48. @objc open var name : String?
  49. @objc open var unique : String?
  50. @objc open var distinguishedName : String?
  51. @objc open var typeList : [String]?
  52. @objc open var shortName : String?
  53. var level : Int?
  54. @objc open var levelName : String?
  55. override required init(){}
  56. func copyFromUnitModel(dept: OOUnitModel) {
  57. self.id = dept.id
  58. self.name = dept.name
  59. self.unique = dept.unique
  60. self.distinguishedName = dept.distinguishedName
  61. self.typeList = dept.typeList
  62. self.shortName = dept.shortName
  63. self.level = dept.level
  64. self.levelName = dept.levelName
  65. }
  66. }
  67. //身份对象
  68. class O2IdentityPickerItem: NSObject, DataModel {
  69. @objc open var id : String?
  70. @objc open var name : String?
  71. @objc open var unique : String?
  72. @objc open var distinguishedName : String?
  73. @objc open var person : String?
  74. @objc open var unit : String?
  75. @objc open var unitName : String?
  76. @objc open var personName : String?
  77. @objc open var personUnique : String?
  78. @objc open var personDn : String?
  79. var unitLevel : Int?
  80. @objc open var unitLevelName : String?
  81. override required init(){}
  82. func copyFromIdentityModel(identity: OOIdentityModel) {
  83. self.id = identity.id
  84. self.name = identity.name
  85. self.unique = identity.unique
  86. self.distinguishedName = identity.distinguishedName
  87. self.unit = identity.unit
  88. self.unitName = identity.unitName
  89. self.unitLevel = identity.unitLevel
  90. self.unitLevelName = identity.unitLevelName
  91. self.person = identity.person
  92. //person相关信息等获取用户信息后再填充
  93. }
  94. //更新用户相关的信息
  95. func updatePersonInfo(person: OOPersonModel) {
  96. self.person = person.id
  97. self.personUnique = person.unique
  98. self.personName = person.name
  99. self.personDn = person.distinguishedName
  100. }
  101. }
  102. //群组对象
  103. class O2GroupPickerItem: NSObject, DataModel {
  104. @objc open var id : String?
  105. @objc open var name : String?
  106. @objc open var unique : String?
  107. @objc open var distinguishedName : String?
  108. override required init(){}
  109. func copyFromGroupModel(group: OOGroupModel) {
  110. self.id = group.id
  111. self.name = group.name
  112. self.unique = group.unique
  113. self.distinguishedName = group.distinguishedName
  114. }
  115. }
  116. //人员对象
  117. class O2PersonPickerItem: NSObject, DataModel {
  118. @objc open var id : String?
  119. @objc open var name : String?
  120. @objc open var unique : String?
  121. @objc open var distinguishedName : String?
  122. @objc open var genderType : String?
  123. @objc open var employee : String?
  124. @objc open var mail : String?
  125. @objc open var weixin : String?
  126. @objc open var qq : String?
  127. @objc open var mobile : String?
  128. @objc open var officePhone : String?
  129. override required init(){}
  130. func copyFromPersonModel(person: OOPersonModel) {
  131. self.id = person.id
  132. self.distinguishedName = person.distinguishedName
  133. self.name = person.name
  134. self.unique = person.unique
  135. self.genderType = person.genderType
  136. self.employee = person.employee
  137. self.mail = person.mail
  138. self.weixin = person.weixin
  139. self.qq = person.qq
  140. self.mobile = person.mobile
  141. self.officePhone = person.officePhone
  142. }
  143. }
  144. // MARK: - Unit Model
  145. class OOUnitModel : NSObject, NSCoding, DataModel{
  146. @objc open var control : OOControl?
  147. @objc open var controllerList : [AnyObject]?
  148. @objc open var createTime : String?
  149. @objc open var desc : String?
  150. @objc open var descriptionField : String?
  151. @objc open var distinguishedName : String?
  152. @objc open var id : String?
  153. @objc open var inheritedControllerList : [AnyObject]?
  154. var level : Int?
  155. @objc open var levelName : String?
  156. @objc open var name : String?
  157. var orderNumber : Int?
  158. @objc open var pinyin : String?
  159. @objc open var pinyinInitial : String?
  160. @objc open var shortName : String?
  161. var subDirectIdentityCount : Int?
  162. var subDirectUnitCount : Int?
  163. @objc open var superior : String?
  164. @objc open var typeList : [String]?
  165. @objc open var unique : String?
  166. @objc open var updateTime : String?
  167. @objc open var woSubDirectIdentityList:[OOIdentityModel]?
  168. override required init(){}
  169. func mapping(mapper: HelpingMapper) {
  170. mapper <<< self.desc <-- "description"
  171. }
  172. /**
  173. * NSCoding required initializer.
  174. * Fills the data from the passed decoder
  175. */
  176. @objc required init(coder aDecoder: NSCoder)
  177. {
  178. control = aDecoder.decodeObject(forKey: "control") as? OOControl
  179. controllerList = aDecoder.decodeObject(forKey: "controllerList") as? [AnyObject]
  180. createTime = aDecoder.decodeObject(forKey: "createTime") as? String
  181. descriptionField = aDecoder.decodeObject(forKey: "description") as? String
  182. distinguishedName = aDecoder.decodeObject(forKey: "distinguishedName") as? String
  183. id = aDecoder.decodeObject(forKey: "id") as? String
  184. inheritedControllerList = aDecoder.decodeObject(forKey: "inheritedControllerList") as? [AnyObject]
  185. level = aDecoder.decodeObject(forKey: "level") as? Int
  186. levelName = aDecoder.decodeObject(forKey: "levelName") as? String
  187. name = aDecoder.decodeObject(forKey: "name") as? String
  188. orderNumber = aDecoder.decodeObject(forKey: "orderNumber") as? Int
  189. pinyin = aDecoder.decodeObject(forKey: "pinyin") as? String
  190. pinyinInitial = aDecoder.decodeObject(forKey: "pinyinInitial") as? String
  191. shortName = aDecoder.decodeObject(forKey: "shortName") as? String
  192. subDirectIdentityCount = aDecoder.decodeObject(forKey: "subDirectIdentityCount") as? Int
  193. subDirectUnitCount = aDecoder.decodeObject(forKey: "subDirectUnitCount") as? Int
  194. superior = aDecoder.decodeObject(forKey: "superior") as? String
  195. typeList = aDecoder.decodeObject(forKey: "typeList") as? [String]
  196. unique = aDecoder.decodeObject(forKey: "unique") as? String
  197. updateTime = aDecoder.decodeObject(forKey: "updateTime") as? String
  198. woSubDirectIdentityList = aDecoder.decodeObject(forKey: "woSubDirectIdentityList") as? [OOIdentityModel]
  199. }
  200. /**
  201. * NSCoding required method.
  202. * Encodes mode properties into the decoder
  203. */
  204. @objc func encode(with aCoder: NSCoder)
  205. {
  206. if control != nil{
  207. aCoder.encode(control, forKey: "control")
  208. }
  209. if controllerList != nil{
  210. aCoder.encode(controllerList, forKey: "controllerList")
  211. }
  212. if createTime != nil{
  213. aCoder.encode(createTime, forKey: "createTime")
  214. }
  215. if descriptionField != nil{
  216. aCoder.encode(descriptionField, forKey: "description")
  217. }
  218. if distinguishedName != nil{
  219. aCoder.encode(distinguishedName, forKey: "distinguishedName")
  220. }
  221. if id != nil{
  222. aCoder.encode(id, forKey: "id")
  223. }
  224. if inheritedControllerList != nil{
  225. aCoder.encode(inheritedControllerList, forKey: "inheritedControllerList")
  226. }
  227. if level != nil{
  228. aCoder.encode(level, forKey: "level")
  229. }
  230. if levelName != nil{
  231. aCoder.encode(levelName, forKey: "levelName")
  232. }
  233. if name != nil{
  234. aCoder.encode(name, forKey: "name")
  235. }
  236. if orderNumber != nil{
  237. aCoder.encode(orderNumber, forKey: "orderNumber")
  238. }
  239. if pinyin != nil{
  240. aCoder.encode(pinyin, forKey: "pinyin")
  241. }
  242. if pinyinInitial != nil{
  243. aCoder.encode(pinyinInitial, forKey: "pinyinInitial")
  244. }
  245. if shortName != nil{
  246. aCoder.encode(shortName, forKey: "shortName")
  247. }
  248. if subDirectIdentityCount != nil{
  249. aCoder.encode(subDirectIdentityCount, forKey: "subDirectIdentityCount")
  250. }
  251. if subDirectUnitCount != nil{
  252. aCoder.encode(subDirectUnitCount, forKey: "subDirectUnitCount")
  253. }
  254. if superior != nil{
  255. aCoder.encode(superior, forKey: "superior")
  256. }
  257. if typeList != nil{
  258. aCoder.encode(typeList, forKey: "typeList")
  259. }
  260. if unique != nil{
  261. aCoder.encode(unique, forKey: "unique")
  262. }
  263. if updateTime != nil{
  264. aCoder.encode(updateTime, forKey: "updateTime")
  265. }
  266. if woSubDirectIdentityList != nil{
  267. aCoder.encode(woSubDirectIdentityList, forKey: "woSubDirectIdentityList")
  268. }
  269. }
  270. }
  271. class OOPersonDNModel: NSObject, NSCoding, DataModel {
  272. public override required init() {
  273. }
  274. @objc var personList:[String]?
  275. func encode(with aCoder: NSCoder) {
  276. if personList != nil{
  277. aCoder.encode(personList, forKey: "personList")
  278. }
  279. }
  280. required init?(coder aDecoder: NSCoder) {
  281. personList = aDecoder.decodeObject(forKey: "personList") as? [String]
  282. }
  283. }
  284. // MARK: - OO Person Model
  285. class OOPersonModel : NSObject, NSCoding, DataModel{
  286. var age : Int?
  287. @objc var changePasswordTime : String?
  288. @objc var controllerList : [String]?
  289. @objc var createTime : String?
  290. @objc var descriptionField : String?
  291. @objc var distinguishedName : String?
  292. @objc var employee : String?
  293. @objc var genderType : String?
  294. @objc var id : String?
  295. @objc var mail : String?
  296. @objc var mobile : String?
  297. @objc var name : String?
  298. @objc var officePhone : String?
  299. var orderNumber : Int?
  300. @objc var pinyin : String?
  301. @objc var pinyinInitial : String?
  302. @objc var qq : String?
  303. @objc var signature : String?
  304. @objc var superior : String?
  305. @objc var unique : String?
  306. @objc var updateTime : String?
  307. @objc var weixin : String?
  308. @objc var woIdentityList:[OOIdentityModel]?
  309. @objc var woGroupList:[OOGroupModel]?
  310. @objc var desc : String?
  311. public override required init() {
  312. }
  313. func mapping(mapper: HelpingMapper) {
  314. mapper <<< self.desc <-- "description"
  315. }
  316. /**
  317. * NSCoding required initializer.
  318. * Fills the data from the passed decoder
  319. */
  320. @objc required init(coder aDecoder: NSCoder)
  321. {
  322. age = aDecoder.decodeObject(forKey: "age") as? Int
  323. changePasswordTime = aDecoder.decodeObject(forKey: "changePasswordTime") as? String
  324. controllerList = aDecoder.decodeObject(forKey: "controllerList") as? [String]
  325. createTime = aDecoder.decodeObject(forKey: "createTime") as? String
  326. descriptionField = aDecoder.decodeObject(forKey: "description") as? String
  327. distinguishedName = aDecoder.decodeObject(forKey: "distinguishedName") as? String
  328. employee = aDecoder.decodeObject(forKey: "employee") as? String
  329. genderType = aDecoder.decodeObject(forKey: "genderType") as? String
  330. id = aDecoder.decodeObject(forKey: "id") as? String
  331. mail = aDecoder.decodeObject(forKey: "mail") as? String
  332. mobile = aDecoder.decodeObject(forKey: "mobile") as? String
  333. name = aDecoder.decodeObject(forKey: "name") as? String
  334. officePhone = aDecoder.decodeObject(forKey: "officePhone") as? String
  335. orderNumber = aDecoder.decodeObject(forKey: "orderNumber") as? Int
  336. pinyin = aDecoder.decodeObject(forKey: "pinyin") as? String
  337. pinyinInitial = aDecoder.decodeObject(forKey: "pinyinInitial") as? String
  338. qq = aDecoder.decodeObject(forKey: "qq") as? String
  339. signature = aDecoder.decodeObject(forKey: "signature") as? String
  340. superior = aDecoder.decodeObject(forKey: "superior") as? String
  341. unique = aDecoder.decodeObject(forKey: "unique") as? String
  342. updateTime = aDecoder.decodeObject(forKey: "updateTime") as? String
  343. weixin = aDecoder.decodeObject(forKey: "weixin") as? String
  344. }
  345. /**
  346. * NSCoding required method.
  347. * Encodes mode properties into the decoder
  348. */
  349. @objc func encode(with aCoder: NSCoder)
  350. {
  351. if age != nil{
  352. aCoder.encode(age, forKey: "age")
  353. }
  354. if changePasswordTime != nil{
  355. aCoder.encode(changePasswordTime, forKey: "changePasswordTime")
  356. }
  357. if controllerList != nil{
  358. aCoder.encode(controllerList, forKey: "controllerList")
  359. }
  360. if createTime != nil{
  361. aCoder.encode(createTime, forKey: "createTime")
  362. }
  363. if descriptionField != nil{
  364. aCoder.encode(descriptionField, forKey: "description")
  365. }
  366. if distinguishedName != nil{
  367. aCoder.encode(distinguishedName, forKey: "distinguishedName")
  368. }
  369. if employee != nil{
  370. aCoder.encode(employee, forKey: "employee")
  371. }
  372. if genderType != nil{
  373. aCoder.encode(genderType, forKey: "genderType")
  374. }
  375. if id != nil{
  376. aCoder.encode(id, forKey: "id")
  377. }
  378. if mail != nil{
  379. aCoder.encode(mail, forKey: "mail")
  380. }
  381. if mobile != nil{
  382. aCoder.encode(mobile, forKey: "mobile")
  383. }
  384. if name != nil{
  385. aCoder.encode(name, forKey: "name")
  386. }
  387. if officePhone != nil{
  388. aCoder.encode(officePhone, forKey: "officePhone")
  389. }
  390. if orderNumber != nil{
  391. aCoder.encode(orderNumber, forKey: "orderNumber")
  392. }
  393. if pinyin != nil{
  394. aCoder.encode(pinyin, forKey: "pinyin")
  395. }
  396. if pinyinInitial != nil{
  397. aCoder.encode(pinyinInitial, forKey: "pinyinInitial")
  398. }
  399. if qq != nil{
  400. aCoder.encode(qq, forKey: "qq")
  401. }
  402. if signature != nil{
  403. aCoder.encode(signature, forKey: "signature")
  404. }
  405. if superior != nil{
  406. aCoder.encode(superior, forKey: "superior")
  407. }
  408. if unique != nil{
  409. aCoder.encode(unique, forKey: "unique")
  410. }
  411. if updateTime != nil{
  412. aCoder.encode(updateTime, forKey: "updateTime")
  413. }
  414. if weixin != nil{
  415. aCoder.encode(weixin, forKey: "weixin")
  416. }
  417. }
  418. }
  419. // MARK: - OO Identity Model
  420. class OOIdentityModel : NSObject, NSCoding, DataModel{
  421. @objc var createTime : String?
  422. @objc var descriptionField : String?
  423. @objc var distinguishedName : String?
  424. @objc var id : String?
  425. @objc var name : String?
  426. var orderNumber : Int?
  427. @objc var person : String?
  428. @objc var pinyin : String?
  429. @objc var pinyinInitial : String?
  430. @objc var unique : String?
  431. @objc var unit : String?
  432. var unitLevel : Int?
  433. @objc var unitLevelName : String?
  434. @objc var unitName : String?
  435. @objc var updateTime : String?
  436. @objc var woPerson : OOPersonModel?
  437. @objc var woUnit:OOUnitModel?
  438. @objc var desc : String?
  439. public override required init() {
  440. }
  441. override var description: String {
  442. return "\(self.name!)(\(self.unitName!))"
  443. }
  444. func mapping(mapper: HelpingMapper) {
  445. mapper <<< self.desc <-- "description"
  446. }
  447. /**
  448. * NSCoding required initializer.
  449. * Fills the data from the passed decoder
  450. */
  451. @objc required init(coder aDecoder: NSCoder)
  452. {
  453. createTime = aDecoder.decodeObject(forKey: "createTime") as? String
  454. descriptionField = aDecoder.decodeObject(forKey: "description") as? String
  455. distinguishedName = aDecoder.decodeObject(forKey: "distinguishedName") as? String
  456. id = aDecoder.decodeObject(forKey: "id") as? String
  457. name = aDecoder.decodeObject(forKey: "name") as? String
  458. orderNumber = aDecoder.decodeObject(forKey: "orderNumber") as? Int
  459. person = aDecoder.decodeObject(forKey: "person") as? String
  460. pinyin = aDecoder.decodeObject(forKey: "pinyin") as? String
  461. pinyinInitial = aDecoder.decodeObject(forKey: "pinyinInitial") as? String
  462. unique = aDecoder.decodeObject(forKey: "unique") as? String
  463. unit = aDecoder.decodeObject(forKey: "unit") as? String
  464. unitLevel = aDecoder.decodeObject(forKey: "unitLevel") as? Int
  465. unitLevelName = aDecoder.decodeObject(forKey: "unitLevelName") as? String
  466. unitName = aDecoder.decodeObject(forKey: "unitName") as? String
  467. updateTime = aDecoder.decodeObject(forKey: "updateTime") as? String
  468. woPerson = aDecoder.decodeObject(forKey: "woPerson") as? OOPersonModel
  469. woUnit = aDecoder.decodeObject(forKey: "woUnit") as? OOUnitModel
  470. }
  471. /**
  472. * NSCoding required method.
  473. * Encodes mode properties into the decoder
  474. */
  475. @objc func encode(with aCoder: NSCoder)
  476. {
  477. if createTime != nil{
  478. aCoder.encode(createTime, forKey: "createTime")
  479. }
  480. if descriptionField != nil{
  481. aCoder.encode(descriptionField, forKey: "description")
  482. }
  483. if distinguishedName != nil{
  484. aCoder.encode(distinguishedName, forKey: "distinguishedName")
  485. }
  486. if id != nil{
  487. aCoder.encode(id, forKey: "id")
  488. }
  489. if name != nil{
  490. aCoder.encode(name, forKey: "name")
  491. }
  492. if orderNumber != nil{
  493. aCoder.encode(orderNumber, forKey: "orderNumber")
  494. }
  495. if person != nil{
  496. aCoder.encode(person, forKey: "person")
  497. }
  498. if pinyin != nil{
  499. aCoder.encode(pinyin, forKey: "pinyin")
  500. }
  501. if pinyinInitial != nil{
  502. aCoder.encode(pinyinInitial, forKey: "pinyinInitial")
  503. }
  504. if unique != nil{
  505. aCoder.encode(unique, forKey: "unique")
  506. }
  507. if unit != nil{
  508. aCoder.encode(unit, forKey: "unit")
  509. }
  510. if unitLevel != nil{
  511. aCoder.encode(unitLevel, forKey: "unitLevel")
  512. }
  513. if unitLevelName != nil{
  514. aCoder.encode(unitLevelName, forKey: "unitLevelName")
  515. }
  516. if unitName != nil{
  517. aCoder.encode(unitName, forKey: "unitName")
  518. }
  519. if updateTime != nil{
  520. aCoder.encode(updateTime, forKey: "updateTime")
  521. }
  522. if woPerson != nil{
  523. aCoder.encode(woPerson, forKey: "woPerson")
  524. }
  525. if woUnit != nil{
  526. aCoder.encode(woUnit, forKey: "woUnit")
  527. }
  528. }
  529. }
  530. // MARK: - OO Group Model
  531. class OOGroupModel : NSObject, NSCoding, DataModel{
  532. @objc var control : OOControl?
  533. @objc var createTime : String?
  534. @objc var descriptionField : String?
  535. @objc var distinguishedName : String?
  536. @objc var groupList : [String]?
  537. @objc var id : String?
  538. @objc var name : String?
  539. @objc var personList : [String]?
  540. @objc var pinyin : String?
  541. @objc var pinyinInitial : String?
  542. @objc var unique : String?
  543. @objc var updateTime : String?
  544. @objc var woGroupList:[OOGroupModel]?
  545. @objc var woPersonList:[OOPersonModel]?
  546. @objc var desc : String?
  547. public override required init() {
  548. }
  549. func mapping(mapper: HelpingMapper) {
  550. mapper <<< self.desc <-- "description"
  551. }
  552. /**
  553. * NSCoding required initializer.
  554. * Fills the data from the passed decoder
  555. */
  556. @objc required init(coder aDecoder: NSCoder)
  557. {
  558. control = aDecoder.decodeObject(forKey: "control") as? OOControl
  559. createTime = aDecoder.decodeObject(forKey: "createTime") as? String
  560. descriptionField = aDecoder.decodeObject(forKey: "description") as? String
  561. distinguishedName = aDecoder.decodeObject(forKey: "distinguishedName") as? String
  562. groupList = aDecoder.decodeObject(forKey: "groupList") as? [String]
  563. id = aDecoder.decodeObject(forKey: "id") as? String
  564. name = aDecoder.decodeObject(forKey: "name") as? String
  565. personList = aDecoder.decodeObject(forKey: "personList") as? [String]
  566. pinyin = aDecoder.decodeObject(forKey: "pinyin") as? String
  567. pinyinInitial = aDecoder.decodeObject(forKey: "pinyinInitial") as? String
  568. unique = aDecoder.decodeObject(forKey: "unique") as? String
  569. updateTime = aDecoder.decodeObject(forKey: "updateTime") as? String
  570. }
  571. /**
  572. * NSCoding required method.
  573. * Encodes mode properties into the decoder
  574. */
  575. @objc func encode(with aCoder: NSCoder)
  576. {
  577. if control != nil{
  578. aCoder.encode(control, forKey: "control")
  579. }
  580. if createTime != nil{
  581. aCoder.encode(createTime, forKey: "createTime")
  582. }
  583. if descriptionField != nil{
  584. aCoder.encode(descriptionField, forKey: "description")
  585. }
  586. if distinguishedName != nil{
  587. aCoder.encode(distinguishedName, forKey: "distinguishedName")
  588. }
  589. if groupList != nil{
  590. aCoder.encode(groupList, forKey: "groupList")
  591. }
  592. if id != nil{
  593. aCoder.encode(id, forKey: "id")
  594. }
  595. if name != nil{
  596. aCoder.encode(name, forKey: "name")
  597. }
  598. if personList != nil{
  599. aCoder.encode(personList, forKey: "personList")
  600. }
  601. if pinyin != nil{
  602. aCoder.encode(pinyin, forKey: "pinyin")
  603. }
  604. if pinyinInitial != nil{
  605. aCoder.encode(pinyinInitial, forKey: "pinyinInitial")
  606. }
  607. if unique != nil{
  608. aCoder.encode(unique, forKey: "unique")
  609. }
  610. if updateTime != nil{
  611. aCoder.encode(updateTime, forKey: "updateTime")
  612. }
  613. }
  614. }