diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/config/MybatisPlusConfiguration.java b/blade-core-boot/src/main/java/org/springblade/core/boot/config/MybatisPlusConfiguration.java index d18b760..503ad95 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/config/MybatisPlusConfiguration.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/config/MybatisPlusConfiguration.java @@ -46,6 +46,8 @@ public class MybatisPlusConfiguration { /** * SQL执行效率插件 + * + * @return PerformanceInterceptor */ @Bean @Profile({AppConstant.DEV_CDOE, AppConstant.TEST_CODE}) diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java b/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java index 621c72b..e6a955d 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java @@ -42,6 +42,11 @@ public class BladeController { * ============================ BINDER ================================================= */ + /** + * initBinder + * + * @param binder binder + */ @InitBinder protected void initBinder(ServletRequestDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -58,6 +63,8 @@ public class BladeController { /** * 获取request + * + * @return HttpServletRequest */ public HttpServletRequest getRequest() { return this.request; @@ -66,7 +73,7 @@ public class BladeController { /** * 获取当前用户 * - * @return + * @return BladeUser */ public BladeUser getUser() { return SecureUtil.getUser(); @@ -77,7 +84,8 @@ public class BladeController { /** * 返回ApiResult * - * @param data + * @param data 数据 + * @param T 泛型标记 * @return R */ public R data(T data) { @@ -87,50 +95,52 @@ public class BladeController { /** * 返回ApiResult * - * @param data - * @param message + * @param data 数据 + * @param msg 消息 + * @param T 泛型标记 * @return R */ - public R data(T data, String message) { - return R.data(data, message); + public R data(T data, String msg) { + return R.data(data, msg); } /** * 返回ApiResult * - * @param data - * @param message - * @param code + * @param data 数据 + * @param msg 消息 + * @param code 状态码 + * @param T 泛型标记 * @return R */ - public R data(T data, String message, int code) { - return R.data(code, data, message); + public R data(T data, String msg, int code) { + return R.data(code, data, msg); } /** * 返回ApiResult * - * @param message + * @param msg 消息 * @return R */ - public R success(String message) { - return R.success(message); + public R success(String msg) { + return R.success(msg); } /** * 返回ApiResult * - * @param message + * @param msg 消息 * @return R */ - public R failure(String message) { - return R.failure(message); + public R failure(String msg) { + return R.failure(msg); } /** * 返回ApiResult * - * @param flag + * @param flag 是否成功 * @return R */ public R status(boolean flag) { @@ -143,8 +153,8 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param file - * @return + * @param file 文件 + * @return BladeFile */ public BladeFile getFile(MultipartFile file) { return BladeFileUtil.getFile(file); @@ -153,9 +163,9 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param file - * @param dir - * @return + * @param file 文件 + * @param dir 目录 + * @return BladeFile */ public BladeFile getFile(MultipartFile file, String dir) { return BladeFileUtil.getFile(file, dir); @@ -164,11 +174,11 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param file - * @param dir - * @param path - * @param virtualPath - * @return + * @param file 文件 + * @param dir 目录 + * @param path 路径 + * @param virtualPath 虚拟路径 + * @return BladeFile */ public BladeFile getFile(MultipartFile file, String dir, String path, String virtualPath) { return BladeFileUtil.getFile(file, dir, path, virtualPath); @@ -177,8 +187,8 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param files - * @return + * @param files 文件集合 + * @return BladeFile */ public List getFiles(List files) { return BladeFileUtil.getFiles(files); @@ -187,9 +197,9 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param files - * @param dir - * @return + * @param files 文件集合 + * @param dir 目录 + * @return BladeFile */ public List getFiles(List files, String dir) { return BladeFileUtil.getFiles(files, dir); @@ -198,10 +208,11 @@ public class BladeController { /** * 获取BladeFile封装类 * - * @param files - * @param path - * @param virtualPath - * @return + * @param files 文件集合 + * @param dir 目录 + * @param path 目录 + * @param virtualPath 虚拟路径 + * @return BladeFile */ public List getFiles(List files, String dir, String path, String virtualPath) { return BladeFileUtil.getFiles(files, dir, path, virtualPath); diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java index ae3fefb..7013b55 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java @@ -59,6 +59,9 @@ public class BladeFileProxyFactory implements IFileProxy { /** * 获取文件后缀 + * + * @param fileName 文件名 + * @return 文件后缀 */ public static String getFileExt(String fileName) { if (!fileName.contains(StringPool.DOT)) { @@ -71,8 +74,9 @@ public class BladeFileProxyFactory implements IFileProxy { /** * 获取文件保存地址 * - * @param saveDir - * @return + * @param dir 目录 + * @param saveDir 保存目录 + * @return 地址 */ public static String getFileDir(String dir, String saveDir) { StringBuilder newFileDir = new StringBuilder(); @@ -87,7 +91,6 @@ public class BladeFileProxyFactory implements IFileProxy { * 图片压缩 * * @param path 文件地址 - * @return */ @Override public void compress(String path) { diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileUtil.java b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileUtil.java index 01cbe43..3ff6fb0 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileUtil.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileUtil.java @@ -52,9 +52,8 @@ public class BladeFileUtil { /** * 获取文件后缀 * - * @param @param fileName - * @param @return 设定文件 - * @return String 返回类型 + * @param fileName 文件名 + * @return String 返回后缀 */ public static String getFileExt(String fileName) { return fileName.substring(fileName.lastIndexOf(StringPool.DOT)); @@ -63,7 +62,9 @@ public class BladeFileUtil { /** * 测试文件后缀 只让指定后缀的文件上传,像jsp,war,sh等危险的后缀禁止 * - * @return + * @param dir 目录 + * @param fileName 文件名 + * @return 返回成功与否 */ public static boolean testExt(String dir, String fileName) { String fileExt = getFileExt(fileName); @@ -171,8 +172,8 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param file - * @return + * @param file 文件 + * @return BladeFile */ public static BladeFile getFile(MultipartFile file) { return getFile(file, "image", null, null); @@ -181,9 +182,9 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param file - * @param dir - * @return + * @param file 文件 + * @param dir 目录 + * @return BladeFile */ public static BladeFile getFile(MultipartFile file, String dir) { return getFile(file, dir, null, null); @@ -192,11 +193,11 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param file - * @param dir - * @param path - * @param virtualPath - * @return + * @param file 文件 + * @param dir 目录 + * @param path 路径 + * @param virtualPath 虚拟路径 + * @return BladeFile */ public static BladeFile getFile(MultipartFile file, String dir, String path, String virtualPath) { return new BladeFile(file, dir, path, virtualPath); @@ -205,8 +206,8 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param files - * @return + * @param files 文件集合 + * @return BladeFile */ public static List getFiles(List files) { return getFiles(files, "image", null, null); @@ -215,9 +216,9 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param files - * @param dir - * @return + * @param files 文件集合 + * @param dir 目录 + * @return BladeFile */ public static List getFiles(List files, String dir) { return getFiles(files, dir, null, null); @@ -226,10 +227,10 @@ public class BladeFileUtil { /** * 获取BladeFile封装类 * - * @param files - * @param path - * @param virtualPath - * @return + * @param files 文件集合 + * @param path 路径 + * @param virtualPath 虚拟路径 + * @return BladeFile */ public static List getFiles(List files, String dir, String path, String virtualPath) { List list = new ArrayList<>(); diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/file/IFileProxy.java b/blade-core-boot/src/main/java/org/springblade/core/boot/file/IFileProxy.java index a79891a..e6d51d2 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/file/IFileProxy.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/file/IFileProxy.java @@ -27,8 +27,8 @@ public interface IFileProxy { /** * 返回路径[物理路径][虚拟路径] * - * @param file - * @param dir + * @param file 文件 + * @param dir 目录 * @return */ String[] path(File file, String dir); @@ -36,8 +36,8 @@ public interface IFileProxy { /** * 文件重命名策略 * - * @param file - * @param path + * @param file 文件 + * @param path 路径 * @return */ File rename(File file, String path); @@ -45,7 +45,7 @@ public interface IFileProxy { /** * 图片压缩 * - * @param path + * @param path 路径 */ void compress(String path); diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/resolver/TokenArgumentResolver.java b/blade-core-boot/src/main/java/org/springblade/core/boot/resolver/TokenArgumentResolver.java index de982af..212a84c 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/resolver/TokenArgumentResolver.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/resolver/TokenArgumentResolver.java @@ -33,7 +33,7 @@ import org.springframework.web.method.support.ModelAndViewContainer; public class TokenArgumentResolver implements HandlerMethodArgumentResolver { /** - * 1. 入参筛选 + * 入参筛选 * * @param methodParameter 参数集合 * @return 格式化后的参数 @@ -44,12 +44,13 @@ public class TokenArgumentResolver implements HandlerMethodArgumentResolver { } /** + * 出参设置 + * * @param methodParameter 入参集合 * @param modelAndViewContainer model 和 view * @param nativeWebRequest web相关 * @param webDataBinderFactory 入参解析 * @return 包装对象 - * @throws Exception exception */ @Override public Object resolveArgument(MethodParameter methodParameter, diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/annotation/PreAuth.java b/blade-core-secure/src/main/java/org/springblade/core/secure/annotation/PreAuth.java index 71df410..76fcaab 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/annotation/PreAuth.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/annotation/PreAuth.java @@ -21,9 +21,6 @@ import java.lang.annotation.*; * 权限注解 用于检查权限 规定访问权限 * * @author smallchill - * @example @PreAuth("#userVO.id<10") - * @example @PreAuth("hasRole(#test, #test1)") - * @example @PreAuth("hasPermission(#test) and @PreAuth.hasPermission(#test)") */ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/registry/SecureRegistry.java b/blade-core-secure/src/main/java/org/springblade/core/secure/registry/SecureRegistry.java index b722cb7..fdf5801 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/registry/SecureRegistry.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/registry/SecureRegistry.java @@ -48,6 +48,9 @@ public class SecureRegistry { /** * 设置放行api + * + * @param patterns api配置 + * @return SecureRegistry */ public SecureRegistry excludePathPatterns(String... patterns) { return excludePathPatterns(Arrays.asList(patterns)); @@ -55,6 +58,9 @@ public class SecureRegistry { /** * 设置放行api + * + * @param patterns api配置 + * @return SecureRegistry */ public SecureRegistry excludePathPatterns(List patterns) { this.excludePatterns.addAll(patterns); diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java index 17b143e..d306c55 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java @@ -53,7 +53,7 @@ public class SecureUtil { /** * 获取用户信息 * - * @return + * @return BladeUser */ public static BladeUser getUser() { HttpServletRequest request = WebUtil.getRequest(); @@ -72,7 +72,8 @@ public class SecureUtil { /** * 获取用户信息 * - * @return + * @param request request + * @return BladeUser */ public static BladeUser getUser(HttpServletRequest request) { Claims claims = getClaims(request); @@ -95,7 +96,7 @@ public class SecureUtil { /** * 获取用户id * - * @return + * @return userId */ public static Integer getUserId() { return (null == getUser()) ? -1 : getUser().getUserId(); @@ -104,7 +105,8 @@ public class SecureUtil { /** * 获取用户id * - * @return + * @param request request + * @return userId */ public static Integer getUserId(HttpServletRequest request) { return (null == getUser(request)) ? -1 : getUser().getUserId(); @@ -113,7 +115,7 @@ public class SecureUtil { /** * 获取用户账号 * - * @return + * @return userAccount */ public static String getUserAccount() { return (null == getUser()) ? StringPool.EMPTY : getUser().getAccount(); @@ -122,7 +124,8 @@ public class SecureUtil { /** * 获取用户账号 * - * @return + * @param request request + * @return userAccount */ public static String getUserAccount(HttpServletRequest request) { return (null == getUser(request)) ? StringPool.EMPTY : getUser().getAccount(); @@ -131,7 +134,8 @@ public class SecureUtil { /** * 获取Claims * - * @return + * @param request request + * @return Claims */ public static Claims getClaims(HttpServletRequest request) { String auth = request.getHeader(SecureUtil.HEADER); @@ -148,7 +152,7 @@ public class SecureUtil { /** * 获取请求头 * - * @return + * @return header */ public static String getHeader() { return getHeader(WebUtil.getRequest()); @@ -157,8 +161,8 @@ public class SecureUtil { /** * 获取请求头 * - * @param request - * @return + * @param request request + * @return header */ public static String getHeader(HttpServletRequest request) { return request.getHeader(HEADER); @@ -167,8 +171,8 @@ public class SecureUtil { /** * 解析jsonWebToken * - * @param jsonWebToken - * @return + * @param jsonWebToken jsonWebToken + * @return Claims */ public static Claims parseJWT(String jsonWebToken) { try { @@ -184,11 +188,11 @@ public class SecureUtil { /** * 创建jwt * - * @param user 用户 + * @param user user * @param audience audience * @param issuer issuer * @param isExpire isExpire - * @return + * @return jwt */ public static String createJWT(Map user, String audience, String issuer, boolean isExpire) { SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; @@ -223,7 +227,7 @@ public class SecureUtil { /** * 获取过期时间(次日凌晨3点) * - * @return + * @return expire */ public static long getExpire() { Calendar cal = Calendar.getInstance(); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/api/IResultCode.java b/blade-core-tool/src/main/java/org/springblade/core/tool/api/IResultCode.java index 430e888..77b969a 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/api/IResultCode.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/api/IResultCode.java @@ -27,14 +27,14 @@ public interface IResultCode extends Serializable { /** * 消息 * - * @return + * @return String */ String getMessage(); /** * 状态码 * - * @return + * @return int */ int getCode(); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java b/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java index f1690a4..c41a985 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java @@ -98,6 +98,8 @@ public class R implements Serializable { * 返回R * * @param data 数据 + * @param T 泛型标记 + * @return R */ public static R data(T data) { return data(data, BladeConstant.DEFAULT_SUCCESS_MESSAGE); @@ -108,6 +110,8 @@ public class R implements Serializable { * * @param data 数据 * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R data(T data, String msg) { return data(HttpServletResponse.SC_OK, data, msg); @@ -119,6 +123,8 @@ public class R implements Serializable { * @param code 状态码 * @param data 数据 * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R data(int code, T data, String msg) { return new R<>(code, data, data == null ? BladeConstant.DEFAULT_NULL_MESSAGE : msg); @@ -128,6 +134,8 @@ public class R implements Serializable { * 返回R * * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R success(String msg) { return new R<>(ResultCode.SUCCESS, msg); @@ -137,6 +145,8 @@ public class R implements Serializable { * 返回R * * @param resultCode 业务代码 + * @param T 泛型标记 + * @return R */ public static R success(IResultCode resultCode) { return new R<>(resultCode); @@ -146,6 +156,9 @@ public class R implements Serializable { * 返回R * * @param resultCode 业务代码 + * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R success(IResultCode resultCode, String msg) { return new R<>(resultCode, msg); @@ -155,6 +168,8 @@ public class R implements Serializable { * 返回R * * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R failure(String msg) { return new R<>(ResultCode.FAILURE, msg); @@ -166,6 +181,8 @@ public class R implements Serializable { * * @param code 状态码 * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R failure(int code, String msg) { return new R<>(code, null, msg); @@ -175,6 +192,8 @@ public class R implements Serializable { * 返回R * * @param resultCode 业务代码 + * @param T 泛型标记 + * @return R */ public static R failure(IResultCode resultCode) { return new R<>(resultCode); @@ -184,6 +203,9 @@ public class R implements Serializable { * 返回R * * @param resultCode 业务代码 + * @param msg 消息 + * @param T 泛型标记 + * @return R */ public static R failure(IResultCode resultCode, String msg) { return new R<>(resultCode, msg); @@ -193,6 +215,7 @@ public class R implements Serializable { * 返回R * * @param flag 成功状态 + * @return R */ public static R status(boolean flag) { return flag ? success(BladeConstant.DEFAULT_SUCCESS_MESSAGE) : failure(BladeConstant.DEFAULT_FAILURE_MESSAGE); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java index e75fa27..1eae3e6 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java @@ -60,6 +60,8 @@ public class MessageConfiguration implements WebMvcConfigurer { /** * 防XSS注入 + * + * @return FilterRegistrationBean */ @Bean public FilterRegistrationBean xssFilterRegistration() { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java index 1e09e7e..d68c2fa 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java @@ -34,6 +34,8 @@ public class ToolConfiguration implements WebMvcConfigurer { /** * Spring上下文缓存 + * + * @return SpringUtil */ @Bean public SpringUtil springUtils() { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/jackson/JsonUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/jackson/JsonUtil.java index 8215686..8e260f5 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/jackson/JsonUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/jackson/JsonUtil.java @@ -46,6 +46,7 @@ public class JsonUtil { * 将对象序列化成json字符串 * * @param value javaBean + * @param T 泛型标记 * @return jsonString json字符串 */ public static String toJson(T value) { @@ -171,11 +172,10 @@ public class JsonUtil { /** * 将json反序列化成List对象 - * - * @param content content + * @param content content * @param valueTypeRef class - * @param T 泛型标记 - * @return + * @param T 泛型标记 + * @return List */ public static List parseArray(String content, Class valueTypeRef) { try { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeManager.java b/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeManager.java index bba8e75..1b99b6a 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeManager.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeManager.java @@ -57,7 +57,7 @@ public class ForestNodeManager { /** * 增加父节点ID * - * @param parentId + * @param parentId 父节点ID */ public void addParentId(Integer parentId) { parentIds.add(parentId); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeMerger.java b/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeMerger.java index 4e35d64..61856b0 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeMerger.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/node/ForestNodeMerger.java @@ -15,7 +15,6 @@ */ package org.springblade.core.tool.node; -import java.util.ArrayList; import java.util.List; /** @@ -30,10 +29,10 @@ public class ForestNodeMerger { * 时间复杂度为O(n^2) * * @param items 节点域 + * @param T 泛型标记 * @return 多棵树的根节点集合 */ public static List merge(List items) { - List parentIds = new ArrayList<>(); ForestNodeManager forestNodeManager = new ForestNodeManager<>(items); items.forEach(forestNode -> { if (forestNode.getParentId() != 0) { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/node/INode.java b/blade-core-tool/src/main/java/org/springblade/core/tool/node/INode.java index 29aa2d9..d7d1762 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/node/INode.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/node/INode.java @@ -26,20 +26,23 @@ public interface INode { /** * 主键 - * @return + * + * @return Integer */ - Integer getId(); + Integer getId(); /** * 父主键 - * @return + * + * @return Integer */ Integer getParentId(); /** * 子孙节点 - * @return + * + * @return List */ - List getChildren(); + List getChildren(); } diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/support/BaseBeanCopier.java b/blade-core-tool/src/main/java/org/springblade/core/tool/support/BaseBeanCopier.java index a8d590c..bceb175 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/support/BaseBeanCopier.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/support/BaseBeanCopier.java @@ -46,9 +46,9 @@ public abstract class BaseBeanCopier { interface BeanCopierKey { /** * 实例化 - * @param source - * @param target - * @param useConverter + * @param source 源 + * @param target 目标 + * @param useConverter 是否使用转换 * @return */ Object newInstance(String source, String target, boolean useConverter); @@ -73,9 +73,9 @@ public abstract class BaseBeanCopier { /** * 拷贝 - * @param from - * @param to - * @param converter + * @param from 源 + * @param to 目标 + * @param converter 转换器 */ abstract public void copy(Object from, Object to, Converter converter); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/support/Try.java b/blade-core-tool/src/main/java/org/springblade/core/tool/support/Try.java index 7666122..895c63d 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/support/Try.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/support/Try.java @@ -28,9 +28,9 @@ public class Try { public interface UncheckedFunction { /** * 调用 - * @param t - * @return - * @throws Exception + * @param t t + * @return R + * @throws Exception Exception */ R apply(T t) throws Exception; } diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/support/xss/XssHttpServletRequestWrapper.java b/blade-core-tool/src/main/java/org/springblade/core/tool/support/xss/XssHttpServletRequestWrapper.java index 933c46d..83e8498 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/support/xss/XssHttpServletRequestWrapper.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/support/xss/XssHttpServletRequestWrapper.java @@ -165,6 +165,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { /** * 获取最原始的request + * @return HttpServletRequest */ public HttpServletRequest getOrgRequest() { return orgRequest; @@ -172,6 +173,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { /** * 获取最原始的request + * @param request request + * @return HttpServletRequest */ public static HttpServletRequest getOrgRequest(HttpServletRequest request) { if (request instanceof XssHttpServletRequestWrapper) { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CollectionUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CollectionUtil.java index d1a1db3..c813ddb 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CollectionUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CollectionUtil.java @@ -62,6 +62,7 @@ public class CollectionUtil extends org.springframework.util.CollectionUtils { * i.e. {@code null} or of zero length. * * @param coll the Collection to check + * @return boolean */ public static boolean isNotEmpty(@Nullable Collection coll) { return !CollectionUtils.isEmpty(coll); @@ -72,6 +73,7 @@ public class CollectionUtil extends org.springframework.util.CollectionUtils { * i.e. {@code null} or of zero length. * * @param map the Map to check + * @return boolean */ public static boolean isNotEmpty(@Nullable Map map) { return !CollectionUtils.isEmpty(map); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/DigestUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/DigestUtil.java index 6012087..5baf4c8 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/DigestUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/DigestUtil.java @@ -108,8 +108,8 @@ public class DigestUtil extends org.springframework.util.DigestUtils { /** * 自定义加密 先MD5再SHA1 * - * @param data - * @return + * @param data 数据 + * @return String */ public static String encrypt(String data) { return sha1(md5Hex(data)); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/Func.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/Func.java index a571392..421a411 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/Func.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/Func.java @@ -286,7 +286,7 @@ public class Func { * 对象组中是否存在 Empty Object * * @param os 对象组 - * @return + * @return boolean */ public static boolean hasEmpty(Object... os) { for (Object o : os) { @@ -300,8 +300,8 @@ public class Func { /** * 对象组中是否全是 Empty Object * - * @param os - * @return + * @param os 对象组 + * @return boolean */ public static boolean allEmpty(Object... os) { for (Object o : os) { @@ -315,14 +315,13 @@ public class Func { /** * 比较两个对象是否相等。
* 相同的条件有两个,满足其一即可:
- * 1. obj1 == null && obj2 == null; 2. obj1.equals(obj2) * * @param obj1 对象1 * @param obj2 对象2 * @return 是否相等 */ public static boolean equals(Object obj1, Object obj2) { - return (obj1 != null) ? (obj1.equals(obj2)) : (obj2 == null); + return Objects.equals(obj1, obj2); } /** @@ -376,21 +375,21 @@ public class Func { } /** - * 强转->string,并去掉多余空格 + * 强转string,并去掉多余空格 * - * @param str - * @return + * @param str 字符串 + * @return String */ public static String toStr(Object str) { return toStr(str, ""); } /** - * 强转->string,并去掉多余空格 + * 强转string,并去掉多余空格 * - * @param str - * @param defaultValue - * @return + * @param str 字符串 + * @param defaultValue 默认值 + * @return String */ public static String toStr(Object str, String defaultValue) { if (null == str) { @@ -676,7 +675,7 @@ public class Func { * 转换为String数组
* * @param split 分隔符 - * @param split 被转换的值 + * @param str 被转换的值 * @return 结果 */ public static String[] toStrArray(String split, String str) { @@ -843,8 +842,8 @@ public class Func { /** * 自定义加密 先MD5再SHA1 * - * @param data - * @return + * @param data 字符串 + * @return String */ public static String encrypt(String data) { return DigestUtil.encrypt(data); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ImageUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ImageUtil.java index 6856c81..fafbf13 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ImageUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ImageUtil.java @@ -52,9 +52,10 @@ public final class ImageUtil { /** * 转换输入流到byte * - * @param src - * @return - * @throws IOException + * @param src 源 + * @param type 类型 + * @return byte[] + * @throws IOException 异常 */ public static byte[] toByteArray(BufferedImage src, String type) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); @@ -66,7 +67,7 @@ public final class ImageUtil { * 获取图像内容 * * @param srcImageFile 文件路径 - * @return + * @return BufferedImage */ public static BufferedImage readImage(String srcImageFile) { try { @@ -81,7 +82,7 @@ public final class ImageUtil { * 获取图像内容 * * @param srcImageFile 文件 - * @return + * @return BufferedImage */ public static BufferedImage readImage(File srcImageFile) { try { @@ -96,7 +97,7 @@ public final class ImageUtil { * 获取图像内容 * * @param srcInputStream 输入流 - * @return + * @return BufferedImage */ public static BufferedImage readImage(InputStream srcInputStream) { try { @@ -111,7 +112,7 @@ public final class ImageUtil { * 获取图像内容 * * @param url URL地址 - * @return + * @return BufferedImage */ public static BufferedImage readImage(URL url) { try { @@ -128,6 +129,7 @@ public final class ImageUtil { * * @param src 源图像 * @param output 输出流 + * @param type 类型 * @param scale 缩放比例 * @param flag 缩放选择:true 放大; false 缩小; */ @@ -166,6 +168,7 @@ public final class ImageUtil { * * @param src 源图像 * @param output 输出流 + * @param type 类型 * @param height 缩放后的高度 * @param width 缩放后的宽度 * @param bb 比例不对时是否需要补白:true为补白; false为不补白; @@ -213,6 +216,7 @@ public final class ImageUtil { * * @param src 源图像 * @param output 切片后的图像地址 + * @param type 类型 * @param x 目标切片起点坐标X * @param y 目标切片起点坐标Y * @param width 目标切片宽度 @@ -248,6 +252,7 @@ public final class ImageUtil { * * @param src 源图像地址 * @param mos 切片目标文件夹 + * @param type 类型 * @param prows 目标切片行数。默认2,必须是范围 [1, 20] 之内 * @param pcols 目标切片列数。默认2,必须是范围 [1, 20] 之内 */ @@ -294,6 +299,7 @@ public final class ImageUtil { * * @param src 源图像地址 * @param mos 切片目标文件夹 + * @param type 类型 * @param pdestWidth 目标切片宽度。默认200 * @param pdestHeight 目标切片高度。默认150 */ @@ -336,7 +342,7 @@ public final class ImageUtil { } /** - * 图像类型转换:GIF->JPG、GIF->PNG、PNG->JPG、PNG->GIF(X)、BMP->PNG + * 图像类型转换:GIF-JPG、GIF-PNG、PNG-JPG、PNG-GIF(X)、BMP-PNG * * @param src 源图像地址 * @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 @@ -358,6 +364,7 @@ public final class ImageUtil { * * @param src 源图像地址 * @param output 目标图像地址 + * @param type 类型 */ public final static void gray(BufferedImage src, OutputStream output, String type) { try { @@ -378,6 +385,7 @@ public final class ImageUtil { * * @param src 源图像 * @param output 输出流 + * @param type 类型 * @param text 水印文字 * @param font 水印的字体 * @param color 水印的字体颜色 @@ -416,6 +424,7 @@ public final class ImageUtil { * * @param src 源图像 * @param output 输出流 + * @param type 类型 * @param stamp 水印图片 * @param position 水印位置 {@link ImagePosition} * @param x 修正值 @@ -451,8 +460,8 @@ public final class ImageUtil { /** * 计算text的长度(一个中文算两个字符) * - * @param text - * @return + * @param text text + * @return int */ public final static int calcTextWidth(String text) { int length = 0; @@ -466,6 +475,12 @@ public final class ImageUtil { return length / 2; } + /** + * 默认字符串 + * @param str 字符串 + * @param defaultStr 默认值 + * @return + */ public static String defaultString(String str, String defaultStr) { return ((str == null) ? defaultStr : str); } diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/NumberUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/NumberUtil.java index e7bb5d5..88167b3 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/NumberUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/NumberUtil.java @@ -124,7 +124,7 @@ public class NumberUtil extends org.springframework.util.NumberUtils { /** *

Convert a String to a Double * - * @param value + * @param value value * @return double value */ public static Double toDouble(String value) { @@ -134,7 +134,7 @@ public class NumberUtil extends org.springframework.util.NumberUtils { /** *

Convert a String to a Double * - * @param value + * @param value value * @param defaultValue 默认值 * @return double value */ @@ -148,7 +148,7 @@ public class NumberUtil extends org.springframework.util.NumberUtils { /** *

Convert a String to a Double * - * @param value + * @param value value * @return double value */ public static Float toFloat(String value) { @@ -158,7 +158,7 @@ public class NumberUtil extends org.springframework.util.NumberUtils { /** *

Convert a String to a Double * - * @param value + * @param value value * @param defaultValue 默认值 * @return double value */ diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ObjectUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ObjectUtil.java index d003164..37c3760 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ObjectUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ObjectUtil.java @@ -26,6 +26,8 @@ public class ObjectUtil extends org.springframework.util.ObjectUtils { /** * 判断元素不为空 + * @param obj object + * @return boolean */ public static boolean isNotEmpty(@Nullable Object obj) { return !ObjectUtil.isEmpty(obj); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/OkHttpUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/OkHttpUtil.java index a39059a..fad9b5b 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/OkHttpUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/OkHttpUtil.java @@ -36,7 +36,7 @@ public class OkHttpUtil { * * @param url 请求的url * @param queries 请求的参数,在浏览器?后面的数据,没有可以传null - * @return + * @return String */ public static String get(String url, Map queries) { return get(url, null, queries); @@ -48,7 +48,7 @@ public class OkHttpUtil { * @param url 请求的url * @param header 请求头 * @param queries 请求的参数,在浏览器?后面的数据,没有可以传null - * @return + * @return String */ public static String get(String url, Map header, Map queries) { StringBuffer sb = new StringBuffer(url); @@ -72,7 +72,7 @@ public class OkHttpUtil { * * @param url 请求的url * @param params post form 提交的参数 - * @return + * @return String */ public static String post(String url, Map params) { return post(url, null, params); @@ -84,7 +84,7 @@ public class OkHttpUtil { * @param url 请求的url * @param header 请求头 * @param params post form 提交的参数 - * @return + * @return String */ public static String post(String url, Map header, Map params) { FormBody.Builder formBuilder = new FormBody.Builder().add("clientId", "blade"); @@ -106,9 +106,9 @@ public class OkHttpUtil { /** * POST请求发送JSON数据 * - * @param url - * @param json - * @return + * @param url 请求的url + * @param json 请求的json串 + * @return String */ public static String postJson(String url, String json) { return postJson(url, null, json); @@ -116,10 +116,10 @@ public class OkHttpUtil { /** * POST请求发送JSON数据 - * @param url - * @param header - * @param json - * @return + * @param url 请求的url + * @param header 请求头 + * @param json 请求的json串 + * @return String */ public static String postJson(String url, Map header, String json) { return postContent(url, header, json, JSON); @@ -128,9 +128,9 @@ public class OkHttpUtil { /** * POST请求发送xml数据 * - * @param url - * @param xml - * @return + * @param url 请求的url + * @param xml 请求的xml串 + * @return String */ public static String postXml(String url, String xml) { return postXml(url, null, xml); @@ -139,10 +139,10 @@ public class OkHttpUtil { /** * POST请求发送xml数据 * - * @param url - * @param header - * @param xml - * @return + * @param url 请求的url + * @param header 请求头 + * @param xml 请求的xml串 + * @return String */ public static String postXml(String url, Map header, String xml) { return postContent(url, header, xml, XML); @@ -151,11 +151,11 @@ public class OkHttpUtil { /** * 发送POST请求 * - * @param url - * @param header - * @param content - * @param mediaType - * @return + * @param url 请求的url + * @param header 请求头 + * @param content 请求内容 + * @param mediaType 请求类型 + * @return String */ public static String postContent(String url, Map header, String content, MediaType mediaType) { RequestBody requestBody = RequestBody.create(mediaType, content); @@ -171,8 +171,8 @@ public class OkHttpUtil { /** * 获取body * - * @param request - * @return + * @param request request + * @return String */ private static String getBody(Request request) { String responseBody = ""; diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ProtostuffUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ProtostuffUtil.java index a2c07ff..c7e8c74 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ProtostuffUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ProtostuffUtil.java @@ -43,9 +43,9 @@ public class ProtostuffUtil { /** * 序列化方法,把指定对象序列化成字节数组 * - * @param obj - * @param - * @return + * @param obj obj + * @param T + * @return byte[] */ @SuppressWarnings("unchecked") public static byte[] serialize(T obj) { @@ -63,10 +63,10 @@ public class ProtostuffUtil { /** * 反序列化方法,将字节数组反序列化成指定Class类型 * - * @param data - * @param clazz - * @param - * @return + * @param data data + * @param clazz clazz + * @param T + * @return T */ public static T deserialize(byte[] data, Class clazz) { Schema schema = getSchema(clazz); @@ -75,6 +75,12 @@ public class ProtostuffUtil { return obj; } + /** + * 获取Schema + * @param clazz clazz + * @param T + * @return T + */ @SuppressWarnings("unchecked") private static Schema getSchema(Class clazz) { Schema schema = (Schema) schemaCache.get(clazz); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/StringUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/StringUtil.java index 59e6920..73640a7 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/StringUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/StringUtil.java @@ -1086,7 +1086,6 @@ public class StringUtil extends org.springframework.util.StringUtils { /** * 返回字符串 searchStr 在字符串 str 中第 ordinal 次出现的位置。
- * 如果 str=null 或 searchStr=null 或 ordinal<=0 则返回-1
* 此方法来自:Apache-Commons-Lang *

* 栗子(*代表任意字符): @@ -1251,6 +1250,7 @@ public class StringUtil extends org.springframework.util.StringUtils { /** * 创建StringBuilder对象 * + * @param sb 初始StringBuilder * @param strs 初始字符串列表 * @return StringBuilder对象 */ @@ -1341,8 +1341,8 @@ public class StringUtil extends org.springframework.util.StringUtils { /** * 下划线转驼峰 * - * @param para - * @return + * @param para 字符串 + * @return String */ public static String underlineToHump(String para) { StringBuilder result = new StringBuilder(); @@ -1361,8 +1361,8 @@ public class StringUtil extends org.springframework.util.StringUtils { /** * 驼峰转下划线 * - * @param para - * @return + * @param para 字符串 + * @return String */ public static String humpToUnderline(String para) { StringBuilder sb = new StringBuilder(para); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/UrlUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/UrlUtil.java index bfcaabb..a3543bd 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/UrlUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/UrlUtil.java @@ -51,8 +51,8 @@ public class UrlUtil extends org.springframework.web.util.UriUtils { /** * 获取url路径 * - * @param uriStr - * @return + * @param uriStr 路径 + * @return url路径 */ public static String getPath(String uriStr) { URI uri; diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/WebUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/WebUtil.java index bae516f..002f068 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/WebUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/WebUtil.java @@ -43,7 +43,7 @@ import java.util.Enumeration; public class WebUtil extends org.springframework.web.util.WebUtils { public static final String USER_AGENT_HEADER = "user-agent"; - + public static final String UN_KNOWN = "unknown"; /** @@ -191,8 +191,8 @@ public class WebUtil extends org.springframework.web.util.WebUtils { /*** * 获取 request 中 json 字符串的内容 * - * @param request - * @throws IOException + * @param request request + * @return 字符串内容 */ public static String getRequestParamString(HttpServletRequest request) { try { @@ -205,9 +205,9 @@ public class WebUtil extends org.springframework.web.util.WebUtils { /** * 获取 request 请求内容 * - * @param request - * @return - * @throws IOException + * @param request request + * @return String + * @throws IOException IOException */ public static String getRequestStr(HttpServletRequest request) throws IOException { String queryString = request.getQueryString(); @@ -220,9 +220,9 @@ public class WebUtil extends org.springframework.web.util.WebUtils { /** * 获取 request 请求的 byte[] 数组 * - * @param request - * @return - * @throws IOException + * @param request request + * @return byte[] + * @throws IOException IOException */ public static byte[] getRequestBytes(HttpServletRequest request) throws IOException { int contentLength = request.getContentLength(); @@ -244,10 +244,10 @@ public class WebUtil extends org.springframework.web.util.WebUtils { /** * 获取 request 请求内容 * - * @param request - * @param buffer - * @return - * @throws IOException + * @param request request + * @param buffer buffer + * @return String + * @throws IOException IOException */ public static String getRequestStr(HttpServletRequest request, byte[] buffer) throws IOException { String charEncoding = request.getCharacterEncoding();