LNReportManager.swift 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // LNReportManager.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/31.
  6. //
  7. import Foundation
  8. class LNReportManager {
  9. static let shared = LNReportManager()
  10. static let reportExtraMaxInput = 200
  11. static let helpCenterMaxInput = 200
  12. private init() { }
  13. func reportUser(uid: String, content: String, photos: [String],
  14. queue: DispatchQueue = .main,
  15. handler: @escaping (Bool) -> Void) {
  16. LNHttpManager.shared.reportUser(uid: uid, content: content, photos: photos) { err in
  17. queue.asyncIfNotGlobal {
  18. handler(err == nil)
  19. }
  20. if let err {
  21. showToast(err.errorDesc)
  22. }
  23. }
  24. }
  25. func feedback(content: String, photos: [String],
  26. queue: DispatchQueue = .main,
  27. handler: @escaping (Bool) -> Void) {
  28. LNHttpManager.shared.feedback(content: content, photos: photos) { err in
  29. queue.asyncIfNotGlobal {
  30. handler(err == nil)
  31. }
  32. if let err {
  33. showToast(err.errorDesc)
  34. }
  35. }
  36. }
  37. }