From 3c299c91aa08007137534eaa4b8e2548415cf26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=BB=E6=AC=A2=C2=B7=E6=9D=8E?= Date: Wed, 21 Mar 2018 16:28:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E4=BB=A3=E7=A0=81=E3=80=82=E8=88=92?= =?UTF-8?q?=E6=9C=8D=EF=BC=81=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/github/pig/common/entity/SysLog.java | 121 +----------------- .../com/github/pig/common/vo/ErrorPojo.java | 50 +------- .../com/github/pig/common/vo/ImageCode.java | 31 +---- .../java/com/github/pig/common/vo/LogVo.java | 19 +-- .../java/com/github/pig/common/vo/MenuVo.java | 110 +--------------- .../com/github/pig/common/vo/SysRole.java | 60 +-------- .../java/com/github/pig/common/vo/UserVo.java | 99 +------------- pig-config/src/main/resources/application.yml | 3 +- .../github/pig/admin/model/dto/MenuTree.java | 13 ++ .../github/pig/admin/model/dto/TreeNode.java | 3 + .../pig/admin/model/entity/SysDict.java | 82 +----------- .../pig/admin/model/entity/SysMenu.java | 114 +---------------- .../pig/admin/model/entity/SysRoleDept.java | 26 +--- .../pig/admin/model/entity/SysRoleMenu.java | 19 +-- .../pig/admin/model/entity/SysUser.java | 82 +----------- .../pig/admin/model/entity/SysUserRole.java | 18 +-- .../service/impl/SysMenuServiceImpl.java | 19 +-- .../main/resources/mapper/SysMenuMapper.xml | 1 + 18 files changed, 59 insertions(+), 811 deletions(-) diff --git a/pig-common/src/main/java/com/github/pig/common/entity/SysLog.java b/pig-common/src/main/java/com/github/pig/common/entity/SysLog.java index 25150ea6..a53c53da 100644 --- a/pig-common/src/main/java/com/github/pig/common/entity/SysLog.java +++ b/pig-common/src/main/java/com/github/pig/common/entity/SysLog.java @@ -2,6 +2,7 @@ package com.github.pig.common.entity; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; import java.util.Date; @@ -14,6 +15,7 @@ import java.util.Date; * @author lengleng * @since 2017-11-20 */ +@Data public class SysLog implements Serializable { private static final long serialVersionUID = 1L; @@ -83,125 +85,6 @@ public class SysLog implements Serializable { */ private String serviceId; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getCreateBy() { - return createBy; - } - - public void setCreateBy(String createBy) { - this.createBy = createBy; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getRemoteAddr() { - return remoteAddr; - } - - public void setRemoteAddr(String remoteAddr) { - this.remoteAddr = remoteAddr; - } - - public String getUserAgent() { - return userAgent; - } - - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - public String getRequestUri() { - return requestUri; - } - - public void setRequestUri(String requestUri) { - this.requestUri = requestUri; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public Long getTime() { - return time; - } - - public void setTime(Long time) { - this.time = time; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getException() { - return exception; - } - - public void setException(String exception) { - this.exception = exception; - } - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } @Override public String toString() { diff --git a/pig-common/src/main/java/com/github/pig/common/vo/ErrorPojo.java b/pig-common/src/main/java/com/github/pig/common/vo/ErrorPojo.java index 3f9d317e..07e98fcc 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/ErrorPojo.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/ErrorPojo.java @@ -1,6 +1,7 @@ package com.github.pig.common.vo; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; import java.io.Serializable; @@ -9,6 +10,7 @@ import java.io.Serializable; * @date 2017/12/25 * spring boot 的异常对象 */ +@Data public class ErrorPojo implements Serializable { @JSONField(name = "timestamp") @@ -23,52 +25,4 @@ public class ErrorPojo implements Serializable { private String message; @JSONField(name = "path") private String path; - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getException() { - return exception; - } - - public void setException(String exception) { - this.exception = exception; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } } diff --git a/pig-common/src/main/java/com/github/pig/common/vo/ImageCode.java b/pig-common/src/main/java/com/github/pig/common/vo/ImageCode.java index 4b93d64c..6e0c664a 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/ImageCode.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/ImageCode.java @@ -1,5 +1,7 @@ package com.github.pig.common.vo; +import lombok.Data; + import java.awt.image.BufferedImage; import java.io.Serializable; import java.time.LocalDateTime; @@ -9,6 +11,7 @@ import java.time.LocalDateTime; * @author lengleng * @date 2017-12-18 */ +@Data public class ImageCode implements Serializable { private String code; @@ -21,32 +24,4 @@ public class ImageCode implements Serializable { this.code = sRand; this.expireTime = LocalDateTime.now().plusSeconds(defaultImageExpire); } - - public boolean isExpried() { - return LocalDateTime.now().isAfter(expireTime); - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public LocalDateTime getExpireTime() { - return expireTime; - } - - public void setExpireTime(LocalDateTime expireTime) { - this.expireTime = expireTime; - } - - public BufferedImage getImage() { - return image; - } - - public void setImage(BufferedImage image) { - this.image = image; - } } diff --git a/pig-common/src/main/java/com/github/pig/common/vo/LogVo.java b/pig-common/src/main/java/com/github/pig/common/vo/LogVo.java index 97c7a901..8264fd49 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/LogVo.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/LogVo.java @@ -1,6 +1,7 @@ package com.github.pig.common.vo; import com.github.pig.common.entity.SysLog; +import lombok.Data; import java.io.Serializable; @@ -8,24 +9,10 @@ import java.io.Serializable; * @author lengleng * @date 2017/11/20 */ +@Data public class LogVo implements Serializable { private static final long serialVersionUID = 1L; + private SysLog sysLog; private String token; - - public SysLog getSysLog() { - return sysLog; - } - - public void setSysLog(SysLog sysLog) { - this.sysLog = sysLog; - } - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } } diff --git a/pig-common/src/main/java/com/github/pig/common/vo/MenuVo.java b/pig-common/src/main/java/com/github/pig/common/vo/MenuVo.java index 97c0840b..b0b565c6 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/MenuVo.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/MenuVo.java @@ -1,5 +1,7 @@ package com.github.pig.common.vo; +import lombok.Data; + import java.io.Serializable; import java.util.Date; @@ -11,6 +13,7 @@ import java.util.Date; * @author lengleng * @since 2017-11-08 */ +@Data public class MenuVo implements Serializable { private static final long serialVersionUID = 1L; @@ -43,6 +46,10 @@ public class MenuVo implements Serializable { * 图标 */ private String icon; + /** + * 一个路径 + */ + private String path; /** * VUE页面 */ @@ -68,109 +75,6 @@ public class MenuVo implements Serializable { */ private String delFlag; - public Integer getMenuId() { - return menuId; - } - - public void setMenuId(Integer menuId) { - this.menuId = menuId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPermission() { - return permission; - } - - public void setPermission(String permission) { - this.permission = permission; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public Integer getParentId() { - return parentId; - } - - public void setParentId(Integer parentId) { - this.parentId = parentId; - } - - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } - - public String getComponent() { - return component; - } - - public void setComponent(String component) { - this.component = component; - } - - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } @Override public int hashCode() { diff --git a/pig-common/src/main/java/com/github/pig/common/vo/SysRole.java b/pig-common/src/main/java/com/github/pig/common/vo/SysRole.java index 6b576beb..a3ce1b3a 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/SysRole.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/SysRole.java @@ -1,5 +1,7 @@ package com.github.pig.common.vo; +import lombok.Data; + import java.io.Serializable; import java.util.Date; @@ -11,6 +13,7 @@ import java.util.Date; * @author lengleng * @since 2017-10-29 */ +@Data public class SysRole implements Serializable { private static final long serialVersionUID = 1L; @@ -22,63 +25,6 @@ public class SysRole implements Serializable { private Date updateTime; private String delFlag; - - public Integer getRoleId() { - return roleId; - } - - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - - public String getRoleName() { - return roleName; - } - - public void setRoleName(String roleName) { - this.roleName = roleName; - } - - public String getRoleCode() { - return roleCode; - } - - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; - } - - public String getRoleDesc() { - return roleDesc; - } - - public void setRoleDesc(String roleDesc) { - this.roleDesc = roleDesc; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - @Override public String toString() { return "SysRole{" + diff --git a/pig-common/src/main/java/com/github/pig/common/vo/UserVo.java b/pig-common/src/main/java/com/github/pig/common/vo/UserVo.java index d639b539..723d346f 100644 --- a/pig-common/src/main/java/com/github/pig/common/vo/UserVo.java +++ b/pig-common/src/main/java/com/github/pig/common/vo/UserVo.java @@ -1,5 +1,7 @@ package com.github.pig.common.vo; +import lombok.Data; + import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -9,6 +11,7 @@ import java.util.List; * @author lengleng * @date 2017/10/29 */ +@Data public class UserVo implements Serializable { private static final long serialVersionUID = 1L; @@ -62,100 +65,4 @@ public class UserVo implements Serializable { * 角色列表 */ private List roleList = new ArrayList<>(); - - public Integer getUserId() { - return userId; - } - - public void setUserId(Integer userId) { - this.userId = userId; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getSalt() { - return salt; - } - - public void setSalt(String salt) { - this.salt = salt; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public List getRoleList() { - return roleList; - } - - public void setRoleList(List roleList) { - this.roleList = roleList; - } - - public String getIntroduction() { - return introduction; - } - - public void setIntroduction(String introduction) { - this.introduction = introduction; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public Integer getDeptId() { - return deptId; - } - - public void setDeptId(Integer deptId) { - this.deptId = deptId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } } diff --git a/pig-config/src/main/resources/application.yml b/pig-config/src/main/resources/application.yml index 34cd7be5..aeff6ced 100644 --- a/pig-config/src/main/resources/application.yml +++ b/pig-config/src/main/resources/application.yml @@ -10,7 +10,8 @@ spring: config: server: git: - uri: https://gitee.com/cqzqxq_lxh/pig-config.git +# uri: https://gitee.com/cqzqxq_lxh/pig-config.git + uri: https://gitee.com/boding1/pig-config.git --- spring: profiles: dev diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/MenuTree.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/MenuTree.java index 63f06c1f..f3b2ec0d 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/MenuTree.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/MenuTree.java @@ -1,5 +1,6 @@ package com.github.pig.admin.model.dto; +import com.github.pig.common.vo.MenuVo; import lombok.Data; /** @@ -36,4 +37,16 @@ public class MenuTree extends TreeNode { this.name = name; this.label = name; } + + public MenuTree(MenuVo menuVo) { + this.id = menuVo.getMenuId(); + this.parentId = menuVo.getParentId(); + this.icon = menuVo.getIcon(); + this.name = menuVo.getName(); + this.url = menuVo.getUrl(); + this.path = menuVo.getPath(); + this.component = menuVo.getComponent(); + this.type = menuVo.getType(); + this.label = menuVo.getName(); + } } diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/TreeNode.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/TreeNode.java index 8e782413..bf92d455 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/TreeNode.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/dto/TreeNode.java @@ -1,5 +1,7 @@ package com.github.pig.admin.model.dto; +import lombok.Data; + import java.util.ArrayList; import java.util.List; @@ -7,6 +9,7 @@ import java.util.List; * @author lengleng * @date 2017年11月9日23:33:45 */ +@Data public class TreeNode { protected int id; protected int parentId; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysDict.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysDict.java index 3da4f6b6..5678dad6 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysDict.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysDict.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; @@ -18,6 +19,7 @@ import java.util.Date; * @author lengleng * @since 2017-11-19 */ +@Data @TableName("sys_dict") public class SysDict extends Model { @@ -69,86 +71,6 @@ public class SysDict extends Model { private String delFlag; - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public BigDecimal getSort() { - return sort; - } - - public void setSort(BigDecimal sort) { - this.sort = sort; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - @Override protected Serializable pkVal() { return this.id; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysMenu.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysMenu.java index f6fbb2c4..cad52d75 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysMenu.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysMenu.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; import java.util.Date; @@ -17,6 +18,7 @@ import java.util.Date; * @author lengleng * @since 2017-11-08 */ +@Data @TableName("sys_menu") public class SysMenu extends Model { @@ -85,118 +87,6 @@ public class SysMenu extends Model { private String path; - public Integer getMenuId() { - return menuId; - } - - public void setMenuId(Integer menuId) { - this.menuId = menuId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPermission() { - return permission; - } - - public void setPermission(String permission) { - this.permission = permission; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public Integer getParentId() { - return parentId; - } - - public void setParentId(Integer parentId) { - this.parentId = parentId; - } - - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } - - public String getComponent() { - return component; - } - - public void setComponent(String component) { - this.component = component; - } - - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - @Override protected Serializable pkVal() { return this.menuId; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleDept.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleDept.java index a5bd982e..c7d12fb4 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleDept.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleDept.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; @@ -16,6 +17,7 @@ import java.io.Serializable; * @author lengleng * @since 2018-01-20 */ +@Data @TableName("sys_role_dept") public class SysRoleDept extends Model { @@ -35,30 +37,6 @@ public class SysRoleDept extends Model { private Integer deptId; - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getRoleId() { - return roleId; - } - - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - - public Integer getDeptId() { - return deptId; - } - - public void setDeptId(Integer deptId) { - this.deptId = deptId; - } - @Override protected Serializable pkVal() { return this.id; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleMenu.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleMenu.java index d54d4ea2..681b12af 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleMenu.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysRoleMenu.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; @@ -15,6 +16,7 @@ import java.io.Serializable; * @author lengleng * @since 2017-10-29 */ +@Data @TableName("sys_role_menu") public class SysRoleMenu extends Model { @@ -31,23 +33,6 @@ public class SysRoleMenu extends Model { @TableId(type = IdType.INPUT) private Integer menuId; - - public Integer getRoleId() { - return roleId; - } - - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - - public Integer getMenuId() { - return menuId; - } - - public void setMenuId(Integer menuId) { - this.menuId = menuId; - } - @Override protected Serializable pkVal() { return this.roleId; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUser.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUser.java index 7b838cbd..5e0aa302 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUser.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUser.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; import java.util.Date; @@ -17,6 +18,7 @@ import java.util.Date; * @author lengleng * @since 2017-10-29 */ +@Data @TableName("sys_user") public class SysUser extends Model { @@ -69,91 +71,11 @@ public class SysUser extends Model { private Integer deptId; - public Integer getUserId() { - return userId; - } - - public void setUserId(Integer userId) { - this.userId = userId; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getSalt() { - return salt; - } - - public void setSalt(String salt) { - this.salt = salt; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - @Override protected Serializable pkVal() { return this.userId; } - public String getIntroduction() { - return introduction; - } - - public void setIntroduction(String introduction) { - this.introduction = introduction; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public Integer getDeptId() { - return deptId; - } - - public void setDeptId(Integer deptId) { - this.deptId = deptId; - } - @Override public String toString() { return "SysUser{" + diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUserRole.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUserRole.java index c3fb2809..2037fb38 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUserRole.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/model/entity/SysUserRole.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; +import lombok.Data; import java.io.Serializable; @@ -15,6 +16,7 @@ import java.io.Serializable; * @author lengleng * @since 2017-10-29 */ +@Data @TableName("sys_user_role") public class SysUserRole extends Model { @@ -32,22 +34,6 @@ public class SysUserRole extends Model { private Integer roleId; - public Integer getUserId() { - return userId; - } - - public void setUserId(Integer userId) { - this.userId = userId; - } - - public Integer getRoleId() { - return roleId; - } - - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - @Override protected Serializable pkVal() { return this.userId; diff --git a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysMenuServiceImpl.java b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysMenuServiceImpl.java index 72c8eb04..5652aa73 100644 --- a/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysMenuServiceImpl.java +++ b/pig-modules/pig-upms-service/src/main/java/com/github/pig/admin/service/impl/SysMenuServiceImpl.java @@ -91,23 +91,14 @@ public class SysMenuServiceImpl extends ServiceImpl impl */ @Override public List findUserMenuTree(String roleName) { + // 获取符合条件得菜单 Set all = findMenuByRole(roleName); - List menuTreeList = new ArrayList<>(); - MenuTree node = null; - for (MenuVo menuVo : all) { + final List menuTreeList = new ArrayList<>(); + all.stream().forEach((menuVo -> { if (CommonConstant.MENU.equals(menuVo.getType())) { - node = new MenuTree(); - node.setId(menuVo.getMenuId()); - node.setParentId(menuVo.getParentId()); - node.setName(menuVo.getName()); - node.setUrl(menuVo.getUrl()); - node.setCode(menuVo.getPermission()); - node.setLabel(menuVo.getName()); - node.setComponent(menuVo.getComponent()); - node.setIcon(menuVo.getIcon()); - menuTreeList.add(node); + menuTreeList.add(new MenuTree(menuVo)); } - } + })); return TreeUtil.bulid(menuTreeList, -1); } } diff --git a/pig-modules/pig-upms-service/src/main/resources/mapper/SysMenuMapper.xml b/pig-modules/pig-upms-service/src/main/resources/mapper/SysMenuMapper.xml index 3a984334..2f79e2f4 100644 --- a/pig-modules/pig-upms-service/src/main/resources/mapper/SysMenuMapper.xml +++ b/pig-modules/pig-upms-service/src/main/resources/mapper/SysMenuMapper.xml @@ -28,6 +28,7 @@ +