From 54012b9d270c81def068a7ed7a66d34b23d5fa3c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 28 Jul 2018 12:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20toString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++++++++---------- .../utils/{ => file}/FileUploadUtils.java | 2 +- .../common/utils/{ => file}/FileUtils.java | 5 ++-- .../project/common/CommonController.java | 2 +- .../config/controller/ConfigController.java | 2 +- .../user/controller/ProfileController.java | 2 +- .../templates/vm/java/domain.java.vm | 19 ++++++++------ 7 files changed, 31 insertions(+), 27 deletions(-) rename src/main/java/com/ruoyi/common/utils/{ => file}/FileUploadUtils.java (95%) rename src/main/java/com/ruoyi/common/utils/{ => file}/FileUtils.java (96%) diff --git a/README.md b/README.md index 8a36ccc6..2a108d8b 100644 --- a/README.md +++ b/README.md @@ -38,31 +38,31 @@ http://webapplayers.com/inspinia_admin-v2.7.1 - + - - + + - - + + - - + + - - + + - - + + - - + +
diff --git a/src/main/java/com/ruoyi/common/utils/FileUploadUtils.java b/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java similarity index 95% rename from src/main/java/com/ruoyi/common/utils/FileUploadUtils.java rename to src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index a74efa00..523873ba 100644 --- a/src/main/java/com/ruoyi/common/utils/FileUploadUtils.java +++ b/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.common.utils.file; import java.io.File; import java.io.IOException; diff --git a/src/main/java/com/ruoyi/common/utils/FileUtils.java b/src/main/java/com/ruoyi/common/utils/file/FileUtils.java similarity index 96% rename from src/main/java/com/ruoyi/common/utils/FileUtils.java rename to src/main/java/com/ruoyi/common/utils/file/FileUtils.java index e9e85987..ef4a225a 100644 --- a/src/main/java/com/ruoyi/common/utils/FileUtils.java +++ b/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.common.utils.file; import java.io.File; import java.io.FileInputStream; @@ -70,7 +70,8 @@ public class FileUtils } /** - * @Desc 删除文件 + * 删除文件 + * * @param filePath 文件 * @return */ diff --git a/src/main/java/com/ruoyi/project/common/CommonController.java b/src/main/java/com/ruoyi/project/common/CommonController.java index b0e1f3f4..932c27ce 100644 --- a/src/main/java/com/ruoyi/project/common/CommonController.java +++ b/src/main/java/com/ruoyi/project/common/CommonController.java @@ -9,7 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.util.ResourceUtils; import org.springframework.web.bind.annotation.RequestMapping; -import com.ruoyi.common.utils.FileUtils; +import com.ruoyi.common.utils.file.FileUtils; /** * 通用请求处理 diff --git a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java index b88d7140..c1dd2ac5 100644 --- a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java +++ b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java @@ -97,7 +97,7 @@ public class ConfigController extends BaseController @GetMapping("/edit/{configId}") public String edit(@PathVariable("configId") Long configId, ModelMap mmap) { - mmap.addAttribute("config", configService.selectConfigById(configId)); + mmap.put("config", configService.selectConfigById(configId)); return prefix + "/edit"; } diff --git a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java index c98df9a6..2aa0b781 100644 --- a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java +++ b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.utils.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.constant.BusinessType; import com.ruoyi.framework.web.controller.BaseController; diff --git a/src/main/resources/templates/vm/java/domain.java.vm b/src/main/resources/templates/vm/java/domain.java.vm index 3adac75d..b5cb541e 100644 --- a/src/main/resources/templates/vm/java/domain.java.vm +++ b/src/main/resources/templates/vm/java/domain.java.vm @@ -1,5 +1,7 @@ package ${package}.domain; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.framework.web.domain.BaseEntity; #foreach ($column in $columns) #if($column.attrType == 'Date') @@ -24,21 +26,22 @@ public class ${className} extends BaseEntity #end #foreach ($column in $columns) - /** - * 设置:${column.columnComment} - */ public void set${column.attrName}($column.attrType $column.attrname) { this.$column.attrname = $column.attrname; } - - /** - * 获取:${column.columnComment} - */ + public $column.attrType get${column.attrName}() { return $column.attrname; } - #end + + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $columns) + .append("${column.attrname}", get${column.attrName}()) +#end + .toString(); + } }