瀏覽代碼

代码生成路径调整

RuoYi 6 年之前
父節點
當前提交
b5e8432e2f
共有 32 個文件被更改,包括 45 次插入47 次删除
  1. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobController.java
  2. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobLogController.java
  3. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  4. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  5. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
  6. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysCaptchaController.java
  7. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  8. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  9. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  10. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  11. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
  12. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  13. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  14. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
  15. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  16. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
  17. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  18. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  19. 1 1
      ruoyi-admin/src/main/resources/application.yml
  20. 5 1
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
  21. 1 2
      ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java
  22. 13 18
      ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
  23. 0 0
      ruoyi-generator/src/main/resources/vm/html/add.html.vm
  24. 0 0
      ruoyi-generator/src/main/resources/vm/html/edit.html.vm
  25. 0 0
      ruoyi-generator/src/main/resources/vm/html/list.html.vm
  26. 5 5
      ruoyi-generator/src/main/resources/vm/java/Controller.java.vm
  27. 0 0
      ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm
  28. 0 0
      ruoyi-generator/src/main/resources/vm/java/Service.java.vm
  29. 0 0
      ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm
  30. 1 1
      ruoyi-generator/src/main/resources/vm/java/domain.java.vm
  31. 0 0
      ruoyi-generator/src/main/resources/vm/sql/sql.vm
  32. 0 0
      ruoyi-generator/src/main/resources/vm/xml/Mapper.xml.vm

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/JobController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/monitor/job")
-public class JobController extends BaseController
+public class SysJobController extends BaseController
 {
     private String prefix = "monitor/job";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/JobLogController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobLogController.java

@@ -24,7 +24,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/monitor/jobLog")
-public class JobLogController extends BaseController
+public class SysJobLogController extends BaseController
 {
     private String prefix = "monitor/job";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/LogininforController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java

@@ -24,7 +24,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/monitor/logininfor")
-public class LogininforController extends BaseController
+public class SysLogininforController extends BaseController
 {
     private String prefix = "monitor/logininfor";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/OperlogController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java

@@ -26,7 +26,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/monitor/operlog")
-public class OperlogController extends BaseController
+public class SysOperlogController extends BaseController
 {
     private String prefix = "monitor/operlog";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/UserOnlineController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java

@@ -28,7 +28,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/monitor/online")
-public class UserOnlineController extends BaseController
+public class SysUserOnlineController extends BaseController
 {
     private String prefix = "monitor/online";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/CaptchaController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysCaptchaController.java

@@ -23,7 +23,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/captcha")
-public class CaptchaController extends BaseController
+public class SysCaptchaController extends BaseController
 {
     @Resource(name = "captchaProducer")
     private Producer captchaProducer;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ConfigController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/config")
-public class ConfigController extends BaseController
+public class SysConfigController extends BaseController
 {
     private String prefix = "system/config";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DeptController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@@ -28,7 +28,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/dept")
-public class DeptController extends BaseController
+public class SysDeptController extends BaseController
 {
     private String prefix = "system/dept";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DictDataController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/dict/data")
-public class DictDataController extends BaseController
+public class SysDictDataController extends BaseController
 {
     private String prefix = "system/dict/data";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DictTypeController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/dict")
-public class DictTypeController extends BaseController
+public class SysDictTypeController extends BaseController
 {
     private String prefix = "system/dict/type";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/IndexController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java

@@ -17,7 +17,7 @@ import com.ruoyi.web.core.base.BaseController;
  * @author ruoyi
  */
 @Controller
-public class IndexController extends BaseController
+public class SysIndexController extends BaseController
 {
     @Autowired
     private ISysMenuService menuService;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/LoginController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -21,7 +21,7 @@ import com.ruoyi.web.core.base.BaseController;
  * @author ruoyi
  */
 @Controller
-public class LoginController extends BaseController
+public class SysLoginController extends BaseController
 {
     @GetMapping("/login")
     public String login(HttpServletRequest request, HttpServletResponse response)

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/MenuController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/menu")
-public class MenuController extends BaseController
+public class SysMenuController extends BaseController
 {
     private String prefix = "system/menu";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NoticeController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@@ -26,7 +26,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/notice")
-public class NoticeController extends BaseController
+public class SysNoticeController extends BaseController
 {
     private String prefix = "system/notice";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PostController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java

@@ -27,7 +27,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/post")
-public class PostController extends BaseController
+public class SysPostController extends BaseController
 {
     private String prefix = "system/post";
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ProfileController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java

@@ -30,9 +30,9 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/user/profile")
-public class ProfileController extends BaseController
+public class SysProfileController extends BaseController
 {
-    private static final Logger log = LoggerFactory.getLogger(ProfileController.class);
+    private static final Logger log = LoggerFactory.getLogger(SysProfileController.class);
 
     private String prefix = "system/user/profile";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RoleController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -28,7 +28,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/role")
-public class RoleController extends BaseController
+public class SysRoleController extends BaseController
 {
     private String prefix = "system/role";
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/UserController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -32,7 +32,7 @@ import com.ruoyi.web.core.base.BaseController;
  */
 @Controller
 @RequestMapping("/system/user")
-public class UserController extends BaseController
+public class SysUserController extends BaseController
 {
     private String prefix = "system/user";
 

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -127,7 +127,7 @@ gen:
   # 作者
   author: ruoyi
   # 默认生成包路径 module 需改成自己的模块名称 如 system monitor tool
-  packageName: com.ruoyi.project.module
+  packageName: com.ruoyi.module
   # 自动去除表前缀,默认是true
   autoRemovePre: true
   # 表前缀(类名不会包含表前缀)

+ 5 - 1
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -468,6 +468,10 @@
             	    url = $.table._option.updateUrl.replace("{id}", id);
             	} else {
             	    var id = $.common.isEmpty($.table._option.id) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.id);
+            	    if (id.length == 0) {
+            			$.modal.alertWarning("请至少选择一条记录");
+            			return;
+            		}
             	    url = $.table._option.updateUrl.replace("{id}", id);
             	}
             	$.modal.open("修改" + $.table._option.modalName, url);
@@ -475,7 +479,7 @@
             // 工具栏表格树修改
             editTree: function() {
             	var row = $('#bootstrap-table').bootstrapTreeTable('getSelections')[0];
-        		if ($.common.isEmpty(row)) {
+            	if ($.common.isEmpty(row)) {
         			$.modal.alertWarning("请至少选择一条记录");
         			return;
         		}

+ 1 - 2
ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java

@@ -102,8 +102,7 @@ public class Global
      */
     public static Boolean isAddressEnabled()
     {
-        String value = getConfig("ruoyi.addressEnabled");
-        return Boolean.TRUE.equals(value);
+        return Boolean.valueOf(getConfig("ruoyi.addressEnabled"));
     }
 
     /**

+ 13 - 18
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java

@@ -20,7 +20,7 @@ import com.ruoyi.generator.domain.TableInfo;
 public class GenUtils
 {
     /** 项目空间路径 */
-    private static final String PROJECT_PATH = "main/java/com/ruoyi/project";
+    private static final String PROJECT_PATH = "main/java/com/ruoyi";
 
     /** mybatis空间路径 */
     private static final String MYBATIS_PATH = "main/resources/mybatis";
@@ -71,7 +71,7 @@ public class GenUtils
         velocityContext.put("classname", table.getClassname());
         velocityContext.put("moduleName", GenUtils.getModuleName(packageName));
         velocityContext.put("columns", table.getColumns());
-        velocityContext.put("package", packageName + "." + table.getClassname());
+        velocityContext.put("package", packageName);
         velocityContext.put("author", Global.getAuthor());
         velocityContext.put("datetime", DateUtils.getDate());
         return velocityContext;
@@ -85,16 +85,16 @@ public class GenUtils
     public static List<String> getTemplates()
     {
         List<String> templates = new ArrayList<String>();
-        templates.add("templates/vm/java/domain.java.vm");
-        templates.add("templates/vm/java/Mapper.java.vm");
-        templates.add("templates/vm/java/Service.java.vm");
-        templates.add("templates/vm/java/ServiceImpl.java.vm");
-        templates.add("templates/vm/java/Controller.java.vm");
-        templates.add("templates/vm/xml/Mapper.xml.vm");
-        templates.add("templates/vm/html/list.html.vm");
-        templates.add("templates/vm/html/add.html.vm");
-        templates.add("templates/vm/html/edit.html.vm");
-        templates.add("templates/vm/sql/sql.vm");
+        templates.add("vm/java/domain.java.vm");
+        templates.add("vm/java/Mapper.java.vm");
+        templates.add("vm/java/Service.java.vm");
+        templates.add("vm/java/ServiceImpl.java.vm");
+        templates.add("vm/java/Controller.java.vm");
+        templates.add("vm/xml/Mapper.xml.vm");
+        templates.add("vm/html/list.html.vm");
+        templates.add("vm/html/add.html.vm");
+        templates.add("vm/html/edit.html.vm");
+        templates.add("vm/sql/sql.vm");
         return templates;
     }
 
@@ -127,11 +127,6 @@ public class GenUtils
         String mybatisPath = MYBATIS_PATH + "/" + moduleName + "/" + className;
         String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + classname;
 
-        if (StringUtils.isNotEmpty(classname))
-        {
-            javaPath += classname.replace(".", "/") + "/";
-        }
-
         if (template.contains("domain.java.vm"))
         {
             return javaPath + "domain" + "/" + className + ".java";
@@ -229,6 +224,6 @@ public class GenUtils
     {
         System.out.println(StringUtils.convertToCamelCase("user_name"));
         System.out.println(replaceKeyword("岗位信息表"));
-        System.out.println(getModuleName("com.ruoyi.project.system"));
+        System.out.println(getModuleName("com.ruoyi.system"));
     }
 }

+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/html/add.html.vm → ruoyi-generator/src/main/resources/vm/html/add.html.vm


+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/html/edit.html.vm → ruoyi-generator/src/main/resources/vm/html/edit.html.vm


+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/html/list.html.vm → ruoyi-generator/src/main/resources/vm/html/list.html.vm


+ 5 - 5
ruoyi-admin/src/main/resources/templates/vm/java/Controller.java.vm → ruoyi-generator/src/main/resources/vm/java/Controller.java.vm

@@ -1,4 +1,4 @@
-package ${package}.controller;
+package ${package}.web.controller;
 
 import java.util.List;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,13 +10,13 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.enums.BusinessType;
 import ${package}.domain.${className};
 import ${package}.service.I${className}Service;
-import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.web.core.base.BaseController;
 import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.base.AjaxResult;
 
 /**
  * ${tableComment} 信息操作处理

+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/java/Mapper.java.vm → ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm


+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/java/Service.java.vm → ruoyi-generator/src/main/resources/vm/java/Service.java.vm


+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/java/ServiceImpl.java.vm → ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm


+ 1 - 1
ruoyi-admin/src/main/resources/templates/vm/java/domain.java.vm → ruoyi-generator/src/main/resources/vm/java/domain.java.vm

@@ -2,7 +2,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;
+import com.ruoyi.common.base.BaseEntity;
 #foreach ($column in $columns)
 #if($column.attrType == 'Date')
 import java.util.Date;

+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/sql/sql.vm → ruoyi-generator/src/main/resources/vm/sql/sql.vm


+ 0 - 0
ruoyi-admin/src/main/resources/templates/vm/xml/Mapper.xml.vm → ruoyi-generator/src/main/resources/vm/xml/Mapper.xml.vm