update 补全 lombok 注解

This commit is contained in:
疯狂的狮子li
2021-12-01 10:14:25 +08:00
parent 5a18beaefa
commit 9dd3fca1c8
28 changed files with 53 additions and 286 deletions

View File

@@ -1,10 +1,15 @@
package com.ruoyi.common.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 用户状态
*
* @author ruoyi
*/
@Getter
@AllArgsConstructor
public enum UserStatus
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
@@ -12,19 +17,4 @@ public enum UserStatus
private final String code;
private final String info;
UserStatus(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -17,8 +17,6 @@ public class GlobalException extends RuntimeException
/**
* 错误明细,内部调试错误
*
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
*/
private String detailMessage;
@@ -45,6 +43,7 @@ public class GlobalException extends RuntimeException
return this;
}
@Override
public String getMessage()
{
return message;

View File

@@ -21,8 +21,6 @@ public final class ServiceException extends RuntimeException
/**
* 错误明细,内部调试错误
*
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
*/
private String detailMessage;

View File

@@ -1,10 +1,15 @@
package com.ruoyi.common.core.exception.base;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 基础异常
*
* @author ruoyi
*/
@Getter
@AllArgsConstructor
public class BaseException extends RuntimeException
{
private static final long serialVersionUID = 1L;
@@ -29,14 +34,6 @@ public class BaseException extends RuntimeException
*/
private String defaultMessage;
public BaseException(String module, String code, Object[] args, String defaultMessage)
{
this.module = module;
this.code = code;
this.args = args;
this.defaultMessage = defaultMessage;
}
public BaseException(String module, String code, Object[] args)
{
this(module, code, args, null);
@@ -57,23 +54,4 @@ public class BaseException extends RuntimeException
this(null, null, null, defaultMessage);
}
public String getModule()
{
return module;
}
public String getCode()
{
return code;
}
public Object[] getArgs()
{
return args;
}
public String getDefaultMessage()
{
return defaultMessage;
}
}

View File

@@ -3,6 +3,8 @@ package com.ruoyi.common.core.web.controller;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.WebDataBinder;
@@ -23,9 +25,9 @@ import com.ruoyi.common.core.web.page.TableSupport;
*
* @author ruoyi
*/
@Slf4j
public class BaseController
{
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 将前台传递过来的日期格式的字符串自动转化为Date类型

View File

@@ -5,12 +5,14 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* Entity基类
*
* @author ruoyi
*/
@Data
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
@@ -38,66 +40,6 @@ public class BaseEntity implements Serializable
/** 请求参数 */
private Map<String, Object> params;
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
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 String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public Map<String, Object> getParams()
{
if (params == null)
@@ -107,8 +49,4 @@ public class BaseEntity implements Serializable
return params;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}

View File

@@ -1,5 +1,7 @@
package com.ruoyi.common.core.web.domain;
import lombok.*;
import java.util.ArrayList;
import java.util.List;
@@ -8,6 +10,8 @@ import java.util.List;
*
* @author ruoyi
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TreeEntity extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -27,53 +31,4 @@ public class TreeEntity extends BaseEntity
/** 子部门 */
private List<?> children = new ArrayList<>();
public String getParentName()
{
return parentName;
}
public void setParentName(String parentName)
{
this.parentName = parentName;
}
public Long getParentId()
{
return parentId;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Integer getOrderNum()
{
return orderNum;
}
public void setOrderNum(Integer orderNum)
{
this.orderNum = orderNum;
}
public String getAncestors()
{
return ancestors;
}
public void setAncestors(String ancestors)
{
this.ancestors = ancestors;
}
public List<?> getChildren()
{
return children;
}
public void setChildren(List<?> children)
{
this.children = children;
}
}

View File

@@ -1,12 +1,14 @@
package com.ruoyi.common.core.web.page;
import com.ruoyi.common.core.utils.StringUtils;
import lombok.Data;
/**
* 分页数据
*
* @author ruoyi
*/
@Data
public class PageDomain
{
/** 当前记录起始索引 */
@@ -33,41 +35,6 @@ public class PageDomain
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
public Integer getPageNum()
{
return pageNum;
}
public void setPageNum(Integer pageNum)
{
this.pageNum = pageNum;
}
public Integer getPageSize()
{
return pageSize;
}
public void setPageSize(Integer pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
if (StringUtils.isNotEmpty(isAsc))
@@ -94,8 +61,4 @@ public class PageDomain
return reasonable;
}
public void setReasonable(Boolean reasonable)
{
this.reasonable = reasonable;
}
}

View File

@@ -1,5 +1,8 @@
package com.ruoyi.common.core.web.page;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@@ -8,6 +11,8 @@ import java.util.List;
*
* @author ruoyi
*/
@Data
@NoArgsConstructor
public class TableDataInfo implements Serializable
{
private static final long serialVersionUID = 1L;
@@ -24,13 +29,6 @@ public class TableDataInfo implements Serializable
/** 消息内容 */
private String msg;
/**
* 表格数据对象
*/
public TableDataInfo()
{
}
/**
* 分页
*
@@ -43,43 +41,4 @@ public class TableDataInfo implements Serializable
this.total = total;
}
public long getTotal()
{
return total;
}
public void setTotal(long total)
{
this.total = total;
}
public List<?> getRows()
{
return rows;
}
public void setRows(List<?> rows)
{
this.rows = rows;
}
public int getCode()
{
return code;
}
public void setCode(int code)
{
this.code = code;
}
public String getMsg()
{
return msg;
}
public void setMsg(String msg)
{
this.msg = msg;
}
}

View File

@@ -4,6 +4,8 @@ import java.util.Collection;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
@@ -30,12 +32,12 @@ import com.ruoyi.system.api.domain.SysOperLog;
*
* @author ruoyi
*/
@Slf4j
@Aspect
@Component
public class LogAspect
{
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
@Autowired
private AsyncLogService asyncLogService;