补充部分方法注释

This commit is contained in:
zhangyuheng 2024-08-26 09:31:05 +08:00
parent 3989ca955f
commit 7157a27fa9
3 changed files with 75 additions and 0 deletions

View File

@ -25,6 +25,12 @@ import static cn.lunadeer.dominion.utils.ControllerUtils.notOwner;
public class DominionController { public class DominionController {
/**
* 获取玩家拥有的领地
*
* @param owner 玩家
* @return 领地列表
*/
public static List<DominionDTO> all(Player owner) { public static List<DominionDTO> all(Player owner) {
return DominionDTO.selectByOwner(owner.getUniqueId()); return DominionDTO.selectByOwner(owner.getUniqueId());
} }

View File

@ -9,6 +9,14 @@ import static cn.lunadeer.dominion.utils.ControllerUtils.notOwner;
public class GroupController { public class GroupController {
/**
* 创建权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param nameColored 权限组名称带颜色
*/
public static void createGroup(AbstractOperator operator, String domName, String groupName, String 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 FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "创建权限组 %s 失败", groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建权限组 %s 成功", groupName); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建权限组 %s 成功", groupName);
@ -38,6 +46,13 @@ public class GroupController {
operator.setResponse(SUCCESS); operator.setResponse(SUCCESS);
} }
/**
* 删除权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
*/
public static void deleteGroup(AbstractOperator operator, String domName, String groupName) { public static void deleteGroup(AbstractOperator operator, String domName, String groupName) {
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除权限组 %s 失败", groupName); AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除权限组 %s 失败", groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除权限组 %s 成功", groupName); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除权限组 %s 成功", groupName);
@ -59,6 +74,15 @@ public class GroupController {
operator.setResponse(SUCCESS); 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) { 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 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); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "设置权限组 %s 的权限 %s 为 %s 成功", groupName, flag, value);
@ -96,6 +120,15 @@ public class GroupController {
operator.setResponse(SUCCESS); 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) { 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 FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "重命名权限组 %s 为 %s 失败", oldName, newName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "重命名权限组 %s 为 %s 成功", oldName, newName); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "重命名权限组 %s 为 %s 成功", oldName, newName);
@ -125,6 +158,14 @@ public class GroupController {
operator.setResponse(SUCCESS); operator.setResponse(SUCCESS);
} }
/**
* 添加成员到权限组
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param playerName 玩家名称
*/
public static void addMember(AbstractOperator operator, String domName, String groupName, String 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 FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "添加成员 %s 到权限组 %s 失败", playerName, groupName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "添加成员 %s 到权限组 %s 成功", playerName, groupName); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "添加成员 %s 到权限组 %s 成功", playerName, groupName);
@ -172,6 +213,14 @@ public class GroupController {
operator.setResponse(SUCCESS); operator.setResponse(SUCCESS);
} }
/**
* 从权限组移除成员
*
* @param operator 操作者
* @param domName 领地名称
* @param groupName 权限组名称
* @param playerName 玩家名称
*/
public static void removeMember(AbstractOperator operator, String domName, String groupName, String 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 FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "从权限组 %s 移除成员 %s 失败", groupName, playerName);
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "从权限组 %s 移除成员 %s 成功", groupName, playerName); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "从权限组 %s 移除成员 %s 成功", groupName, playerName);

View File

@ -7,6 +7,12 @@ import java.util.List;
public class TemplateController { public class TemplateController {
/**
* 创建权限模板
*
* @param operator 操作者
* @param templateName 模板名称
*/
public static void createTemplate(AbstractOperator operator, String templateName) { public static void createTemplate(AbstractOperator operator, String templateName) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建成功"); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "创建成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "创建失败"); AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "创建失败");
@ -29,6 +35,12 @@ public class TemplateController {
operator.setResponse(SUCCESS.addMessage("成功创建名为 %s 的权限模板", templateName)); operator.setResponse(SUCCESS.addMessage("成功创建名为 %s 的权限模板", templateName));
} }
/**
* 删除权限模板
*
* @param operator 操作者
* @param templateName 模板名称
*/
public static void deleteTemplate(AbstractOperator operator, String templateName) { public static void deleteTemplate(AbstractOperator operator, String templateName) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除成功"); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "删除成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除失败"); AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "删除失败");
@ -45,6 +57,14 @@ public class TemplateController {
operator.setResponse(SUCCESS); 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) { public static void setTemplateFlag(AbstractOperator operator, String templateName, String flag_name, boolean value) {
AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "设置成功"); AbstractOperator.Result SUCCESS = new AbstractOperator.Result(AbstractOperator.Result.SUCCESS, "设置成功");
AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "设置失败"); AbstractOperator.Result FAIL = new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "设置失败");