LoginMsg.swift 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // RootClass.swift
  3. // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. class LoginMsg:BaseOBJ{
  6. var allowPush : Int!
  7. var clientType : Int!
  8. var deviceToken : String!
  9. var uuid : String!
  10. var loginName : String!
  11. var password : String!
  12. var serverID : String!
  13. //
  14. //
  15. // NSString* serverID = Server_ID;
  16. // if (serverID) {
  17. // [_requestBody setObject:serverID forKey:@"serverId"];
  18. // }
  19. // NSString* deviceToken = [userDefaults objectForKey:USERDEFAULT_APP_TOKEN];
  20. // if (!!deviceToken) {
  21. // [_requestBody setObject:deviceToken forKey:@"deviceToken"];
  22. // }else{
  23. //获取唯一标识 appToken
  24. // NSString *uuid = [[NSUUID UUID] UUIDString];
  25. // [userDefaults setObject:uuid forKey:USERDEFAULT_APP_TOKEN];
  26. // [_requestBody setObject:uuid forKey:@"deviceToken"];
  27. /**
  28. * Instantiate the instance using the passed dictionary values to set the properties values
  29. */
  30. init(fromStringarr strarr: [String]){
  31. allowPush = 1
  32. clientType = 1
  33. deviceToken = NSUUID().UUIDString as String
  34. loginName = strarr[0]
  35. password = strarr[1]
  36. serverID = strarr[2]
  37. }
  38. /**
  39. * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
  40. */
  41. func toDictionary() -> NSDictionary
  42. {
  43. var dictionary = NSMutableDictionary()
  44. if serverID != nil{
  45. dictionary["serverID"] = serverID as String
  46. }
  47. if loginName != nil{
  48. dictionary["loginName"] = loginName as String
  49. }
  50. if password != nil{
  51. dictionary["password"] = password as String
  52. }
  53. if clientType != nil{
  54. dictionary["clientType"] = clientType
  55. }
  56. if allowPush != nil{
  57. dictionary["allowPush"] = allowPush
  58. }
  59. if deviceToken != nil{
  60. dictionary["deviceToken"] = deviceToken as String
  61. }
  62. return dictionary
  63. }
  64. }