iOS-study
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

API.swift 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. //
  2. // API.swift
  3. // iOSFirst
  4. //
  5. // Created by 孙宇峰 on 2023/2/3.
  6. //
  7. import Foundation
  8. enum Api {
  9. /// baseUrl
  10. static let shoolurl = "https://schoolapitest.xhkjedu.com/"
  11. static let fileurl = "https://schoolstatictest.xhkjedu.com/static/"
  12. static let rzurl = "http://scapitest.xhkjedu.com/"
  13. static let wsExamUrl = "wss://wsexamtest.xhkjedu.com/ws"
  14. }
  15. extension Api {
  16. /// 用户登录注册登出 登录注册为post 登出为get
  17. enum Account {
  18. ///教师帐号登录
  19. static let loginTeacher = "suser/user/login_teacher"
  20. ///获取手机验证码
  21. static let loginCode = "suser/user/login_code"
  22. ///绑定手机获取手机验证码
  23. static let bindCode = "suser/user/bind_code"
  24. ///手机号码登录
  25. static let loginByCode = "suser/user/login_byCode"
  26. ///获取手机验证码 用于重置密码
  27. static let updateCode = "suser/user/update_code"
  28. /// 重置密码
  29. static let updatePwdCode = "suser/user/update_pwd_byCode"
  30. /// 绑定手机 2.2.3帐号安全--绑定手机
  31. static let bindUserPhone = "suser/user/bind_userphone"
  32. ///2.2.4帐号安全--验证身份
  33. static let checkUser = "suser/user/check_user"
  34. }
  35. }
  36. extension Api {
  37. /// 首页 queryKeyword是post请求 其他的是get请求
  38. enum Home {
  39. static let banner = "banner/json"
  40. static let topArticle = "article/top/json"
  41. static let normalArticle = "article/list/"
  42. static let hotKey = "hotkey/json"
  43. static let queryKeyword = "article/query/"
  44. }
  45. }
  46. extension Api {
  47. /// 项目 均是get请求
  48. enum Project {
  49. static let tags = "project/tree/json"
  50. static let tagList = "project/list/"
  51. }
  52. }
  53. extension Api {
  54. /// 公众号 均是get请求
  55. enum PublicNumber {
  56. static let tags = "wxarticle/chapters/json"
  57. static let tagList = "wxarticle/list/"
  58. }
  59. }
  60. extension Api {
  61. /// 体系 均是get请求
  62. enum Tree {
  63. static let tags = "tree/json"
  64. static let tagList = "article/list/"
  65. }
  66. }
  67. extension Api {
  68. /// 我的 取消收藏和点击收藏操作为post,其他为get
  69. enum My {
  70. static let coinRank = "coin/rank/"
  71. static let userCoinInfo = "lg/coin/userinfo/json"
  72. static let myCoinList = "lg/coin/list/"
  73. static let collectArticleList = "lg/collect/list/"
  74. static let collectArticle = "lg/collect/"
  75. static let unCollectArticle = "lg/uncollect_originId/"
  76. static let unreadCount = "message/lg/count_unread/json"
  77. static let unreadList = "message/lg/unread_list/"
  78. static let readList = "message/lg/readed_list/"
  79. }
  80. }
  81. extension Api {
  82. enum Other {
  83. static let tools = "tools/list/json"
  84. /// 问答和工具在数据结构与页面样式一模一样,所以就不再不停的重复写了
  85. static let questionAndAnswer = "wenda/list/"
  86. /// 常用网站
  87. static let friend = "friend/json"
  88. /// 导航
  89. static let navi = "navi/json"
  90. }
  91. }
  92. extension Api {
  93. enum Course {
  94. static let tags = "chapter/547/sublist/json"
  95. static let tagList = "article/list/"
  96. }
  97. }
  98. extension Api {
  99. enum Mock {
  100. static let mourn = "mourn/json"
  101. }
  102. }