Skip to content

Commit

Permalink
chore-改进部分实现IModuleRegisterAbility接口的Module Alias声明方式
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Nov 5, 2024
1 parent cfe0f7a commit 58d4ab8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
import java.util.Map;

import static net.ximatai.muyun.platform.PlatformConst.BASE_PATH;
import static net.ximatai.muyun.platform.controller.AppConfController.MODULE_ALIAS;

@Tag(name = "全局程序配置(面向前端平台级业务)")
@Path(BASE_PATH + "/conf")
@Path(BASE_PATH + "/" + MODULE_ALIAS)
public class AppConfController extends Scaffold implements ICreateAbility, ISelectAbility, IUpdateAbility, ITableCreateAbility, IModuleRegisterAbility {
public final static String MODULE_ALIAS = "conf";

private final static String CONF_ID = "1";

Expand Down Expand Up @@ -81,10 +83,10 @@ public ModuleController getModuleController() {
@Override
public ModuleConfig getModuleConfig() {
return ModuleConfig.ofName("用户管理")
.setAlias("conf")
.setAlias(MODULE_ALIAS)
.setTable(getMainTable())
.setUrl("platform/conf/index")
.addAction(new ModuleAction("set", "写入配置", ModuleAction.TypeLike.UPDATE));
// .addAction(new ModuleAction("get", "获取配置", ModuleAction.TypeLike.UPDATE)); 不参与权限
// .addAction(new ModuleAction("get", "获取配置", ModuleAction.TypeLike.UPDATE)); 不参与权限,所以注释掉
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
import java.util.Objects;

import static net.ximatai.muyun.platform.PlatformConst.BASE_PATH;
import static net.ximatai.muyun.platform.controller.AuthorizationController.MODULE_ALIAS;

@Startup
@Tag(name = "权限管理")
@Path(BASE_PATH + "/authorization")
@Path(BASE_PATH + "/" + MODULE_ALIAS)
public class AuthorizationController extends Scaffold implements IDatabaseAbilityStd, IModuleRegisterAbility {
public final static String MODULE_ALIAS = "authorization";

private final LoadingCache<String, Map<String, Object>> actionCache = Caffeine.newBuilder()
.build(this::loadAction);
Expand Down Expand Up @@ -181,7 +183,7 @@ public ModuleController getModuleController() {
@Override
public ModuleConfig getModuleConfig() {
return ModuleConfig.ofName("权限管理")
.setAlias("authorization")
.setAlias(MODULE_ALIAS)
.setUrl("platform/authorization/index")
.addAction(new ModuleAction("view", "浏览", ModuleAction.TypeLike.VIEW))
.addAction(new ModuleAction("grant", "授权", ModuleAction.TypeLike.UPDATE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
import java.util.Map;

import static net.ximatai.muyun.platform.PlatformConst.BASE_PATH;
import static net.ximatai.muyun.platform.controller.RoleController.MODULE_ALIAS;

@Startup
@Tag(name = "角色管理")
@Path(BASE_PATH + "/role")
@Path(BASE_PATH + "/" + MODULE_ALIAS)
public class RoleController extends ScaffoldForPlatform implements ITreeAbility, IChildrenAbility, IModuleRegisterAbility {

public final static String MODULE_ALIAS = "role";

@Inject
UserRoleController userRoleController;

Expand Down Expand Up @@ -119,7 +122,7 @@ public ModuleConfig getModuleConfig() {
return ModuleConfig.ofName("角色管理")
.setTable("auth_role")
.setUrl("platform/role/index")
.setAlias("role")
.setAlias(MODULE_ALIAS)
.addAction(new ModuleAction("assign", "分配", ModuleAction.TypeLike.UPDATE))
.addAction(new ModuleAction("revoke", "撤回", ModuleAction.TypeLike.UPDATE));
}
Expand Down

0 comments on commit 58d4ab8

Please sign in to comment.