Commit Graph

5 Commits

Author SHA1 Message Date
limitcool
b7628c770b Refactor user handler and middleware for improved error handling and logging
- Consolidated user ID retrieval and permission checks into helper functions.
- Updated UserHandler to utilize BaseHandler for common database and configuration access.
- Enhanced logging for user-related operations, including login, registration, and password changes.
- Removed redundant context handling in middleware and improved readability.
- Introduced FileUtil for file URL generation and management, encapsulating file-related logic.
- Refactored FileRepo and UserRepo to streamline database operations and error handling.
- Deleted unused request_id middleware and integrated its functionality into request_logger.
- Removed legacy test runner script to simplify testing process.
2025-06-17 23:09:02 +08:00
limitcool
36d816d908 feat: Refactor file storage to use gocloud.dev/blob for local and S3 storage
- Replace QOR OSS with gocloud.dev/blob for file storage management.
- Implement S3 client creation and presigned URL generation for uploads and downloads.
- Add methods for confirming uploads and retrieving file URLs.
- Introduce new endpoints for uploading files and confirming uploads in the file handler.
- Update file storage paths to differentiate between public and private files.
- Enhance file type validation and error handling in the file upload process.
- Add support for listing files and retrieving file information.
- Implement public file access with direct URL redirection.
2025-06-17 20:06:29 +08:00
limitcool
3a7af5cb70 refactor: Remove unnecessary logger fields and fix logging function calls 2025-06-17 17:22:27 +08:00
limitcool
3d54f13e68 refactor: remove unused modules and dependencies
- Deleted the `api`, `redisdb`, `sqldb`, `filestore`, `storage_fx`, and `http` modules as they are no longer needed.
- Removed the `fx` dependency from various handlers and modules to simplify the codebase.
- Updated the `go.mod` and `go.sum` files to reflect the removal of unused dependencies.
- Refactored the application structure to initialize components directly in the `app` package.
- Added a new `app` package to manage application lifecycle and component initialization.
- Implemented graceful shutdown for the HTTP server, database, and Redis connections.
- Enhanced error handling and logging throughout the application.
2025-06-17 15:03:55 +08:00
limitcool
6749e117d7 feat: split project into lite and enterprise modes
This commit establishes the lite branch, which provides a simplified version of the framework:

- Simplified architecture: removed Service and Repository layers
- Single user table design: using is_admin field to distinguish administrators
- Removed complex features: RBAC permissions, menu management, and role system
- Streamlined middleware: simplified auth checks based on is_admin field
- Unified naming conventions: removed "simple" prefixes from functions and files
- Updated documentation: revised README files to reflect lite mode features

The lite mode is designed for rapid development and simple applications, while
the enterprise mode (main branch) retains all advanced features for complex
business scenarios.
2025-04-29 16:31:25 +08:00