Commit e958657373c7919ea27c07bbb41ac98df6446033
Committed by
Gitee
!97 修复仅本人数据权限时,个人中心会报错的问题
Merge pull request !97 from 芋道源码/feature/1.6.1
Showing
8 changed files
with
39 additions
and
36 deletions
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
| 1 | package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; | 1 | package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.util.ObjectUtil; | ||
| 3 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnBaseVO; | 4 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnBaseVO; |
| 4 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO; | 5 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO; |
| 6 | +import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; | ||
| 5 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
| 6 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
| 7 | import lombok.Data; | 9 | import lombok.Data; |
| @@ -9,6 +11,7 @@ import lombok.EqualsAndHashCode; | @@ -9,6 +11,7 @@ import lombok.EqualsAndHashCode; | ||
| 9 | import lombok.ToString; | 11 | import lombok.ToString; |
| 10 | 12 | ||
| 11 | import javax.validation.Valid; | 13 | import javax.validation.Valid; |
| 14 | +import javax.validation.constraints.AssertTrue; | ||
| 12 | import javax.validation.constraints.NotNull; | 15 | import javax.validation.constraints.NotNull; |
| 13 | import java.util.List; | 16 | import java.util.List; |
| 14 | 17 | ||
| @@ -28,11 +31,19 @@ public class CodegenUpdateReqVO { | @@ -28,11 +31,19 @@ public class CodegenUpdateReqVO { | ||
| 28 | @Data | 31 | @Data |
| 29 | @EqualsAndHashCode(callSuper = true) | 32 | @EqualsAndHashCode(callSuper = true) |
| 30 | @ToString(callSuper = true) | 33 | @ToString(callSuper = true) |
| 34 | + @Valid | ||
| 31 | public static class Table extends CodegenTableBaseVO { | 35 | public static class Table extends CodegenTableBaseVO { |
| 32 | 36 | ||
| 33 | @ApiModelProperty(value = "编号", required = true, example = "1") | 37 | @ApiModelProperty(value = "编号", required = true, example = "1") |
| 34 | private Long id; | 38 | private Long id; |
| 35 | 39 | ||
| 40 | + @AssertTrue(message = "上级菜单不能为空") | ||
| 41 | + public boolean isParentMenuIdValid() { | ||
| 42 | + // 生成场景为管理后台时,必须设置上级菜单,不然生成的菜单 SQL 是无父级菜单的 | ||
| 43 | + return ObjectUtil.notEqual(getScene(), CodegenSceneEnum.ADMIN.getScene()) | ||
| 44 | + || getParentMenuId() != null; | ||
| 45 | + } | ||
| 46 | + | ||
| 36 | } | 47 | } |
| 37 | 48 | ||
| 38 | @ApiModel("更新表定义") | 49 | @ApiModel("更新表定义") |
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.infra.service.codegen; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.infra.service.codegen; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 5 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.CodegenUpdateReqVO; | 6 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.CodegenUpdateReqVO; |
| 6 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTablePageReqVO; | 7 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTablePageReqVO; |
| 7 | import cn.iocoder.yudao.module.infra.convert.codegen.CodegenConvert; | 8 | import cn.iocoder.yudao.module.infra.convert.codegen.CodegenConvert; |
| @@ -14,21 +15,18 @@ import cn.iocoder.yudao.module.infra.dal.mysql.codegen.CodegenTableMapper; | @@ -14,21 +15,18 @@ import cn.iocoder.yudao.module.infra.dal.mysql.codegen.CodegenTableMapper; | ||
| 14 | import cn.iocoder.yudao.module.infra.dal.mysql.codegen.SchemaColumnMapper; | 15 | import cn.iocoder.yudao.module.infra.dal.mysql.codegen.SchemaColumnMapper; |
| 15 | import cn.iocoder.yudao.module.infra.dal.mysql.codegen.SchemaTableMapper; | 16 | import cn.iocoder.yudao.module.infra.dal.mysql.codegen.SchemaTableMapper; |
| 16 | import cn.iocoder.yudao.module.infra.enums.codegen.CodegenImportTypeEnum; | 17 | import cn.iocoder.yudao.module.infra.enums.codegen.CodegenImportTypeEnum; |
| 18 | +import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; | ||
| 17 | import cn.iocoder.yudao.module.infra.framework.codegen.config.CodegenProperties; | 19 | import cn.iocoder.yudao.module.infra.framework.codegen.config.CodegenProperties; |
| 18 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenBuilder; | 20 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenBuilder; |
| 19 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenEngine; | 21 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenEngine; |
| 20 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenSQLParser; | 22 | import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenSQLParser; |
| 21 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | 23 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 22 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 23 | import org.apache.commons.collections4.KeyValue; | 24 | import org.apache.commons.collections4.KeyValue; |
| 24 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 25 | import org.springframework.transaction.annotation.Transactional; | 26 | import org.springframework.transaction.annotation.Transactional; |
| 26 | 27 | ||
| 27 | import javax.annotation.Resource; | 28 | import javax.annotation.Resource; |
| 28 | -import java.util.ArrayList; | ||
| 29 | -import java.util.List; | ||
| 30 | -import java.util.Map; | ||
| 31 | -import java.util.Set; | 29 | +import java.util.*; |
| 32 | import java.util.stream.Collectors; | 30 | import java.util.stream.Collectors; |
| 33 | 31 | ||
| 34 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 32 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| @@ -266,27 +264,8 @@ public class CodegenServiceImpl implements CodegenService { | @@ -266,27 +264,8 @@ public class CodegenServiceImpl implements CodegenService { | ||
| 266 | // TODO 强制移除 Quartz 的表,未来做成可配置 | 264 | // TODO 强制移除 Quartz 的表,未来做成可配置 |
| 267 | tables.removeIf(table -> table.getTableName().startsWith("QRTZ_")); | 265 | tables.removeIf(table -> table.getTableName().startsWith("QRTZ_")); |
| 268 | tables.removeIf(table -> table.getTableName().startsWith("ACT_")); | 266 | tables.removeIf(table -> table.getTableName().startsWith("ACT_")); |
| 267 | + tables.removeIf(table -> table.getTableName().startsWith("FLW_")); | ||
| 269 | return tables; | 268 | return tables; |
| 270 | } | 269 | } |
| 271 | 270 | ||
| 272 | -// /** | ||
| 273 | -// * 修改保存参数校验 | ||
| 274 | -// * | ||
| 275 | -// * @param genTable 业务信息 | ||
| 276 | -// */ | ||
| 277 | -// @Override | ||
| 278 | -// public void validateEdit(GenTable genTable) { | ||
| 279 | -// if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { | ||
| 280 | -// String options = JSON.toJSONString(genTable.getParams()); | ||
| 281 | -// JSONObject paramsObj = JSONObject.parseObject(options); | ||
| 282 | -// if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) { | ||
| 283 | -// throw new CustomException("树编码字段不能为空"); | ||
| 284 | -// } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) { | ||
| 285 | -// throw new CustomException("树父编码字段不能为空"); | ||
| 286 | -// } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) { | ||
| 287 | -// throw new CustomException("树名称字段不能为空"); | ||
| 288 | -// } | ||
| 289 | -// } | ||
| 290 | -// } | ||
| 291 | - | ||
| 292 | } | 271 | } |
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
| @@ -51,6 +51,8 @@ public class CodegenBuilder { | @@ -51,6 +51,8 @@ public class CodegenBuilder { | ||
| 51 | .put("image", CodegenColumnHtmlTypeEnum.UPLOAD_IMAGE) | 51 | .put("image", CodegenColumnHtmlTypeEnum.UPLOAD_IMAGE) |
| 52 | .put("file", CodegenColumnHtmlTypeEnum.UPLOAD_FILE) | 52 | .put("file", CodegenColumnHtmlTypeEnum.UPLOAD_FILE) |
| 53 | .put("content", CodegenColumnHtmlTypeEnum.EDITOR) | 53 | .put("content", CodegenColumnHtmlTypeEnum.EDITOR) |
| 54 | + .put("description", CodegenColumnHtmlTypeEnum.EDITOR) | ||
| 55 | + .put("demo", CodegenColumnHtmlTypeEnum.EDITOR) | ||
| 54 | .put("time", CodegenColumnHtmlTypeEnum.DATETIME) | 56 | .put("time", CodegenColumnHtmlTypeEnum.DATETIME) |
| 55 | .put("date", CodegenColumnHtmlTypeEnum.DATETIME) | 57 | .put("date", CodegenColumnHtmlTypeEnum.DATETIME) |
| 56 | .build(); | 58 | .build(); |
| @@ -58,7 +60,7 @@ public class CodegenBuilder { | @@ -58,7 +60,7 @@ public class CodegenBuilder { | ||
| 58 | /** | 60 | /** |
| 59 | * 多租户编号的字段名 | 61 | * 多租户编号的字段名 |
| 60 | */ | 62 | */ |
| 61 | - public static final String TENANT_ID_FIELD = "tenant_id"; | 63 | + public static final String TENANT_ID_FIELD = "tenantId"; |
| 62 | /** | 64 | /** |
| 63 | * {@link cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO} 的字段 | 65 | * {@link cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO} 的字段 |
| 64 | */ | 66 | */ |
| @@ -121,14 +123,13 @@ public class CodegenBuilder { | @@ -121,14 +123,13 @@ public class CodegenBuilder { | ||
| 121 | private void initTableDefault(CodegenTableDO table) { | 123 | private void initTableDefault(CodegenTableDO table) { |
| 122 | // 以 system_dept 举例子。moduleName 为 system、businessName 为 dept、className 为 SystemDept | 124 | // 以 system_dept 举例子。moduleName 为 system、businessName 为 dept、className 为 SystemDept |
| 123 | // 如果不希望 System 前缀,则可以手动在【代码生成 - 修改生成配置 - 基本信息】,将实体类名称改为 Dept 即可 | 125 | // 如果不希望 System 前缀,则可以手动在【代码生成 - 修改生成配置 - 基本信息】,将实体类名称改为 Dept 即可 |
| 124 | - table.setModuleName(StrUtil.subBefore(table.getTableName(), | ||
| 125 | - '_', false)); // 第一个 _ 前缀的前面,作为 module 名字 | 126 | + table.setModuleName(subBefore(table.getTableName(), '_', false)); // 第一个 _ 前缀的前面,作为 module 名字 |
| 126 | table.setBusinessName(toCamelCase(subAfter(table.getTableName(), | 127 | table.setBusinessName(toCamelCase(subAfter(table.getTableName(), |
| 127 | '_', false))); // 第一步,第一个 _ 前缀的后面,作为 module 名字; 第二步,可能存在多个 _ 的情况,转换成驼峰 | 128 | '_', false))); // 第一步,第一个 _ 前缀的后面,作为 module 名字; 第二步,可能存在多个 _ 的情况,转换成驼峰 |
| 128 | - table.setClassName(upperFirst(toCamelCase(table.getTableName()))); // 驼峰 + 首字母大写 | 129 | + table.setClassName(upperFirst(toCamelCase( // 驼峰 + 首字母大写 |
| 130 | + subAfter(table.getTableName(), '_', false)))); // 第一个 _ 前缀的前面,作为 class 名字 | ||
| 129 | table.setClassComment(subBefore(table.getTableComment(), // 去除结尾的表,作为类描述 | 131 | table.setClassComment(subBefore(table.getTableComment(), // 去除结尾的表,作为类描述 |
| 130 | '表', true)); | 132 | '表', true)); |
| 131 | - table.setAuthor("芋艿"); // TODO 稍后改成创建人 | ||
| 132 | table.setTemplateType(CodegenTemplateTypeEnum.CRUD.getType()); | 133 | table.setTemplateType(CodegenTemplateTypeEnum.CRUD.getType()); |
| 133 | } | 134 | } |
| 134 | 135 | ||
| @@ -157,7 +158,7 @@ public class CodegenBuilder { | @@ -157,7 +158,7 @@ public class CodegenBuilder { | ||
| 157 | column.setJavaField(toCamelCase(column.getColumnName())); | 158 | column.setJavaField(toCamelCase(column.getColumnName())); |
| 158 | // 处理 dictType 字段,暂无 | 159 | // 处理 dictType 字段,暂无 |
| 159 | // 处理 javaType 字段 | 160 | // 处理 javaType 字段 |
| 160 | - String dbType = StrUtil.subBefore(column.getColumnType(), '(', false); | 161 | + String dbType = subBefore(column.getColumnType(), '(', false); |
| 161 | javaTypeMappings.entrySet().stream() | 162 | javaTypeMappings.entrySet().stream() |
| 162 | .filter(entry -> entry.getValue().contains(dbType)) | 163 | .filter(entry -> entry.getValue().contains(dbType)) |
| 163 | .findFirst().ifPresent(entry -> column.setJavaType(entry.getKey())); | 164 | .findFirst().ifPresent(entry -> column.setJavaType(entry.getKey())); |
yudao-module-infra/yudao-module-infra-impl/src/main/resources/codegen/java/test/serviceTest.vm
| 1 | package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; | 1 | package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
| 2 | 2 | ||
| 3 | +import org.junit.jupiter.api.Disabled; | ||
| 3 | import org.junit.jupiter.api.Test; | 4 | import org.junit.jupiter.api.Test; |
| 4 | import org.springframework.boot.test.mock.mockito.MockBean; | 5 | import org.springframework.boot.test.mock.mockito.MockBean; |
| 5 | 6 | ||
| @@ -135,7 +136,8 @@ public class ${table.className}ServiceImplTest extends BaseDbUnitTest { | @@ -135,7 +136,8 @@ public class ${table.className}ServiceImplTest extends BaseDbUnitTest { | ||
| 135 | assertServiceException(() -> ${classNameVar}Service.delete${simpleClassName}(id), ${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS); | 136 | assertServiceException(() -> ${classNameVar}Service.delete${simpleClassName}(id), ${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS); |
| 136 | } | 137 | } |
| 137 | 138 | ||
| 138 | - @Test // TODO 请修改 null 为需要的值 | 139 | + @Test |
| 140 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | ||
| 139 | public void testGet${simpleClassName}Page() { | 141 | public void testGet${simpleClassName}Page() { |
| 140 | #getPageCondition("PageReqVO") | 142 | #getPageCondition("PageReqVO") |
| 141 | 143 | ||
| @@ -147,7 +149,8 @@ public class ${table.className}ServiceImplTest extends BaseDbUnitTest { | @@ -147,7 +149,8 @@ public class ${table.className}ServiceImplTest extends BaseDbUnitTest { | ||
| 147 | assertPojoEquals(db${simpleClassName}, pageResult.getList().get(0)); | 149 | assertPojoEquals(db${simpleClassName}, pageResult.getList().get(0)); |
| 148 | } | 150 | } |
| 149 | 151 | ||
| 150 | - @Test // TODO 请修改 null 为需要的值 | 152 | + @Test |
| 153 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | ||
| 151 | public void testGet${simpleClassName}List() { | 154 | public void testGet${simpleClassName}List() { |
| 152 | #getPageCondition("ExportReqVO") | 155 | #getPageCondition("ExportReqVO") |
| 153 | 156 |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||
| 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.collection.SetUtils; | 6 | import cn.iocoder.yudao.framework.common.util.collection.SetUtils; |
| 7 | -import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; | ||
| 8 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | 7 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 9 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.*; | 8 | import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.*; |
| 10 | import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; | 9 | import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; |
| @@ -64,7 +63,6 @@ public class AuthController { | @@ -64,7 +63,6 @@ public class AuthController { | ||
| 64 | 63 | ||
| 65 | @GetMapping("/get-permission-info") | 64 | @GetMapping("/get-permission-info") |
| 66 | @ApiOperation("获取登录用户的权限信息") | 65 | @ApiOperation("获取登录用户的权限信息") |
| 67 | - @DataPermission(enable = false) // 标记不使用数据权限,避免【SELF】权限范围报错 | ||
| 68 | public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() { | 66 | public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() { |
| 69 | // 获得用户信息 | 67 | // 获得用户信息 |
| 70 | AdminUserDO user = userService.getUser(getLoginUserId()); | 68 | AdminUserDO user = userService.getUser(getLoginUserId()); |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java
| @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 5 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | 5 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 7 | +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; | ||
| 7 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO; | 8 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO; |
| 8 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; | 9 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; |
| 9 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; | 10 | import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; |
| @@ -58,6 +59,7 @@ public class UserProfileController { | @@ -58,6 +59,7 @@ public class UserProfileController { | ||
| 58 | 59 | ||
| 59 | @GetMapping("/get") | 60 | @GetMapping("/get") |
| 60 | @ApiOperation("获得登录用户信息") | 61 | @ApiOperation("获得登录用户信息") |
| 62 | + @DataPermission(enable = false) // 关闭数据权限,避免只查看自己时,查询不到部门。 | ||
| 61 | public CommonResult<UserProfileRespVO> profile() { | 63 | public CommonResult<UserProfileRespVO> profile() { |
| 62 | // 获得用户基本信息 | 64 | // 获得用户基本信息 |
| 63 | AdminUserDO user = userService.getUser(getLoginUserId()); | 65 | AdminUserDO user = userService.getUser(getLoginUserId()); |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java
| @@ -17,8 +17,11 @@ public class DataPermissionConfiguration { | @@ -17,8 +17,11 @@ public class DataPermissionConfiguration { | ||
| 17 | @Bean | 17 | @Bean |
| 18 | public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { | 18 | public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { |
| 19 | return rule -> { | 19 | return rule -> { |
| 20 | + // dept | ||
| 20 | rule.addDeptColumn(AdminUserDO.class); | 21 | rule.addDeptColumn(AdminUserDO.class); |
| 21 | rule.addDeptColumn(DeptDO.class, "id"); | 22 | rule.addDeptColumn(DeptDO.class, "id"); |
| 23 | + // user | ||
| 24 | + rule.addUserColumn(AdminUserDO.class, "id"); | ||
| 22 | }; | 25 | }; |
| 23 | } | 26 | } |
| 24 | 27 |
yudao-ui-admin/src/views/infra/codegen/basicInfoForm.vue
| @@ -13,7 +13,13 @@ | @@ -13,7 +13,13 @@ | ||
| 13 | </el-col> | 13 | </el-col> |
| 14 | 14 | ||
| 15 | <el-col :span="12"> | 15 | <el-col :span="12"> |
| 16 | - <el-form-item label="实体类名称" prop="className"> | 16 | + <el-form-item prop="className"> |
| 17 | + <span slot="label"> | ||
| 18 | + 实体类名称 | ||
| 19 | + <el-tooltip content="默认去除表名的前缀。如果存在重复,则需要手动添加前缀,避免 MyBatis 报 Alias 重复的问题。" placement="top"> | ||
| 20 | + <i class="el-icon-question"></i> | ||
| 21 | + </el-tooltip> | ||
| 22 | + </span> | ||
| 17 | <el-input placeholder="请输入" v-model="info.className" /> | 23 | <el-input placeholder="请输入" v-model="info.className" /> |
| 18 | </el-form-item> | 24 | </el-form-item> |
| 19 | </el-col> | 25 | </el-col> |