Commit deda7b7b authored by 赵啸非's avatar 赵啸非

修改权限菜单资源

parent 43e84720
...@@ -255,3 +255,120 @@ CREATE TABLE mortals_xhx_access_stat_log( ...@@ -255,3 +255,120 @@ CREATE TABLE mortals_xhx_access_stat_log(
`update_time` datetime COMMENT '更新时间', `update_time` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='统计日志表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='统计日志表';
-- ----------------------------
-- 资源信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_resource`;
CREATE TABLE mortals_xhx_resource(
`id` bigint(20) AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) COMMENT '名称',
`groupName` varchar(255) COMMENT '分组名称',
`url` varchar(2000) COMMENT '连接地址,多个地址以逗号分隔',
`authType` tinyint(2) DEFAULT '3' COMMENT '权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`sourceType` tinyint(2) DEFAULT '0' COMMENT '资源类型,(0.系统资源,1.开放资源)',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源信息业务';
-- ----------------------------
-- 角色信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role`;
CREATE TABLE mortals_xhx_role(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(50) COMMENT '角色名称',
`remark` varchar(200) COMMENT '备注',
`roleType` tinyint(2) DEFAULT '2' COMMENT '角色类型 (0.系统内置角色,1.默认系统角色.2.普通角色)',
`customerId` bigint(20) COMMENT '归属客户ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色信息业务';
-- ----------------------------
-- 角色资源权限业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_auth`;
CREATE TABLE mortals_xhx_role_auth(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) COMMENT '角色ID',
`menuId` bigint(20) COMMENT '菜单ID',
`resourceId` bigint(20) COMMENT '资源ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
,KEY `createUserId` (`createUserId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色资源权限业务';
-- ----------------------------
-- 角色用户业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_user`;
CREATE TABLE mortals_xhx_role_user(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) COMMENT '角色ID',
`userId` bigint(20) COMMENT '用户ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
,KEY `createUserId` (`createUserId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色用户业务';
-- ----------------------------
-- 菜单信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_menu`;
CREATE TABLE mortals_xhx_menu(
`id` bigint(20) AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) COMMENT '菜单名称',
`url` varchar(256) COMMENT '路由地址',
`ancestors` varchar(255) COMMENT '当前节点父id路径,“,”分割',
`parentId` bigint(20) COMMENT '父菜单ID,一级菜单的该字段值为-1',
`linkType` tinyint(2) DEFAULT '0' COMMENT '链接方式 (0.普通,1.弹出,2.脚本)',
`imgPath` varchar(128) COMMENT '主菜单图标,主菜单图标的css样式名',
`buttonImgPath` varchar(128) COMMENT '按钮图标,按钮图标的css样式名',
`imgCommPath` varchar(128) COMMENT '常用菜单图标,常用菜单图标的css样式名',
`commMenu` tinyint(2) DEFAULT '1' COMMENT '是否常用菜单 (0.非常用,1.常用)',
`component` varchar(128) COMMENT 'vue组件路径',
`menuType` tinyint(2) DEFAULT '0' COMMENT '菜单类型 (0.目录,1.菜单,2.按钮)',
`authType` tinyint(2) DEFAULT '3' COMMENT '权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`visible` tinyint(2) DEFAULT '0' COMMENT '菜单显示状态 (0.显示,1.隐藏)',
`perms` varchar(512) COMMENT '权限标识,多个逗号分割',
`remark` varchar(512) COMMENT '备注信息',
`orderId` int(4) COMMENT '排序编号',
`status` tinyint(2) DEFAULT '1' COMMENT '菜单状态 (0.停用,1.启用)',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单信息业务';
...@@ -194,6 +194,12 @@ ...@@ -194,6 +194,12 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.14</version>
</dependency>
</dependencies> </dependencies>
......
package com.mortals.xhx.base.system.menu.model;
import java.lang.reflect.Type;
import java.util.List;
import java.util.ArrayList;
import com.mortals.xhx.base.system.menu.model.vo.MenuVo;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.JSONToken;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
import org.springframework.util.ObjectUtils;
/**
* 菜单信息业务前端映射树结构实体类
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class MenuTreeSelect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private Long id;
/**
* 父节点ID
*/
private Long parentId;
/**
* 节点名称
*/
private String label;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<MenuTreeSelect> children;
public MenuTreeSelect() {};
public MenuTreeSelect(MenuEntity entity) {
this.id = entity.getId();
this.parentId = entity.getParentId();
this.label = entity.getName();
if(!ObjectUtils.isEmpty(entity.getChildren())){
this.children = entity.getChildren().stream().map(MenuTreeSelect::new).collect(Collectors.toList());
}
}
// 反序列化器
public class Deserializer implements ObjectDeserializer {
@Override
public MenuTreeSelect deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
MenuTreeSelect node = new MenuTreeSelect();
JSONObject jsonObject = parser.parseObject();
node.setId(jsonObject.getLong("id"));
node.setLabel(jsonObject.getString("label"));
JSONArray jsonArray = jsonObject.getJSONArray("children");
List<MenuTreeSelect> children = new ArrayList<>();
if(!ObjectUtils.isEmpty(jsonArray)){
for (int i = 0; i < jsonArray.size(); i++) {
MenuTreeSelect child = JSON.parseObject(jsonArray.getJSONObject(i).toJSONString(), MenuTreeSelect.class);
children.add(child);
}
}
node.setChildren(children);
return node;
}
@Override
public int getFastMatchToken() {
return JSONToken.LBRACE;
}
}
}
\ No newline at end of file
package com.mortals.xhx.base.system.menu.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 菜单信息业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class MenuVo extends BaseEntityLong {
/** 菜单ID,主键,自增长列表 */
private List <Long> idList;
/** 子菜单信息业务 */
private List<MenuEntity> children = new ArrayList<>();
private Integer type;
}
\ No newline at end of file
...@@ -87,7 +87,7 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity ...@@ -87,7 +87,7 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
} }
MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId()); MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId());
if (sysModuleParent != null) { if (sysModuleParent != null) {
sysModuleParent.getChildList().add(sysModule); sysModuleParent.getChildren().add(sysModule);
} }
} }
return outlookBar; return outlookBar;
...@@ -110,7 +110,7 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity ...@@ -110,7 +110,7 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
} }
MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId()); MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId());
if (sysModuleParent != null) { if (sysModuleParent != null) {
sysModuleParent.getChildList().add(sysModule); sysModuleParent.getChildren().add(sysModule);
} }
} }
return outlookBar; return outlookBar;
......
...@@ -8,6 +8,8 @@ import com.mortals.framework.model.OrderCol; ...@@ -8,6 +8,8 @@ import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.menu.model.MenuQuery; import com.mortals.xhx.base.system.menu.model.MenuQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
...@@ -64,6 +66,7 @@ public class MenuController extends BaseCRUDJsonBodyMappingController<MenuServic ...@@ -64,6 +66,7 @@ public class MenuController extends BaseCRUDJsonBodyMappingController<MenuServic
/** /**
* 改变状态 * 改变状态
*/ */
@ApiOperation(value = "改变状态", notes = "改变状态")
@RequestMapping(value = "change/status") @RequestMapping(value = "change/status")
public String changeStatus(@RequestBody MenuEntity query) { public String changeStatus(@RequestBody MenuEntity query) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
...@@ -97,6 +100,7 @@ public class MenuController extends BaseCRUDJsonBodyMappingController<MenuServic ...@@ -97,6 +100,7 @@ public class MenuController extends BaseCRUDJsonBodyMappingController<MenuServic
/** /**
* 更换排序 * 更换排序
*/ */
@ApiOperation(value = "更换排序")
@PostMapping(value = "upOrDown") @PostMapping(value = "upOrDown")
public String upOrDownTopicList(@RequestBody MenuEntity query) { public String upOrDownTopicList(@RequestBody MenuEntity query) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
......
/**
* 文件:ParamEntity.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.param.model; package com.mortals.xhx.base.system.param.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.framework.service.IParam; import com.mortals.framework.service.IParam;
import com.mortals.xhx.base.system.param.model.vo.ParamVo;
import java.util.Date; import lombok.Data;
/** /**
* <p>Title: 参数信息</p> * 参数信息业务实体对象
* <p>Description: ParamEntity </p> *
* <p>Copyright: Copyright &reg; </p> * @author zxfei
* <p>Company: </p> * @date 2024-09-06
* @author */
* @version 1.0.0 @Data
*/ public class ParamEntity extends ParamVo implements IParam {
public class ParamEntity extends BaseEntityLong implements IParam { private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1536307966363L;
/** 参数名称 */
private String name;
/** 一级组织,如:平台配置 */
private String firstOrganize;
/** 二级组织,如:基础配置 */
private String secondOrganize;
/** 参数键,全局唯一 */
private String paramKey;
/** 参数值 */
private String paramValue;
/** 参数有效状态,0:禁用,1:启用,默认1 */
private Integer validStatus;
/** 参数修改状态,0:隐藏,1:页面仅查看,2:页面可修改,3:页面可删除,4:页面可修改删除,默认4 */
private Integer modStatus;
/** 展现类型,0:普通文本框,1:多行文本框,2:开关,3:块输入框,4:密码输入框,默认:0 */
private Integer displayType;
/** 备注 */
private String remark;
/** 创建时间 */
private Date createTime;
/** 创建用户ID */
private Long createUserId;
/** 创建用户名称 */
private String createUserName;
public ParamEntity(){
}
/**
* 获取 参数名称
* @return name
*/
public String getName(){
return this.name;
}
/**
* 设置 参数名称
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 一级组织,如:平台配置
* @return firstOrganize
*/
public String getFirstOrganize(){
return this.firstOrganize;
}
/**
* 设置 一级组织,如:平台配置
* @param firstOrganize
*/
public void setFirstOrganize(String firstOrganize){
this.firstOrganize = firstOrganize;
}
/**
* 获取 二级组织,如:基础配置
* @return secondOrganize
*/
public String getSecondOrganize(){
return this.secondOrganize;
}
/**
* 设置 二级组织,如:基础配置
* @param secondOrganize
*/
public void setSecondOrganize(String secondOrganize){
this.secondOrganize = secondOrganize;
}
/**
* 获取 参数键,全局唯一
* @return paramKey
*/
public String getParamKey(){
return this.paramKey;
}
/**
* 设置 参数键,全局唯一
* @param paramKey
*/
public void setParamKey(String paramKey){
this.paramKey = paramKey;
}
/**
* 获取 参数值
* @return paramValue
*/
public String getParamValue(){
return this.paramValue;
}
/**
* 设置 参数值
* @param paramValue
*/
public void setParamValue(String paramValue){
this.paramValue = paramValue;
}
/**
* 获取 参数有效状态,0:禁用,1:启用,默认1
* @return validStatus
*/
public Integer getValidStatus(){
return this.validStatus;
}
/**
* 设置 参数有效状态,0:禁用,1:启用,默认1
* @param validStatus
*/
public void setValidStatus(Integer validStatus){
this.validStatus = validStatus;
}
/**
* 获取 参数修改状态,0:隐藏,1:页面仅查看,2:页面可修改,3:页面可删除,4:页面可修改删除,默认4
* @return modStatus
*/
public Integer getModStatus(){
return this.modStatus;
}
/** /**
* 设置 参数修改状态,0:隐藏,1:页面仅查看,2:页面可修改,3:页面可删除,4:页面可修改删除,默认4 * 参数名称
* @param modStatus
*/ */
public void setModStatus(Integer modStatus){ private String name;
this.modStatus = modStatus;
}
/** /**
* 获取 展现类型,0:普通文本框,1:多行文本框,2:开关,3:块输入框,4:密码输入框,默认:0 * 一级组织,如:平台配置
* @return displayType
*/ */
public Integer getDisplayType(){ private String firstOrganize;
return this.displayType;
}
/** /**
* 设置 展现类型,0:普通文本框,1:多行文本框,2:开关,3:块输入框,4:密码输入框,默认:0 * 二级组织,如:基础配置
* @param displayType
*/ */
public void setDisplayType(Integer displayType){ private String secondOrganize;
this.displayType = displayType;
}
/** /**
* 获取 备注 * 参数键,全局唯一
* @return remark
*/ */
public String getRemark(){ private String paramKey;
return this.remark;
}
/** /**
* 设置 备注 * 参数值
* @param remark
*/ */
public void setRemark(String remark){ private String paramValue;
this.remark = remark;
}
/** /**
* 获取 创建时间 * 参数有效状态(0.禁用,1.启用)
* @return createTime
*/ */
public Date getCreateTime(){ private Integer validStatus;
return this.createTime;
}
/** /**
* 设置 创建时间 * 参数修改状态,(0.隐藏,1.页面仅查看,2.页面可修改,3.页面可删除,4.页面可修改删除)
* @param createTime
*/ */
public void setCreateTime(Date createTime){ private Integer modStatus;
this.createTime = createTime;
}
/** /**
* 获取 创建用户ID * 展现类型 (0.普通文本框,1.多行文本框,2.开关,3.块输入框)
* @return createUserId
*/ */
public Long getCreateUserId(){ private Integer displayType;
return this.createUserId;
}
/** /**
* 设置 创建用户ID * 备注
* @param createUserId
*/ */
public void setCreateUserId(Long createUserId){ private String remark;
this.createUserId = createUserId;
}
/** /**
* 获取 创建用户名称 * 创建用户名称
* @return createUserName
*/ */
public String getCreateUserName(){ private String createUserName;
return this.createUserName;
}
/** /**
* 设置 创建用户名称 * 创建用户名称
* @param createUserName
*/ */
public void setCreateUserName(String createUserName){ private String updateUserName;
this.createUserName = createUserName;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) if (obj == null) return false;
return false;
if (obj instanceof ParamEntity) { if (obj instanceof ParamEntity) {
ParamEntity tmp = (ParamEntity) obj; ParamEntity tmp = (ParamEntity) obj;
if (this.getId().longValue() == tmp.getId().longValue()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append("id:").append(getId())
.append(",name:").append(getName())
.append(",firstOrganize:").append(getFirstOrganize())
.append(",secondOrganize:").append(getSecondOrganize())
.append(",paramKey:").append(getParamKey())
.append(",paramValue:").append(getParamValue())
.append(",validStatus:").append(getValidStatus())
.append(",modStatus:").append(getModStatus())
.append(",displayType:").append(getDisplayType())
.append(",remark:").append(getRemark())
.append(",createTime:").append(getCreateTime())
.append(",createUserId:").append(getCreateUserId())
.append(",createUserName:").append(getCreateUserName());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.name = null; this.name = "";
this.firstOrganize = null; this.firstOrganize = "";
this.secondOrganize = null; this.secondOrganize = "";
this.paramKey = null; this.paramKey = "";
this.paramValue = null; this.paramValue = "";
this.validStatus = 1; this.validStatus = 1;
this.modStatus = 4; this.modStatus = 4;
this.displayType = 0; this.displayType = 0;
this.remark = null; this.remark = "";
this.createTime = null; this.createUserName = "";
this.createUserId = null; this.updateUserName = "";
this.createUserName = null;
} }
} }
\ No newline at end of file
package com.mortals.xhx.base.system.param.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.param.model.ParamEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 参数信息业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class ParamVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
...@@ -35,7 +35,6 @@ import java.util.Map; ...@@ -35,7 +35,6 @@ import java.util.Map;
public class ParamController extends BaseCRUDJsonBodyMappingController<ParamService, ParamEntity, Long> { public class ParamController extends BaseCRUDJsonBodyMappingController<ParamService, ParamEntity, Long> {
public ParamController() { public ParamController() {
super.setFormClass(ParamForm.class);
super.setModuleDesc("参数信息"); super.setModuleDesc("参数信息");
} }
...@@ -59,8 +58,4 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -59,8 +58,4 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
return result; return result;
} }
public static void main(String[] args) {
FileUtil.delete("E:\\pic\\1.png");
}
} }
\ No newline at end of file
/**
* 文件:ParamForm.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.param.web;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.web.BaseCRUDFormLong;
import com.mortals.xhx.base.system.param.model.ParamEntity;
import com.mortals.xhx.base.system.param.model.ParamQuery;
/**
* <p>Title: 参数信息</p>
* <p>Description: ParamForm </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public class ParamForm extends BaseCRUDFormLong<ParamEntity> {
private ParamEntity entity = new ParamEntity();
private ParamQuery query = new ParamQuery();
public ParamForm(){
}
@Override
public ParamEntity getEntity() {
return entity;
}
public void setEntity(ParamEntity entity) {
this.entity = entity;
}
@Override
public ParamQuery getQuery() {
return query;
}
public void setQuery(ParamQuery query) {
this.query = query;
}
public static void main(String[] args) {
ParamForm form = new ParamForm();
String entityName =form.getEntity().getClass().getSimpleName();
System.out.println(entityName);
if ((entityName = entityName.substring(0, 1).toLowerCase() + entityName.substring(1, entityName.length())).endsWith("Entity")) {
entityName = entityName.substring(0, entityName.length() - "Entity".length());
}
System.out.println(entityName);
System.out.println(JSON.toJSONString(form));
}
}
\ No newline at end of file
/**
* 文件:ResourceEntity.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.model; package com.mortals.xhx.base.system.resource.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.resource.model.vo.ResourceVo;
import lombok.Data;
/** /**
* <p>Title: 资源信息</p> * 资源信息业务实体对象
* <p>Description: ResourceEntity </p> *
* <p>Copyright: Copyright &reg; </p> * @author zxfei
* <p>Company: </p> * @date 2024-09-06
* @author */
* @version 1.0.0 @Data
*/ public class ResourceEntity extends ResourceVo {
public class ResourceEntity extends BaseEntityLong{ private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1547777703340L;
/** 名称 */
private String name;
/** 连接地址,多个地址以逗号分隔 */
private String url;
/** 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3 */
private Integer authType;
/** 资源类型,0:系统资源,1:开放资源,默认0 */
private Integer sourceType;
/** 创建时间 */
private Date createTime;
/** 创建用户 */
private Long createUserId;
/** 创建用户名称 */
private String createUserName;
/** 用户类型,0:系统用户 1:代理商用户 2:品牌商用户 */
private Integer userType;
public ResourceEntity(){
}
/**
* 获取 名称
* @return name
*/
public String getName(){
return this.name;
}
/**
* 设置 名称
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 连接地址,多个地址以逗号分隔
* @return url
*/
public String getUrl(){
return this.url;
}
/**
* 设置 连接地址,多个地址以逗号分隔
* @param url
*/
public void setUrl(String url){
this.url = url;
}
/**
* 获取 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3
* @return authType
*/
public Integer getAuthType(){
return this.authType;
}
/**
* 设置 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3
* @param authType
*/
public void setAuthType(Integer authType){
this.authType = authType;
}
/**
* 获取 资源类型,0:系统资源,1:开放资源,默认0
* @return sourceType
*/
public Integer getSourceType(){
return this.sourceType;
}
/**
* 设置 资源类型,0:系统资源,1:开放资源,默认0
* @param sourceType
*/
public void setSourceType(Integer sourceType){
this.sourceType = sourceType;
}
/** /**
* 获取 创建时间 * 名称
* @return createTime
*/ */
public Date getCreateTime(){ private String name;
return this.createTime;
}
/** /**
* 设置 创建时间 * 分组名称
* @param createTime
*/ */
public void setCreateTime(Date createTime){ private String groupName;
this.createTime = createTime;
}
/** /**
* 获取 创建用户 * 连接地址,多个地址以逗号分隔
* @return createUserId
*/ */
public Long getCreateUserId(){ private String url;
return this.createUserId;
}
/**
* 设置 创建用户
* @param createUserId
*/
public void setCreateUserId(Long createUserId){
this.createUserId = createUserId;
}
/** /**
* 获取 创建用户名称 * 权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)
* @return createUserName
*/ */
public String getCreateUserName(){ private Integer authType;
return this.createUserName;
}
/** /**
* 设置 创建用户名称 * 资源类型,(0.系统资源,1.开放资源)
* @param createUserName
*/ */
public void setCreateUserName(String createUserName){ private Integer sourceType;
this.createUserName = createUserName;
}
/** /**
* 获取 用户类型,0:系统用户 1:代理商用户 2:品牌商用户 * 创建用户名称
* @return userType
*/ */
public Integer getUserType(){ private String createUserName;
return this.userType;
}
/** /**
* 设置 用户类型,0:系统用户 1:代理商用户 2:品牌商用户 * 创建用户名称
* @param userType
*/ */
public void setUserType(Integer userType){ private String updateUserName;
this.userType = userType;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) if (obj == null) return false;
return false;
if (obj instanceof ResourceEntity) { if (obj instanceof ResourceEntity) {
ResourceEntity tmp = (ResourceEntity) obj; ResourceEntity tmp = (ResourceEntity) obj;
if (this.getId().longValue() == tmp.getId().longValue()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append("id:").append(getId())
.append(",name:").append(getName())
.append(",url:").append(getUrl())
.append(",authType:").append(getAuthType())
.append(",sourceType:").append(getSourceType())
.append(",createTime:").append(getCreateTime())
.append(",createUserId:").append(getCreateUserId())
.append(",createUserName:").append(getCreateUserName())
.append(",userType:").append(getUserType());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.name = null; this.name = "";
this.url = null; this.groupName = "";
this.url = "";
this.authType = 3; this.authType = 3;
this.sourceType = 0; this.sourceType = 0;
this.createTime = null; this.createUserName = "";
this.createUserId = null; this.updateUserName = "";
this.createUserName = null;
this.userType = null;
} }
} }
\ No newline at end of file
package com.mortals.xhx.base.system.resource.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 资源信息业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class ResourceVo extends BaseEntityLong {
/** 菜单ID,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
...@@ -125,37 +125,6 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re ...@@ -125,37 +125,6 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
resourceEntity.setCreateUserId(this.getContextUserId(context)); resourceEntity.setCreateUserId(this.getContextUserId(context));
resourceEntity.setCreateTime(new Date()); resourceEntity.setCreateTime(new Date());
this.save(resourceEntity, context); this.save(resourceEntity, context);
} else if (tempResourceList.size() == 1) {
//更新
ResourceEntity tempResource = tempResourceList.get(0);
Set<String> setUrl = Arrays.stream(resourceEntity.getUrl().split(",")).collect(Collectors.toSet());
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
} else if (tempResourceList.size() > 1) {
//找到多个同名的 资源配置
for (ResourceEntity tempResource : tempResourceList) {
//模糊匹配到路径有一个存在的
Set<String> setUrl = Arrays.stream(resourceEntity.getUrl().split(",")).collect(Collectors.toSet());
String[] splitUrl = tempResource.getUrl().split(",");
Boolean bool = false;
for (int i = 0; i < splitUrl.length; i++) {
if (setUrl.contains(splitUrl[i])) {
bool = true;
break;
}
}
if (bool) {
//匹配到了,更新当前这个资源
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
}
}
} }
} }
......
...@@ -14,6 +14,7 @@ import com.mortals.xhx.base.system.resource.model.ResourceEntity; ...@@ -14,6 +14,7 @@ import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService; import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.common.code.AuthType; import com.mortals.xhx.common.code.AuthType;
import com.mortals.xhx.common.code.SourceType; import com.mortals.xhx.common.code.SourceType;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -57,6 +58,7 @@ public class ResourceController extends BaseCRUDJsonBodyMappingController<Resour ...@@ -57,6 +58,7 @@ public class ResourceController extends BaseCRUDJsonBodyMappingController<Resour
* *
* @return * @return
*/ */
@ApiOperation(value = "获取所有资源")
@PostMapping("allResources") @PostMapping("allResources")
public String allResources(int userType) { public String allResources(int userType) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
......
package com.mortals.xhx.base.system.role.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.role.model.RoleAuthEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 角色资源权限业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class RoleAuthVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.base.system.role.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.role.model.RoleUserEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 角色用户业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class RoleUserVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.base.system.role.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.role.model.RoleEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 角色信息业务视图对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class RoleVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
...@@ -243,7 +243,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -243,7 +243,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
} }
MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId()); MenuEntity sysModuleParent = menuMap.get(sysModule.getParentId());
if (sysModuleParent != null) { if (sysModuleParent != null) {
sysModuleParent.getChildList().add(sysModule); sysModuleParent.getChildren().add(sysModule);
} }
} }
return outlookBar; return outlookBar;
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)枚举类
*
* @author zxfei
*/
public enum AuthTypeEnum {
无限制(0, "无限制"),
无需登录查看(1, "无需登录查看"),
需要登录查看(2, "需要登录查看"),
需要角色权限查看(3, "需要角色权限查看");
private Integer value;
private String desc;
AuthTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static AuthTypeEnum getByValue(Integer value) {
for (AuthTypeEnum authTypeEnum : AuthTypeEnum.values()) {
if (authTypeEnum.getValue() == value) {
return authTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (AuthTypeEnum item : AuthTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否常用菜单 (0.非常用,1.常用)枚举类
*
* @author zxfei
*/
public enum CommMenuEnum {
非常用(0, "非常用"),
常用(1, "常用");
private Integer value;
private String desc;
CommMenuEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static CommMenuEnum getByValue(Integer value) {
for (CommMenuEnum commMenuEnum : CommMenuEnum.values()) {
if (commMenuEnum.getValue() == value) {
return commMenuEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (CommMenuEnum item : CommMenuEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 展现类型 (0.普通文本框,1.多行文本框,2.开关,3.块输入框)枚举类
*
* @author zxfei
*/
public enum DisplayTypeEnum {
普通文本框(0, "普通文本框"),
多行文本框(1, "多行文本框"),
开关(2, "开关"),
块输入框(3, "块输入框");
private Integer value;
private String desc;
DisplayTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DisplayTypeEnum getByValue(Integer value) {
for (DisplayTypeEnum displayTypeEnum : DisplayTypeEnum.values()) {
if (displayTypeEnum.getValue() == value) {
return displayTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DisplayTypeEnum item : DisplayTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 链接方式 (0.普通,1.弹出,2.脚本)枚举类
*
* @author zxfei
*/
public enum LinkTypeEnum {
普通(0, "普通"),
弹出(1, "弹出"),
脚本(2, "脚本");
private Integer value;
private String desc;
LinkTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static LinkTypeEnum getByValue(Integer value) {
for (LinkTypeEnum linkTypeEnum : LinkTypeEnum.values()) {
if (linkTypeEnum.getValue() == value) {
return linkTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (LinkTypeEnum item : LinkTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 菜单类型 (0.目录,1.菜单,2.按钮)枚举类
*
* @author zxfei
*/
public enum MenuTypeEnum {
目录(0, "目录"),
菜单(1, "菜单"),
按钮(2, "按钮");
private Integer value;
private String desc;
MenuTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static MenuTypeEnum getByValue(Integer value) {
for (MenuTypeEnum menuTypeEnum : MenuTypeEnum.values()) {
if (menuTypeEnum.getValue() == value) {
return menuTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (MenuTypeEnum item : MenuTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 方法name path枚举类
*
* @author zxfei
*/
public enum MethodNameEnum {
list("list", "列表"),
delete("delete", "删除"),
logicDelete("logicDelete", "逻辑删除"),
saveOrUpdate("save", "保存更新"),
batchSave("batchSave", "批量保存更新"),
info("info", "查看"),
exportExcel("exportExcel", "导出excel"),
importData("importData", "导入excel"),
downloadTemplate("downloadTemplate", "下载模板"),
view("view", "查看");
private String value;
private String desc;
MethodNameEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static MethodNameEnum getByValue(String value) {
for (MethodNameEnum wySigninEnum : MethodNameEnum.values()) {
if (wySigninEnum.getValue() == value) {
return wySigninEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (MethodNameEnum item : MethodNameEnum.values()) {
try {
boolean hasE = false;
for (String e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
...@@ -4,69 +4,63 @@ import java.util.LinkedHashMap; ...@@ -4,69 +4,63 @@ import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
/** /**
* 参数修改状态 * 参数修改状态,(0.隐藏,1.页面仅查看,2.页面可修改,3.页面可删除,4.页面可修改删除)枚举类
* @author *
* * @author zxfei
*/ */
public enum ModStatusEnum { public enum ModStatusEnum {
/** 页面隐藏 */ 隐藏(0, "隐藏"),
HIDDEN(0, "隐藏"), 页面仅查看(1, "页面仅查看"),
/** 页面可查看 */ 页面可修改(2, "页面可修改"),
VIEW(1, "查看"), 页面可删除(3, "页面可删除"),
/** 页面可修改 */ 页面可修改删除(4, "页面可修改删除");
EDIT(2, "修改"), private Integer value;
/** 页面可删除 */
DELETE(3, "删除"),
/** 页面可修改删除 */
EDITANDDELETE(4, "修改删除");
private int value;
private String desc; private String desc;
ModStatusEnum(Integer value, String desc) {
ModStatusEnum(int value, String desc) {
this.value = value; this.value = value;
this.desc = desc; this.desc = desc;
} }
public Integer getValue() {
public int getValue() {
return this.value; return this.value;
} }
public String getDesc() { public String getDesc() {
return desc; return this.desc;
} }
public static ModStatusEnum getByValue(int value) { public static ModStatusEnum getByValue(Integer value) {
for (ModStatusEnum modStatus : ModStatusEnum.values()) { for (ModStatusEnum modStatusEnum : ModStatusEnum.values()) {
if (modStatus.getValue() == value) { if (modStatusEnum.getValue() == value) {
return modStatus; return modStatusEnum;
} }
} }
return null; return null;
} }
/** /**
* 获取Map集合 * 获取Map集合
*
* @param eItem 不包含项 * @param eItem 不包含项
* @return * @return
*/ */
public static Map<String,String> getEnumMap(int... eItem) { public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>(); Map<String, String> resultMap = new LinkedHashMap<>();
for (ModStatusEnum item : ModStatusEnum.values()) { for (ModStatusEnum item : ModStatusEnum.values()) {
try{ try {
boolean hasE = false; boolean hasE = false;
for (int e : eItem){ for (Integer e : eItem) {
if(item.getValue()==e){ if (item.getValue() == e) {
hasE = true; hasE = true;
break; break;
} }
} }
if(!hasE){ if (!hasE) {
resultMap.put(item.getValue()+"", item.getDesc()); resultMap.put(item.getValue() + "", item.getDesc());
} }
}catch(Exception ex){ } catch (Exception ex) {
} }
} }
return resultMap; return resultMap;
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 角色类型 (0.系统内置角色,1.默认系统角色.2.普通角色)枚举类
*
* @author zxfei
*/
public enum RoleTypeEnum {
系统内置角色(0, "系统内置角色"),
默认系统角色(1, "默认系统角色");
private Integer value;
private String desc;
RoleTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static RoleTypeEnum getByValue(Integer value) {
for (RoleTypeEnum roleTypeEnum : RoleTypeEnum.values()) {
if (roleTypeEnum.getValue() == value) {
return roleTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (RoleTypeEnum item : RoleTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 资源类型,(0.系统资源,1.开放资源)枚举类
*
* @author zxfei
*/
public enum SourceTypeEnum {
系统资源(0, "系统资源"),
开放资源(1, "开放资源");
private Integer value;
private String desc;
SourceTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static SourceTypeEnum getByValue(Integer value) {
for (SourceTypeEnum sourceTypeEnum : SourceTypeEnum.values()) {
if (sourceTypeEnum.getValue() == value) {
return sourceTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (SourceTypeEnum item : SourceTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
...@@ -4,12 +4,12 @@ import java.util.LinkedHashMap; ...@@ -4,12 +4,12 @@ import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
/** /**
* 启用状态 (0.停止,1.启用)枚举类 * 菜单状态 (0.停用,1.启用)枚举类
* *
* @author zxfei * @author zxfei
*/ */
public enum StatusEnum { public enum StatusEnum {
(0, "停止"), (0, "停用"),
启用(1, "启用"); 启用(1, "启用");
private Integer value; private Integer value;
private String desc; private String desc;
......
...@@ -70,13 +70,23 @@ Content-Type: application/json ...@@ -70,13 +70,23 @@ Content-Type: application/json
"createTimeEnd": "2024-07-29" "createTimeEnd": "2024-07-29"
} }
###所有
POST {{baseUrl}}/stat/stat
Content-Type: application/json
{
"createTimeStart": "2024-07-01",
"createTimeEnd": "2024-06-61",
"accessId": 17
}
###所有 ###所有
POST {{baseUrl}}/access/stat POST {{baseUrl}}/access/stat
Content-Type: application/json Content-Type: application/json
{ {
"accessTimeStart": "2023-01-01", "accessTimeStart": "2023-01-01",
"accessTimeEnd": "2024-08-05" "accessTimeEnd": "2024-08-22"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment