Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:申请加入用户组时,二级资源拥有者离职,上升到一级管理员审批 #2838

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yunlong098
Copy link

变更点(Changes)

  • xxxx

相关issues (Which issues this PR fixes)

  • Fixes #

备注(Special notes)

@tencentblueking-adm
Copy link

tencentblueking-adm commented Dec 13, 2024

CLA assistant check
All committers have signed the CLA.

@cachedmethod(timeout=60) # 缓存1分钟
def get_grade_or_parent_manager_members_by_group_id(self, group_id: int) -> List[str]:
"""获取分级管理员,如果为空,获取父级管理员"""
return self.svc.get_role_parent_member_by_group_id(group_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该将 “查询不到就查询父级管理员的逻辑” 放到 svc 层面,这个逻辑是业务逻辑,应该在 biz 层处理,即函数里处理

可以调用 svc 获取分级管理,判空,若为空,在获取父管理员成员

可以在 get_grade_manager_members_by_group_id 函数上添加参数,比如 fallback_to_parent_if_empty = False

需要查看调用点,如果只有一个,默认值可以是 True,如果有其他,则需要保持旧调用点不需要变动


从当前来看,svc 不需要增加任何函数

@nannan00 nannan00 self-requested a review December 24, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants