Skip to content

Commit

Permalink
feat-ReferenceInfo-优化ctrl转化成ReferenceInfo的逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Sep 25, 2024
1 parent 6a30901 commit fbe638d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public List<QueryItem> queryItemList() {
@Override
public List<ReferenceInfo> getReferenceList() {
return List.of(
new ReferenceInfo("id_at_test_table_referable", testReferableController).autoPackage()
testReferableController.toReferenceInfo("id_at_test_table_referable")
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ default boolean checkColumnExist(String column) {
}

default ReferenceInfo toReferenceInfo(String foreignKey) {
return new ReferenceInfo(foreignKey, this);
return new ReferenceInfo(foreignKey, this).autoPackage();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public TableWrapper getTableWrapper() {
@Override
public List<ReferenceInfo> getReferenceList() {
return List.of(
organizationProvider.get().toReferenceInfo("id_at_org_organization").autoPackage(),
organizationProvider.get().toReferenceInfo("id_at_org_organization"),
dictController.toReferenceInfo("dict_dept_type")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@
import jakarta.ws.rs.Path;
import net.ximatai.muyun.ability.IChildrenAbility;
import net.ximatai.muyun.ability.IReferableAbility;
import net.ximatai.muyun.ability.IReferenceAbility;
import net.ximatai.muyun.ability.ITreeAbility;
import net.ximatai.muyun.base.BaseBusinessTable;
import net.ximatai.muyun.core.database.MyTableWrapper;
import net.ximatai.muyun.database.builder.Column;
import net.ximatai.muyun.database.builder.TableWrapper;
import net.ximatai.muyun.model.ChildTableInfo;
import net.ximatai.muyun.model.ReferenceInfo;
import net.ximatai.muyun.platform.ScaffoldForPlatform;

import java.util.List;

import static net.ximatai.muyun.platform.PlatformConst.BASE_PATH;

@Path(BASE_PATH + "/organization")
public class OrganizationController extends ScaffoldForPlatform implements ITreeAbility, IChildrenAbility, IReferableAbility {
public class OrganizationController extends ScaffoldForPlatform implements ITreeAbility, IChildrenAbility, IReferableAbility, IReferenceAbility {

@Inject
BaseBusinessTable base;

@Inject
DictController dictController;

@Inject
DepartmentController departmentController;

Expand Down Expand Up @@ -51,4 +56,10 @@ public List<ChildTableInfo> getChildren() {
return List.of(departmentController.toChildTable("id_at_org_organization"));
}

@Override
public List<ReferenceInfo> getReferenceList() {
return List.of(
dictController.toReferenceInfo("dict_orga_type")
);
}
}

0 comments on commit fbe638d

Please sign in to comment.