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: added query list of departments #2036

Open
wants to merge 12 commits into
base: ft_tenant
Choose a base branch
from

Conversation

rolin999
Copy link
Collaborator

Description

[OpenAPI V3] 分页 API - 获取部门列表

Checklist

  • 填写 PR 描述及相关 issue (write PR description and related issue)
  • 代码风格检查通过 (code style check passed)
  • PR 中包含单元测试 (include unit test)
  • 单元测试通过 (unit test passed)
  • 本地开发联调环境验证通过 (local development environment verification passed)

@rolin999 rolin999 changed the title feat: added query department list feat: added query list of departments Jan 17, 2025
@rolin999 rolin999 requested a review from nannan00 January 20, 2025 08:19
@rolin999 rolin999 requested a review from nannan00 January 20, 2025 11:10
@rolin999 rolin999 requested a review from nannan00 January 20, 2025 13:03
TenantDepartment.objects.filter(tenant_id=tenant_id, data_source_department_id__in=parent_ids).values_list(
"data_source_department_id", "id"
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

dept_parent_id_map => parent_id_map
parent_id_map => tenant_dept_id_map

parent_id = serializers.SerializerMethodField(help_text="父部门 ID", allow_null=True)

def get_parent_id(self, obj) -> int:
return self.context["parent_id_map"].get(obj.id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

def get_parent_id(self, obj: TenantDepartment) -> int

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