O2Enum.swift 4.9 KB

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