统一 boot 和 cloud 代码
This commit is contained in:
parent
6d5b066ae6
commit
e850e39e80
@ -15,6 +15,9 @@ import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName}
|
|||||||
import static ${ServiceExceptionUtilClassName}.exception;
|
import static ${ServiceExceptionUtilClassName}.exception;
|
||||||
import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*;
|
import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${table.classComment} Service 实现类
|
* ${table.classComment} Service 实现类
|
||||||
*
|
*
|
||||||
@ -66,6 +69,9 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) {
|
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) {
|
||||||
|
if (CollUtil.isEmpty(ids)) {
|
||||||
|
return ListUtil.empty();
|
||||||
|
}
|
||||||
return ${classNameVar}Mapper.selectBatchIds(ids);
|
return ${classNameVar}Mapper.selectBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,20 +132,20 @@
|
|||||||
align="center"
|
align="center"
|
||||||
prop="${javaField}"
|
prop="${javaField}"
|
||||||
:formatter="dateFormatter"
|
:formatter="dateFormatter"
|
||||||
width="150px"
|
width="180px"
|
||||||
/>
|
/>
|
||||||
#elseif("" != $column.dictType)## 数据字典
|
#elseif("" != $column.dictType)## 数据字典
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="150px">
|
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.$dictType.toUpperCase()" :value="scope.row.${column.javaField}" />
|
<dict-tag :type="DICT_TYPE.$dictType.toUpperCase()" :value="scope.row.${column.javaField}" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
#else
|
#else
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="150px" />
|
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" width="150px">
|
<el-table-column label="操作" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
|
@ -25,7 +25,7 @@ public class AuthPermissionInfoRespVO {
|
|||||||
@Schema(description = "操作权限数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "操作权限数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Set<String> permissions;
|
private Set<String> permissions;
|
||||||
|
|
||||||
@Schema(description = "菜单树", required = true)
|
@Schema(description = "菜单树", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<MenuVO> menus;
|
private List<MenuVO> menus;
|
||||||
|
|
||||||
@Schema(description = "用户信息 VO")
|
@Schema(description = "用户信息 VO")
|
||||||
@ -53,13 +53,13 @@ public class AuthPermissionInfoRespVO {
|
|||||||
@Builder
|
@Builder
|
||||||
public static class MenuVO {
|
public static class MenuVO {
|
||||||
|
|
||||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "父菜单 ID", required = true, example = "1024")
|
@Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")
|
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")
|
||||||
@ -74,10 +74,10 @@ public class AuthPermissionInfoRespVO {
|
|||||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
@Schema(description = "是否可见", required = true, example = "false")
|
@Schema(description = "是否可见", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||||
private Boolean visible;
|
private Boolean visible;
|
||||||
|
|
||||||
@Schema(description = "是否缓存", required = true, example = "false")
|
@Schema(description = "是否缓存", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||||
private Boolean keepAlive;
|
private Boolean keepAlive;
|
||||||
|
|
||||||
@Schema(description = "是否总是显示", example = "false")
|
@Schema(description = "是否总是显示", example = "false")
|
||||||
|
@ -176,7 +176,7 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false) // 禁用数据权限,避免简历不正确的缓存
|
@DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
|
||||||
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
|
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
|
||||||
public Set<Long> getChildDeptIdListFromCache(Long id) {
|
public Set<Long> getChildDeptIdListFromCache(Long id) {
|
||||||
List<DeptDO> children = getChildDeptList(id);
|
List<DeptDO> children = getChildDeptList(id);
|
||||||
|
@ -43,10 +43,15 @@ public class DictDataServiceImplTest extends BaseDbUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetDictDataList() {
|
public void testGetDictDataList() {
|
||||||
// mock 数据
|
// mock 数据
|
||||||
DictDataDO dictDataDO01 = randomDictDataDO().setDictType("yunai").setSort(2);
|
DictDataDO dictDataDO01 = randomDictDataDO().setDictType("yunai").setSort(2)
|
||||||
|
.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
dictDataMapper.insert(dictDataDO01);
|
dictDataMapper.insert(dictDataDO01);
|
||||||
DictDataDO dictDataDO02 = randomDictDataDO().setDictType("yunai").setSort(1);
|
DictDataDO dictDataDO02 = randomDictDataDO().setDictType("yunai").setSort(1)
|
||||||
|
.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
dictDataMapper.insert(dictDataDO02);
|
dictDataMapper.insert(dictDataDO02);
|
||||||
|
DictDataDO dictDataDO03 = randomDictDataDO().setDictType("yunai").setSort(3)
|
||||||
|
.setStatus(CommonStatusEnum.DISABLE.getStatus());
|
||||||
|
dictDataMapper.insert(dictDataDO03);
|
||||||
// 准备参数
|
// 准备参数
|
||||||
|
|
||||||
// 调用
|
// 调用
|
||||||
|
Loading…
Reference in New Issue
Block a user