diff --git a/api/api_v1/authz/authz.py b/api/api_v1/authz/authz.py index 90e808a..579688f 100644 --- a/api/api_v1/authz/authz.py +++ b/api/api_v1/authz/authz.py @@ -33,7 +33,8 @@ async def add_role_domain( casbin_enforcer.add_role_for_user_in_domain(user=item.username, role=item.role_id, domain=item.game) - return schemas.Msg(code=0, msg='添加成功') + + return schemas.Msg(code=0, msg='添加成功', data=True) @router.post("/get_permissions_for_user_in_domain") @@ -228,7 +229,6 @@ async def edit_role( return schemas.Msg(code=0, msg='ok', data=res.matched_count) - @router.get("/update_api_list") async def update_api_list( request: Request, @@ -256,4 +256,4 @@ async def update_api_list( add_data = schemas.UpdateApi(path=api, name=name) await crud.api_list.update_api(db, add_data) - return schemas.Msg(code=0, msg='ok', data=1) \ No newline at end of file + return schemas.Msg(code=0, msg='ok', data=1) diff --git a/models/behavior_analysis.py b/models/behavior_analysis.py index edf1e33..0af4435 100644 --- a/models/behavior_analysis.py +++ b/models/behavior_analysis.py @@ -161,6 +161,7 @@ class BehaviorAnalysis: # 用户自带过滤 if 'data_where' in kwargs: self.global_filters.extend(kwargs['data_where'].get(self.game, [])) + self.global_filters.extend(self.data_in.ext_filter) def _get_time_particle_size(self): return self.event_view.get('timeParticleSize') or 'P1D' diff --git a/models/user_analysis.py b/models/user_analysis.py index fe0d646..67839cf 100644 --- a/models/user_analysis.py +++ b/models/user_analysis.py @@ -54,6 +54,7 @@ class UserAnalysis: if 'data_where' in kwargs: self.global_filters.extend(kwargs['data_where'].get(self.game, [])) + self.global_filters.extend(self.data_in.ext_filter) async def _init_table(self): """ 从redis中取出表字段,构建表结构 diff --git a/models/x_analysis.py b/models/x_analysis.py index 14e0509..a7272dd 100644 --- a/models/x_analysis.py +++ b/models/x_analysis.py @@ -57,6 +57,7 @@ class XAnalysis: if 'data_where' in kwargs: self.account_filters = kwargs['data_where'].get(self.game, []) + self.global_filters.extend(self.data_in.ext_filter) def handler_filts(self, filters): where = [] for item in filters: diff --git a/schemas/sql.py b/schemas/sql.py index 6b21972..f82244c 100644 --- a/schemas/sql.py +++ b/schemas/sql.py @@ -12,3 +12,4 @@ class CkQuery(BaseModel): eventView: dict = None events: Union[List[dict], dict] = None report_id: str = None + ext_filter: list = []