move everything to backend folder for migration to dashboard repository
This commit is contained in:
parent
af6b006409
commit
92ec7c653d
89 changed files with 0 additions and 0 deletions
17
backend/areas/apps/apps_service.py
Normal file
17
backend/areas/apps/apps_service.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from .models import App, AppRole
|
||||
|
||||
class AppsService:
|
||||
@staticmethod
|
||||
def get_all_apps():
|
||||
apps = App.query.all()
|
||||
return [app.to_dict() for app in apps]
|
||||
|
||||
@staticmethod
|
||||
def get_app(slug):
|
||||
app = App.query.filter_by(slug=slug).first()
|
||||
return app.to_dict()
|
||||
|
||||
@staticmethod
|
||||
def get_app_roles():
|
||||
app_roles = AppRole.query.all()
|
||||
return [{"user_id": app_role.user_id, "app_id": app_role.app_id, "role_id": app_role.role_id} for app_role in app_roles]
|
||||
Reference in a new issue