Skip to content

Commit

Permalink
补充部分方法注释
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Aug 26, 2024
1 parent 3989ca9 commit 7157a27
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

public class DominionController {

/**
* 获取玩家拥有的领地
*
* @param owner 玩家
* @return 领地列表
*/
public static List<DominionDTO> all(Player owner) {
return DominionDTO.selectByOwner(owner.getUniqueId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

public class GroupController {

/**
* 创建权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param nameColored 权限组名称(带颜色)
*/
public static void createGroup(AbstractOperator operator, String domName, String groupName, String nameColored) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "创建权限组 %s 失败", groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建权限组 %s 成功", groupName);
Expand Down Expand Up @@ -38,6 +46,13 @@ public static void createGroup(AbstractOperator operator, String domName, String
operator.setResponse(SUCCESS);
}

/**
* 删除权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
*/
public static void deleteGroup(AbstractOperator operator, String domName, String groupName) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除权限组 %s 失败", groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除权限组 %s 成功", groupName);
Expand All @@ -59,6 +74,15 @@ public static void deleteGroup(AbstractOperator operator, String domName, String
operator.setResponse(SUCCESS);
}

/**
* 设置权限组权限
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param flag 权限名称
* @param value 权限值
*/
public static void setGroupFlag(AbstractOperator operator, String domName, String groupName, String flag, boolean value) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "设置权限组 %s 的权限 %s 为 %s 失败", groupName, flag, value);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "设置权限组 %s 的权限 %s 为 %s 成功", groupName, flag, value);
Expand Down Expand Up @@ -96,6 +120,15 @@ public static void setGroupFlag(AbstractOperator operator, String domName, Strin
operator.setResponse(SUCCESS);
}

/**
* 重命名权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param oldName 旧名称
* @param newName 新名称
* @param nameColored 新名称(带颜色)
*/
public static void renameGroup(AbstractOperator operator, String domName, String oldName, String newName, String nameColored) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "重命名权限组 %s 为 %s 失败", oldName, newName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "重命名权限组 %s 为 %s 成功", oldName, newName);
Expand Down Expand Up @@ -125,6 +158,14 @@ public static void renameGroup(AbstractOperator operator, String domName, String
operator.setResponse(SUCCESS);
}

/**
* 添加成员到权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param playerName 玩家名称
*/
public static void addMember(AbstractOperator operator, String domName, String groupName, String playerName) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "添加成员 %s 到权限组 %s 失败", playerName, groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "添加成员 %s 到权限组 %s 成功", playerName, groupName);
Expand Down Expand Up @@ -172,6 +213,14 @@ public static void addMember(AbstractOperator operator, String domName, String g
operator.setResponse(SUCCESS);
}

/**
* 从权限组移除成员
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param playerName 玩家名称
*/
public static void removeMember(AbstractOperator operator, String domName, String groupName, String playerName) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "从权限组 %s 移除成员 %s 失败", groupName, playerName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "从权限组 %s 移除成员 %s 成功", groupName, playerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

public class TemplateController {

/**
* 创建权限模板
*
* @param operator 操作者
* @param templateName 模板名称
*/
public static void createTemplate(AbstractOperator operator, String templateName) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "创建失败");
Expand All @@ -29,6 +35,12 @@ public static void createTemplate(AbstractOperator operator, String templateName
operator.setResponse(SUCCESS.addMessage("成功创建名为 %s 的权限模板", templateName));
}

/**
* 删除权限模板
*
* @param operator 操作者
* @param templateName 模板名称
*/
public static void deleteTemplate(AbstractOperator operator, String templateName) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除失败");
Expand All @@ -45,6 +57,14 @@ public static void deleteTemplate(AbstractOperator operator, String templateName
operator.setResponse(SUCCESS);
}

/**
* 设置权限模板的权限
*
* @param operator 操作者
* @param templateName 模板名称
* @param flag_name 权限名称
* @param value 权限值
*/
public static void setTemplateFlag(AbstractOperator operator, String templateName, String flag_name, boolean value) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "设置成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "设置失败");
Expand Down

0 comments on commit 7157a27

Please sign in to comment.