domru icon indicating copy to clipboard operation
domru copied to clipboard

Refactor handlers and introduce API wrapper

Open ad opened this issue 4 months ago • 0 comments

  • Updated Handler struct to include an API wrapper for better abstraction.
  • Added middleware for JSON error handling.
  • Refactored Operators and Places handlers to utilize the new API wrapper.
  • Simplified Snapshot and Stream handlers to use the API wrapper for upstream requests.
  • Removed deprecated token handling logic from handlers.
  • Introduced centralized models for accounts, confirmations, cameras, places, and finances.
  • Created a new upstream request handling mechanism for better error management.
  • Implemented token refresh logic with a dedicated auth package.
  • Added constants for API host and user agent.
  • Enhanced logging capabilities for upstream requests.

ad avatar Aug 21 '25 08:08 ad