mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2025-01-12 09:14:26 +08:00
补充部分方法注释
This commit is contained in:
parent
3989ca955f
commit
7157a27fa9
@ -25,6 +25,12 @@ import static cn.lunadeer.dominion.utils.ControllerUtils.notOwner;
|
||||
|
||||
public class DominionController {
|
||||
|
||||
/**
|
||||
* 获取玩家拥有的领地
|
||||
*
|
||||
* @param owner 玩家
|
||||
* @return 领地列表
|
||||
*/
|
||||
public static List<DominionDTO> all(Player owner) {
|
||||
return DominionDTO.selectByOwner(owner.getUniqueId());
|
||||
}
|
||||
|
@ -9,6 +9,14 @@ import static cn.lunadeer.dominion.utils.ControllerUtils.notOwner;
|
||||
|
||||
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);
|
||||
@ -38,6 +46,13 @@ public class GroupController {
|
||||
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);
|
||||
@ -59,6 +74,15 @@ public class GroupController {
|
||||
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);
|
||||
@ -96,6 +120,15 @@ public class GroupController {
|
||||
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);
|
||||
@ -125,6 +158,14 @@ public class GroupController {
|
||||
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);
|
||||
@ -172,6 +213,14 @@ public class GroupController {
|
||||
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);
|
||||
|
@ -7,6 +7,12 @@ import java.util.List;
|
||||
|
||||
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, "创建失败");
|
||||
@ -29,6 +35,12 @@ public class TemplateController {
|
||||
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, "删除失败");
|
||||
@ -45,6 +57,14 @@ public class TemplateController {
|
||||
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, "设置失败");
|
||||
|
Loading…
Reference in New Issue
Block a user