删代码。舒服!!

This commit is contained in:
寻欢·李 2018-03-21 16:28:07 +08:00
parent e9b1fa01eb
commit 3c299c91aa
18 changed files with 59 additions and 811 deletions

View File

@ -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() {

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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() {

View File

@ -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{" +

View File

@ -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<SysRole> 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<SysRole> getRoleList() {
return roleList;
}
public void setRoleList(List<SysRole> 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;
}
}

View File

@ -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

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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<SysDict> {
@ -69,86 +71,6 @@ public class SysDict extends Model<SysDict> {
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;

View File

@ -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<SysMenu> {
@ -85,118 +87,6 @@ public class SysMenu extends Model<SysMenu> {
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;

View File

@ -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<SysRoleDept> {
@ -35,30 +37,6 @@ public class SysRoleDept extends Model<SysRoleDept> {
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;

View File

@ -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<SysRoleMenu> {
@ -31,23 +33,6 @@ public class SysRoleMenu extends Model<SysRoleMenu> {
@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;

View File

@ -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<SysUser> {
@ -69,91 +71,11 @@ public class SysUser extends Model<SysUser> {
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{" +

View File

@ -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<SysUserRole> {
@ -32,22 +34,6 @@ public class SysUserRole extends Model<SysUserRole> {
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;

View File

@ -91,23 +91,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
*/
@Override
public List<MenuTree> findUserMenuTree(String roleName) {
// 获取符合条件得菜单
Set<MenuVo> all = findMenuByRole(roleName);
List<MenuTree> menuTreeList = new ArrayList<>();
MenuTree node = null;
for (MenuVo menuVo : all) {
final List<MenuTree> 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);
}
}

View File

@ -28,6 +28,7 @@
<result column="method" property="method" />
<result column="parent_id" property="parentId" />
<result column="icon" property="icon" />
<result column="path" property="path" />
<result column="component" property="component" />
<result column="sort" property="sort" />
<result column="type" property="type" />