Skip to content

Conversation

wuayee
Copy link
Contributor

@wuayee wuayee commented Sep 4, 2025

🔗 相关问题 / Related Issue

Issue 链接 / Issue Link: #

  • 我已经创建了相关 Issue 并进行了讨论 / I have created and discussed the related issue
  • 这是一个微小的修改(如错别字),不需要 Issue / This is a trivial change (like typo fix) that doesn't need an issue

📋 变更类型 / Type of Change

  • 🐛 Bug 修复 / Bug fix (non-breaking change which fixes an issue)
  • ✨ 新功能 / New feature (non-breaking change which adds functionality)
  • 💥 破坏性变更 / Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 文档更新 / Documentation update
  • 🔧 重构 / Refactoring (no functional changes)
  • ⚡ 性能优化 / Performance improvement
  • 📦 依赖升级 / Dependency upgrade (update dependencies to newer versions)
  • 🚀 功能增强 / Feature enhancement (improve existing functionality without breaking changes)
  • 🧹 代码清理 / Code cleanup

📝 变更目的 / Purpose of the Change

📋 主要变更 / Brief Changelog

  1. 增加分域功能 / Add domain division function

🧪 验证变更 / Verifying this Change

测试步骤 / Test Steps

  1. 以下几种方式创建资源,对应查找资源时,会根据用户的用户组不同,可见性不同
    (1)三种应用创建方式和应用查询
    (2)表单上传和查询
    (3)插件上传、查询和部署
    (4)工具流创建

  2. The following methods create resources. When searching for resources, visibility varies depending on the user's user group.
    (1) Three application creation methods and application query
    (2) Form upload and query
    (3) Plugin upload, query, and deployment
    (4) Tool flow creation

  3. admin用户能够访问所有资源 / The admin user can access all resources

  4. 公共组资源能被所有用户访问 / Public group resources can be accessed by all users

  5. 如果用户创建了资源后,切换了组,则看不到之前组的信息 /
    If a user switches groups after creating a resource, the previous group's information will not be visible.

测试覆盖 / Test Coverage

  • 我已经添加了单元测试 / I have added unit tests
  • 所有现有测试都通过 / All existing tests pass
  • 我已经进行了手动测试 / I have performed manual testing

📸 截图 / Screenshots

✅ 贡献者检查清单 / Contributor Checklist

请确保你的 Pull Request 符合以下要求 / Please ensure your Pull Request meets the following requirements:

基本要求 / Basic Requirements:

  • 确保有 GitHub Issue 对应这个变更(微小变更如错别字除外)/ Make sure there is a Github issue filed for the change (trivial changes like typos excluded)
  • 你的 Pull Request 只解决一个 Issue,没有包含其他不相关的变更 / Your PR addresses just this issue, without pulling in other changes - one PR resolves one issue
  • PR 中的每个 commit 都有有意义的主题行和描述 / Each commit in the PR has a meaningful subject line and body

代码质量 / Code Quality:

  • 我的代码遵循项目的代码规范 / My code follows the project's coding standards
  • 我已经进行了自我代码审查 / I have performed a self-review of my code
  • 我已经为复杂的代码添加了必要的注释 / I have commented my code, particularly in hard-to-understand areas

测试要求 / Testing Requirements:

  • 我已经编写了必要的单元测试来验证逻辑正确性 / I have written necessary unit-tests to verify the logic correction
  • 当存在跨模块依赖时,我尽量使用了 mock / I have used mocks when cross-module dependencies exist
  • 基础检查通过:mvn -B clean package -Dmaven.test.skip=truenpm install --force && npm run build:pro / Basic checks pass
  • 单元测试通过:mvn clean install / Unit tests pass

文档和兼容性 / Documentation and Compatibility:

  • 我已经更新了相应的文档 / I have made corresponding changes to the documentation
  • 如果有破坏性变更,我已经在 PR 描述中详细说明 / If there are breaking changes, I have documented them in detail
  • 我已经考虑了向后兼容性 / I have considered backward compatibility

📋 附加信息 / Additional Notes


审查者注意事项 / Reviewer Notes:

@wuayee wuayee added this to the 1.3.0 milestone Sep 4, 2025
@wuayee wuayee requested a review from a team September 4, 2025 07:57
@wuayee wuayee self-assigned this Sep 4, 2025
@wuayee wuayee requested review from reeeborn33 and removed request for a team September 4, 2025 07:57
@wuayee wuayee added this to Nova Sep 4, 2025
@wuayee wuayee added in: builder Issues in app-builder modules type: feature A general feature labels Sep 4, 2025
@wuayee wuayee requested a review from a team September 4, 2025 07:57
}
UserGroup userGroup = this.getUserGroup(username);
String currUserGroupId = userGroup.getId();
for(String toBeVerifiedId : toBeVerifiedIds) {

Choose a reason for hiding this comment

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

image 缺少空格

UserGroup userGroup = this.getUserGroup(username);
String currUserGroupId = userGroup.getId();
for(String toBeVerifiedId : toBeVerifiedIds) {
if (!(StringUtils.equals(toBeVerifiedId, "*") || StringUtils.equals(toBeVerifiedId, currUserGroupId))) {

Choose a reason for hiding this comment

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

image 这个for循环可以优化为stream,例如 return Arrays.stream(toBeVerifiedIds) .allMatch(id -> Objects.equals(id, "*") || Objects.equals(id, currUserGroupId));

Object[] paramValues = joinPoint.getArgs();
Object value = null;
for (int i = 0; i < paramNames.length; i++) {
if (paramNames[i].equals(idKey)) {

Choose a reason for hiding this comment

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

image 建议统一用objects.equal方法

String currentUserGroupId = this.domainDivisionService.getUserGroupId();
boolean isCurrentGroup = StringUtils.equals(data.getUserGroupId(), currentUserGroupId);
boolean isAllGroup = StringUtils.equals(data.getUserGroupId(), "*");
return !(isCurrentGroup || isAllGroup);

Choose a reason for hiding this comment

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

image 这里逻辑比较绕,建议前面取反,增加易读性 例如: // 明确排除两种情况 boolean isAccessibleGroup = !StringUtils.equals(data.getUserGroupId(), currentUserGroupId); boolean isNotWildcardGroup = !StringUtils.equals(data.getUserGroupId(), "*");;
return isAccessibleGroup && isNotWildcardGroup;

* 向当前构建器中设置用户组唯一标识。
*
* @param userGroupId 表示用户组唯一标识的 {@link String}。
* @return 表示当前构建器的 {@link B}。

Choose a reason for hiding this comment

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

image 这里没必要加link了吧?请确认是否可以跳转,是否有必要性。若可以的话,直接关闭该意见即可

@wuayee wuayee added the in: store Issues in store modules label Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: builder Issues in app-builder modules in: store Issues in store modules type: feature A general feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants