|
@@ -2,6 +2,8 @@ from pydantic import BaseModel
|
|
|
from typing import Optional
|
|
|
import datetime
|
|
|
|
|
|
+from pymysql import NULL
|
|
|
+
|
|
|
SECRET_KEY = "df2f77bd544240801a048bd4293afd8eeb7fff3cb7050e42c791db4b83ebadcd"
|
|
|
ALGORITHM = "HS256"
|
|
|
|
|
@@ -20,7 +22,6 @@ class User(BaseModel):
|
|
|
password: str
|
|
|
changPwdTime: Optional[datetime.datetime] = None
|
|
|
isAdmin: Optional[bool] = None
|
|
|
- roleType: Optional[str] = None
|
|
|
isEnable: Optional[bool] = True
|
|
|
updateTime: Optional[datetime.datetime] = None
|
|
|
token: Optional[str] = None
|
|
@@ -62,21 +63,25 @@ class user_authority(BaseModel):
|
|
|
setting_system_isAdd : int
|
|
|
setting_system_isEdit : int
|
|
|
setting_system_isDel : int
|
|
|
- setting_system_isView : int
|
|
|
- setting_system_isAdd : int
|
|
|
- setting_system_isEdit : int
|
|
|
- setting_system_isDel : int
|
|
|
tower_isView : int
|
|
|
tower_isAdd : int
|
|
|
tower_isEdit : int
|
|
|
tower_isDel : int
|
|
|
+ ai_prediction_id:int
|
|
|
+ channel_id:int
|
|
|
+ device_id:int
|
|
|
+ event_id:int
|
|
|
+ index_id:int
|
|
|
+ performance_id:int
|
|
|
+ record_id:int
|
|
|
+ setting_device_id:int
|
|
|
+ setting_system_id:int
|
|
|
+ tower_id:int
|
|
|
role_id:str
|
|
|
- id: str
|
|
|
access_token: str
|
|
|
def get_acl_from_module_name(self,module_name:str):
|
|
|
result = {}
|
|
|
- result["id"]= module_name + "."+str(self.id)
|
|
|
- result["user_id"]= self.id
|
|
|
+ exec("result['id'] = self.{}".format(module_name+'_id'))
|
|
|
exec("result['isView'] = self.{}".format(module_name+'_isView'))
|
|
|
exec("result['isAdd'] = self.{}".format(module_name+'_isAdd'))
|
|
|
exec("result['isEdit'] = self.{}".format(module_name+'_isEdit'))
|