O2Enum.swift 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. //
  2. // O2Enum.swift
  3. // O2OA_SDK_Framwork
  4. //
  5. // Created by FancyLou on 2018/11/14.
  6. //
  7. import Foundation
  8. /// O2OA 服务端 API 模块列表
  9. ///
  10. /// - x_processplatform_assemble_surface_script:
  11. /// - x_processplatform_assemble_surface_task:
  12. /// - x_processplatform_assemble_surface_worklog:
  13. /// - x_processplatform_assemble_surface_workcompleted:
  14. /// - x_processplatform_assemble_surface_attachment:
  15. /// - x_processplatform_assemble_surface_work:
  16. /// - x_file_assemble_control: //云文件
  17. /// - x_meeting_assemble_control: //会议管理
  18. /// - x_attendance_assemble_control: //考勤管理
  19. /// - x_okr_assemble_control: //OKR
  20. /// - x_bbs_assemble_control: //BBS
  21. /// - x_hotpic_assemble_control: //热图展现
  22. /// - x_processplatform_assemble_surface_applicationdict: //数据字典模块
  23. /// - x_cms_assemble_control:
  24. /// - x_organization_assemble_control: //新组织人员管理
  25. /// - x_collaboration_assemble_websocket:
  26. /// - x_organization_assemble_custom:
  27. /// - x_processplatform_assemble_surface:
  28. /// - x_processplatform_assemble_surface_read:
  29. /// - x_processplatform_assemble_surface_readcompleted:
  30. /// - x_organization_assemble_express:
  31. /// - x_organization_assemble_personal:
  32. /// - x_processplatform_assemble_surface_taskcompleted:
  33. /// - x_processplatform_assemble_surface_process:
  34. /// - x_component_assemble_control:
  35. /// - x_processplatform_assemble_surface_application:
  36. /// - x_processplatform_assemble_surface_data:
  37. /// - x_processplatform_assemble_designer:
  38. /// - x_processplatform_assemble_surface_review:
  39. /// - x_organization_assemble_authentication: //认证模块
  40. /// - x_portal_assemble_surface: //门户模块
  41. /// - x_calendar_assemble_control: //日程
  42. /// - x_jpush_assemble_control: //极光推送
  43. public enum O2ModuleContext {
  44. case x_processplatform_assemble_surface_script
  45. case x_processplatform_assemble_surface_task
  46. case x_processplatform_assemble_surface_worklog
  47. case x_processplatform_assemble_surface_workcompleted
  48. case x_processplatform_assemble_surface_attachment
  49. case x_processplatform_assemble_surface_work
  50. case x_file_assemble_control
  51. case x_meeting_assemble_control
  52. case x_attendance_assemble_control
  53. case x_okr_assemble_control
  54. case x_bbs_assemble_control
  55. case x_hotpic_assemble_control
  56. case x_processplatform_assemble_surface_applicationdict
  57. case x_cms_assemble_control
  58. case x_organization_assemble_control
  59. case x_collaboration_assemble_websocket
  60. case x_organization_assemble_custom
  61. case x_processplatform_assemble_surface
  62. case x_processplatform_assemble_surface_read
  63. case x_processplatform_assemble_surface_readcompleted
  64. case x_organization_assemble_express
  65. case x_organization_assemble_personal
  66. case x_processplatform_assemble_surface_taskcompleted
  67. case x_processplatform_assemble_surface_process
  68. case x_component_assemble_control
  69. case x_processplatform_assemble_surface_application
  70. case x_processplatform_assemble_surface_data
  71. case x_processplatform_assemble_designer
  72. case x_processplatform_assemble_surface_review
  73. case x_organization_assemble_authentication
  74. case x_portal_assemble_surface
  75. case x_calendar_assemble_control
  76. case x_jpush_assemble_control
  77. }
  78. /// 启动过程状态
  79. ///
  80. /// - success: 成功 进入到主页
  81. /// - loginError: 登录失败,需要去登录页面
  82. /// - bindError: 绑定验证失败,需要去绑定页面
  83. /// - unknownError: 未知错误,可能是服务器不通等 无法进入应用
  84. public enum O2LaunchProcessState {
  85. case success
  86. case loginError
  87. case bindError
  88. case unknownError
  89. }
  90. enum O2AuthError: Error {
  91. case blockError(String)
  92. case noBindError // 没有绑定信息
  93. case bindExpireError // 绑定已经过期
  94. case noLoginError // 没有登录
  95. }
  96. /// 绑定手机过程状态
  97. ///
  98. /// - success: 成功进入主页
  99. /// - goToLogin: 需要去登录页面
  100. /// - goToChooseBindServer: 有多个unit,需要去选择页面选择要绑定的unit
  101. /// - noUnitCanBindError: 没有可以绑定的服务器
  102. /// - unknownError: 未知错误
  103. public enum O2BindProcessState {
  104. case success
  105. case goToLogin
  106. case goToChooseBindServer([O2BindUnitModel])
  107. case noUnitCanBindError
  108. case unknownError
  109. }
  110. /// 绑定中断情况
  111. ///
  112. /// - tooManyUnitError: 有多个单位,需要去选择页面选择绑定的单位
  113. /// - noLoginError: 需要去登录页面 重新登录
  114. /// - noUnitCanBindError:当前手机号码没有可以绑定的服务器
  115. enum O2BindDiscontinue: Error {
  116. case tooManyUnit([O2BindUnitModel])
  117. case noLoginError(String)
  118. case noUnitCanBindError
  119. case unknownError(String)
  120. }