Logo
Explore Help
Sign In
Karl/KTVManager_Backend
1
0
Fork 0
You've already forked KTVManager_Backend
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
KTVManager_Backend/ktvmanager/lib/get_users.py

7 lines
241 B
Python
Raw Normal View History

feat(app): restructure as a modern Flask API This commit refactors the entire backend application into a more structured and maintainable Flask project. It introduces an application factory pattern, consolidates routes into a blueprint, and implements a robust authentication and database layer. - Introduces a Flask application factory (`create_app` in `main.py`) for better organization and testability. - Consolidates all API routes into a single blueprint (`routes/api.py`) for modularity. - Implements a new basic authentication system using a decorator (`@requires_basic_auth`) to secure all endpoints. - Refactors the database access layer with standardized query execution and connection handling. - Adds new modules for core logic, including an account checker (`checker.py`) and user retrieval (`get_users.py`). - Updates the VSCode launch configuration to support the new Flask application structure. BREAKING CHANGE: The application has been completely restructured. The old `server.py` entry point is removed. The application should now be run via the app factory in `main.py`. All API endpoints now require basic authentication.
2025-07-13 19:40:04 +01:00
from ktvmanager.lib.database import _execute_query
def get_users():
query = "SELECT userName, password FROM users"
results = _execute_query(query)
users = {user['userName']: user['password'] for user in results}
return users
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 59ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API