From 351cd801ebf0da665c521448c978da100b4aaf03 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期四, 05 十二月 2024 15:21:08 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway
---
app/models/resource_model.py | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/app/models/resource_model.py b/app/models/resource_model.py
index 61e1bc9..e898e3a 100644
--- a/app/models/resource_model.py
+++ b/app/models/resource_model.py
@@ -87,6 +87,31 @@
return router
+
+ def to_router_dict(self):
+ router = {
+ 'id': self.id,
+ 'name': self.path.capitalize() if self.path else '',
+ 'path': self.path,
+ 'hidden': bool(self.hidden),
+ 'redirect': 'noRedirect',
+ 'component': self.url,
+ 'alwaysShow': True,
+ 'resourceType': self.get_type_json(),
+ 'meta': {
+ 'title': self.name,
+ 'icon': self.icon,
+ 'noCache': False,
+ 'link': ''
+ },
+ 'parentId': self.get_pid(),
+ }
+
+ if not router['component']:
+ router['component'] = 'Layout'
+ return router
+
+
def to_menu_json(self):
return {
'id': self.id,
@@ -133,8 +158,8 @@
def to_json(self):
return {
'id': self.id,
- 'createdatetime': self.created_at,
- 'updatedatetime': self.updated_at,
+ # 'createdatetime': self.created_at,
+ # 'updatedatetime': self.updated_at,
'name': self.name,
'description': self.description
}
@@ -151,7 +176,8 @@
perms: Optional[str] = ""
menuType: Optional[str] = ""
description: Optional[str] = ""
+ icon: Optional[str] = ""
parentId: str
status: str
- roles: list
- groups: Optional[list] = []
\ No newline at end of file
+ # roles: list
+ # groups: Optional[list] = []
\ No newline at end of file
--
Gitblit v1.8.0