添加知识分类
This commit is contained in:
parent
d471524ee6
commit
2d52f129c7
@ -2,7 +2,9 @@ package cn.iocoder.yudao.framework.common.util.spring;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Spring 工具类
|
||||
@ -20,5 +22,19 @@ public class SpringUtils extends SpringUtil {
|
||||
String activeProfile = getActiveProfile();
|
||||
return Objects.equals("prod", activeProfile);
|
||||
}
|
||||
|
||||
public static List<Long> convertStringListToLongList(List<String> stringList) {
|
||||
return stringList.stream()
|
||||
.filter(s -> s != null && !s.isEmpty()) // 过滤掉 null 或空字符串
|
||||
.map(s -> {
|
||||
try {
|
||||
return Long.parseLong(s);
|
||||
} catch (NumberFormatException e) {
|
||||
// 处理转换失败的情况,例如日志记录或忽略无效值
|
||||
System.err.println("Invalid input: " + s + " is not a valid long number.");
|
||||
return null; // 或者返回一个默认值,如 0L
|
||||
}
|
||||
})
|
||||
.filter(l -> l != null) // 过滤掉转换失败的 null 值
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -81,5 +81,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode KNOWTYPE_PARENT_ERROR = new ErrorCode(1_009_015_003, "不能设置自己为父知识分类");
|
||||
ErrorCode KNOWTYPE_NODE_NAME_DUPLICATE = new ErrorCode(1_009_015_004, "已经存在该节点名称的知识分类");
|
||||
ErrorCode KNOWTYPE_PARENT_IS_CHILD = new ErrorCode(1_009_015_005, "不能设置自己的子Knowtype为父Knowtype");
|
||||
|
||||
// ========== 知识发布 1_009_016_000 ==========
|
||||
ErrorCode KNOWLEDGE_NOT_EXISTS = new ErrorCode(1_009_016_000, "知识发布不存在");
|
||||
}
|
||||
|
@ -75,5 +75,17 @@
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>13.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-system-biz</artifactId>
|
||||
<version>2.1.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -0,0 +1,141 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.knows;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.spring.SpringUtils;
|
||||
import cn.iocoder.yudao.module.bpm.convert.knows.KnowledgeConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowtypeDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.knows.KnowtypeService;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserServiceImpl;
|
||||
import io.reactivex.rxjava3.core.Single;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.knows.KnowledgeService;
|
||||
|
||||
@Tag(name = "管理后台 - 知识发布")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/knowledge")
|
||||
@Validated
|
||||
public class KnowledgeController {
|
||||
|
||||
@Resource
|
||||
private KnowledgeService knowledgeService;
|
||||
@Resource
|
||||
private DeptService deptService;
|
||||
@Resource
|
||||
private KnowtypeService knowtypeService;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
private AdminUserService userService;
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建知识发布")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:create')")
|
||||
public CommonResult<Long> createKnowledge(@Valid @RequestBody KnowledgeSaveReqVO createReqVO) {
|
||||
return success(knowledgeService.createKnowledge(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新知识发布")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:update')")
|
||||
public CommonResult<Boolean> updateKnowledge(@Valid @RequestBody KnowledgeSaveReqVO updateReqVO) {
|
||||
knowledgeService.updateKnowledge(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除知识发布")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:delete')")
|
||||
public CommonResult<Boolean> deleteKnowledge(@RequestParam("id") Long id) {
|
||||
knowledgeService.deleteKnowledge(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得知识发布")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:query')")
|
||||
public CommonResult<KnowledgeRespVO> getKnowledge(@RequestParam("id") Long id) {
|
||||
KnowledgeDO knowledge = knowledgeService.getKnowledge(id);
|
||||
return success(BeanUtils.toBean(knowledge, KnowledgeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得知识发布分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:query')")
|
||||
public CommonResult<PageResult<KnowledgeRespVO>> getKnowledgePage(@Valid KnowledgePageReqVO pageReqVO) {
|
||||
PageResult<KnowledgeDO> pageResult = knowledgeService.getKnowledgePage(pageReqVO);
|
||||
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return success(new PageResult<>(pageResult.getTotal()));
|
||||
}
|
||||
//return success(BeanUtils.toBean(pageResult, KnowledgeRespVO.class));
|
||||
// 拼接数据
|
||||
|
||||
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||
convertList(pageResult.getList(), KnowledgeDO::getDeptId));
|
||||
Map<Long, KnowtypeDO> knowTypeMap = knowtypeService.getKnowtypeMap(
|
||||
convertList(pageResult.getList(), KnowledgeDO::getTypeId));
|
||||
// List<String> creatorStringList = convertList(pageResult.getList(), KnowledgeDO::getCreator);
|
||||
// List<Long> creatorLongList = SpringUtils.convertStringListToLongList(creatorStringList);
|
||||
// Map<Long, AdminUserDO> userMap = userService.getUserMap(creatorLongList);
|
||||
|
||||
// 转换并返回结果
|
||||
return success(new PageResult<>(KnowledgeConvert.INSTANCE.convertList(pageResult.getList(), deptMap, knowTypeMap), pageResult.getTotal()));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出知识发布 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportKnowledgeExcel(@Valid KnowledgePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KnowledgeDO> list = knowledgeService.getKnowledgePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "知识发布.xls", "数据", KnowledgeRespVO.class,
|
||||
BeanUtils.toBean(list, KnowledgeRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(评论) ====================
|
||||
|
||||
@GetMapping("/comment/list-by-know-id")
|
||||
@Operation(summary = "获得评论列表")
|
||||
@Parameter(name = "knowId", description = "类型id")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:knowledge:query')")
|
||||
public CommonResult<List<CommentDO>> getCommentListByKnowId(@RequestParam("knowId") Long knowId) {
|
||||
return success(knowledgeService.getCommentListByKnowId(knowId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 知识发布分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class KnowledgePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型id", example = "11472")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "部门id", example = "26267")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "知识标题")
|
||||
private String knowTitle;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "知识状态", example = "0")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "作者", example = "张三")
|
||||
private String userName;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 知识发布 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KnowledgeRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7888")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11472")
|
||||
@ExcelProperty("类型id")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "类型名称", example = "环境")
|
||||
@ExcelProperty("类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "部门id", example = "26267")
|
||||
@ExcelProperty("部门id")
|
||||
private Long deptId;
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "部门名称", example = "IT 部")
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "作者名称", example = "张三")
|
||||
@ExcelProperty("作者名称")
|
||||
private String nickName;
|
||||
|
||||
@Schema(description = "知识标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("知识标题")
|
||||
private String knowTitle;
|
||||
|
||||
@Schema(description = "内容")
|
||||
@ExcelProperty("内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "知识状态", example = "0")
|
||||
@ExcelProperty(value = "知识状态", converter = DictConvert.class)
|
||||
@DictFormat("common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String status;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
@ExcelProperty("文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("作者")
|
||||
private String userName;
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@Schema(description = "管理后台 - 知识发布新增/修改 Request VO")
|
||||
@Data
|
||||
public class KnowledgeSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7888")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11472")
|
||||
@NotNull(message = "类型id不能为空")
|
||||
private Long typeId;
|
||||
|
||||
@Schema(description = "部门id", example = "26267")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "知识标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "知识标题不能为空")
|
||||
private String knowTitle;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "知识状态", example = "0")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "评论列表")
|
||||
private List<CommentDO> comments;
|
||||
|
||||
@Schema(description = "作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotNull(message = "作者不能为空")
|
||||
private String userName;
|
||||
}
|
@ -13,12 +13,12 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class KnowtypeListReqVO {
|
||||
|
||||
@Schema(description = "节点名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "父id", example = "18269")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "节点名称", example = "芋艿")
|
||||
private String nodeName;
|
||||
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
@ -29,4 +29,4 @@ public class KnowtypeListReqVO {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ public class KnowtypeRespVO {
|
||||
@ExcelProperty("分类id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("节点名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "父id", example = "18269")
|
||||
@ExcelProperty("父id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("节点名称")
|
||||
private String nodeName;
|
||||
|
||||
@Schema(description = "显示顺序")
|
||||
@ExcelProperty("显示顺序")
|
||||
private Integer orderNum;
|
||||
@ -39,4 +39,4 @@ public class KnowtypeRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class KnowtypeSaveReqVO {
|
||||
|
||||
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "节点名称不能为空")
|
||||
private String nodeName;
|
||||
private String name;
|
||||
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer orderNum;
|
||||
|
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.bpm.convert.knows;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.KnowledgeRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowtypeDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper
|
||||
public interface KnowledgeConvert {
|
||||
KnowledgeConvert INSTANCE = Mappers.getMapper(KnowledgeConvert.class);
|
||||
// default List<KnowledgeRespVO> convertList(List<KnowledgeDO> list, Map<Long, DeptDO> deptMap) {
|
||||
// return CollectionUtils.convertList(list, konw -> convert(konw, deptMap.get(konw.getDeptId())));
|
||||
// }
|
||||
// 列表转换方法
|
||||
// default List<KnowledgeRespVO> convertList(List<KnowledgeDO> list, Map<Long, DeptDO> deptMap, Map<Long, KnowtypeDO> knowTypeMap,Map<Long, AdminUserDO> userMap) {
|
||||
// return list.stream().map(knowledgeDO -> {
|
||||
// DeptDO deptDO = deptMap.get(knowledgeDO.getDeptId());
|
||||
// KnowtypeDO knowtypeDO = knowTypeMap.get(knowledgeDO.getTypeId());
|
||||
// AdminUserDO userDO = userMap.get(knowledgeDO.getUserid());
|
||||
// return convert(knowledgeDO, deptDO, knowtypeDO,userDO);
|
||||
// }).collect(Collectors.toList());
|
||||
// }
|
||||
default List<KnowledgeRespVO> convertList(List<KnowledgeDO> list, Map<Long, DeptDO> deptMap, Map<Long, KnowtypeDO> knowTypeMap) {
|
||||
return list.stream().map(knowledgeDO -> {
|
||||
DeptDO deptDO = deptMap.get(knowledgeDO.getDeptId());
|
||||
KnowtypeDO knowtypeDO = knowTypeMap.get(knowledgeDO.getTypeId());
|
||||
return convert(knowledgeDO, deptDO, knowtypeDO);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
default KnowledgeRespVO convert(KnowledgeDO konw, DeptDO dept, KnowtypeDO knowtype) {
|
||||
KnowledgeRespVO KnowledgeVO = BeanUtils.toBean(konw, KnowledgeRespVO.class);
|
||||
if (dept != null) {
|
||||
KnowledgeVO.setDeptName(dept.getName());
|
||||
}
|
||||
if (knowtype != null) {
|
||||
KnowledgeVO.setTypeName(knowtype.getName());
|
||||
}
|
||||
return KnowledgeVO;
|
||||
}
|
||||
// default KnowledgeRespVO convert(KnowledgeDO konw, DeptDO dept, KnowtypeDO knowtype, AdminUserDO user) {
|
||||
// KnowledgeRespVO KnowledgeVO = BeanUtils.toBean(konw, KnowledgeRespVO.class);
|
||||
// if (dept != null) {
|
||||
// KnowledgeVO.setDeptName(dept.getName());
|
||||
// }
|
||||
// if (knowtype != null) {
|
||||
// KnowledgeVO.setTypeName(knowtype.getName());
|
||||
// }
|
||||
// if (user != null) {
|
||||
// KnowledgeVO.setNickName(user.getNickname());
|
||||
// }
|
||||
// return KnowledgeVO;
|
||||
// }
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.knows;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 评论 DO
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
@TableName("des_comment")
|
||||
@KeySequence("des_comment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CommentDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
private Long knowId;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.knows;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 知识发布 DO
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
@TableName("des_knowledge")
|
||||
@KeySequence("des_knowledge_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class KnowledgeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
private Long typeId;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 知识标题
|
||||
*/
|
||||
private String knowTitle;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 知识状态
|
||||
*
|
||||
* 枚举 {@link TODO common_status 对应的类}
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 作者的id
|
||||
*/
|
||||
private String userName;
|
||||
}
|
@ -29,14 +29,12 @@ public class KnowtypeDO extends BaseDO {
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ -48,4 +46,8 @@ public class KnowtypeDO extends BaseDO {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Long parentId;
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.knows;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 评论 Mapper
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommentMapper extends BaseMapperX<CommentDO> {
|
||||
|
||||
default List<CommentDO> selectListByKnowId(Long knowId) {
|
||||
return selectList(CommentDO::getKnowId, knowId);
|
||||
}
|
||||
|
||||
default int deleteByKnowId(Long knowId) {
|
||||
return delete(CommentDO::getKnowId, knowId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.knows;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
|
||||
/**
|
||||
* 知识发布 Mapper
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
@Mapper
|
||||
public interface KnowledgeMapper extends BaseMapperX<KnowledgeDO> {
|
||||
|
||||
default PageResult<KnowledgeDO> selectPage(KnowledgePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<KnowledgeDO>()
|
||||
.eqIfPresent(KnowledgeDO::getTypeId, reqVO.getTypeId())
|
||||
.eqIfPresent(KnowledgeDO::getDeptId, reqVO.getDeptId())
|
||||
.eqIfPresent(KnowledgeDO::getKnowTitle, reqVO.getKnowTitle())
|
||||
.eqIfPresent(KnowledgeDO::getContent, reqVO.getContent())
|
||||
.eqIfPresent(KnowledgeDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(KnowledgeDO::getFilePath, reqVO.getFilePath())
|
||||
.betweenIfPresent(KnowledgeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(KnowledgeDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -19,20 +19,20 @@ public interface KnowtypeMapper extends BaseMapperX<KnowtypeDO> {
|
||||
|
||||
default List<KnowtypeDO> selectList(KnowtypeListReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<KnowtypeDO>()
|
||||
.likeIfPresent(KnowtypeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(KnowtypeDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(KnowtypeDO::getNodeName, reqVO.getNodeName())
|
||||
.eqIfPresent(KnowtypeDO::getOrderNum, reqVO.getOrderNum())
|
||||
.eqIfPresent(KnowtypeDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(KnowtypeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(KnowtypeDO::getId));
|
||||
.orderByAsc(KnowtypeDO::getOrderNum));
|
||||
}
|
||||
|
||||
default KnowtypeDO selectByParentIdAndNodeName(Long parentId, String nodeName) {
|
||||
return selectOne(KnowtypeDO::getParentId, parentId, KnowtypeDO::getNodeName, nodeName);
|
||||
default KnowtypeDO selectByParentIdAndName(Long parentId, String nodeName) {
|
||||
return selectOne(KnowtypeDO::getParentId, parentId, KnowtypeDO::getName, nodeName);
|
||||
}
|
||||
|
||||
default Long selectCountByParentId(Long parentId) {
|
||||
return selectCount(KnowtypeDO::getParentId, parentId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.knows;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 知识发布 Service 接口
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
public interface KnowledgeService {
|
||||
|
||||
/**
|
||||
* 创建知识发布
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createKnowledge(@Valid KnowledgeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新知识发布
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateKnowledge(@Valid KnowledgeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除知识发布
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteKnowledge(Long id);
|
||||
|
||||
/**
|
||||
* 获得知识发布
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 知识发布
|
||||
*/
|
||||
KnowledgeDO getKnowledge(Long id);
|
||||
|
||||
/**
|
||||
* 获得知识发布分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 知识发布分页
|
||||
*/
|
||||
PageResult<KnowledgeDO> getKnowledgePage(KnowledgePageReqVO pageReqVO);
|
||||
|
||||
// ==================== 子表(评论) ====================
|
||||
|
||||
/**
|
||||
* 获得评论列表
|
||||
*
|
||||
* @param knowId 类型id
|
||||
* @return 评论列表
|
||||
*/
|
||||
List<CommentDO> getCommentListByKnowId(Long knowId);
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.knows;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.knows.KnowledgeMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.knows.CommentMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 知识发布 Service 实现类
|
||||
*
|
||||
* @author pch
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class KnowledgeServiceImpl implements KnowledgeService {
|
||||
|
||||
@Resource
|
||||
private KnowledgeMapper knowledgeMapper;
|
||||
@Resource
|
||||
private CommentMapper commentMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createKnowledge(KnowledgeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
KnowledgeDO knowledge = BeanUtils.toBean(createReqVO, KnowledgeDO.class);
|
||||
knowledgeMapper.insert(knowledge);
|
||||
|
||||
// 插入子表
|
||||
createCommentList(knowledge.getId(), createReqVO.getComments());
|
||||
// 返回
|
||||
return knowledge.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateKnowledge(KnowledgeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateKnowledgeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
KnowledgeDO updateObj = BeanUtils.toBean(updateReqVO, KnowledgeDO.class);
|
||||
knowledgeMapper.updateById(updateObj);
|
||||
|
||||
// 更新子表
|
||||
updateCommentList(updateReqVO.getId(), updateReqVO.getComments());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteKnowledge(Long id) {
|
||||
// 校验存在
|
||||
validateKnowledgeExists(id);
|
||||
// 删除
|
||||
knowledgeMapper.deleteById(id);
|
||||
|
||||
// 删除子表
|
||||
deleteCommentByKnowId(id);
|
||||
}
|
||||
|
||||
private void validateKnowledgeExists(Long id) {
|
||||
if (knowledgeMapper.selectById(id) == null) {
|
||||
throw exception(KNOWLEDGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public KnowledgeDO getKnowledge(Long id) {
|
||||
return knowledgeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<KnowledgeDO> getKnowledgePage(KnowledgePageReqVO pageReqVO) {
|
||||
return knowledgeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
// ==================== 子表(评论) ====================
|
||||
|
||||
@Override
|
||||
public List<CommentDO> getCommentListByKnowId(Long knowId) {
|
||||
return commentMapper.selectListByKnowId(knowId);
|
||||
}
|
||||
|
||||
private void createCommentList(Long knowId, List<CommentDO> list) {
|
||||
list.forEach(o -> o.setKnowId(knowId));
|
||||
commentMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void updateCommentList(Long knowId, List<CommentDO> list) {
|
||||
deleteCommentByKnowId(knowId);
|
||||
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||
createCommentList(knowId, list);
|
||||
}
|
||||
|
||||
private void deleteCommentByKnowId(Long knowId) {
|
||||
commentMapper.deleteByKnowId(knowId);
|
||||
}
|
||||
|
||||
}
|
@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.bpm.service.knows;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowtypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 知识分类 Service 接口
|
||||
@ -52,4 +52,10 @@ public interface KnowtypeService {
|
||||
*/
|
||||
List<KnowtypeDO> getKnowtypeList(KnowtypeListReqVO listReqVO);
|
||||
|
||||
List<KnowtypeDO> getKnowtypeList(Collection<Long> ids);
|
||||
default Map<Long, KnowtypeDO> getKnowtypeMap(Collection<Long> ids) {
|
||||
List<KnowtypeDO> list = getKnowtypeList(ids);
|
||||
return CollectionUtils.convertMap(list, KnowtypeDO::getId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.knows;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowtypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.knows.KnowtypeMapper;
|
||||
@ -35,7 +33,7 @@ public class KnowtypeServiceImpl implements KnowtypeService {
|
||||
// 校验父id的有效性
|
||||
validateParentKnowtype(null, createReqVO.getParentId());
|
||||
// 校验节点名称的唯一性
|
||||
validateKnowtypeNodeNameUnique(null, createReqVO.getParentId(), createReqVO.getNodeName());
|
||||
validateKnowtypeNameUnique(null, createReqVO.getParentId(), createReqVO.getName());
|
||||
|
||||
// 插入
|
||||
KnowtypeDO knowtype = BeanUtils.toBean(createReqVO, KnowtypeDO.class);
|
||||
@ -51,7 +49,7 @@ public class KnowtypeServiceImpl implements KnowtypeService {
|
||||
// 校验父id的有效性
|
||||
validateParentKnowtype(updateReqVO.getId(), updateReqVO.getParentId());
|
||||
// 校验节点名称的唯一性
|
||||
validateKnowtypeNodeNameUnique(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getNodeName());
|
||||
validateKnowtypeNameUnique(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName());
|
||||
|
||||
// 更新
|
||||
KnowtypeDO updateObj = BeanUtils.toBean(updateReqVO, KnowtypeDO.class);
|
||||
@ -110,8 +108,8 @@ public class KnowtypeServiceImpl implements KnowtypeService {
|
||||
}
|
||||
}
|
||||
|
||||
private void validateKnowtypeNodeNameUnique(Long id, Long parentId, String nodeName) {
|
||||
KnowtypeDO knowtype = knowtypeMapper.selectByParentIdAndNodeName(parentId, nodeName);
|
||||
private void validateKnowtypeNameUnique(Long id, Long parentId, String name) {
|
||||
KnowtypeDO knowtype = knowtypeMapper.selectByParentIdAndName(parentId, name);
|
||||
if (knowtype == null) {
|
||||
return;
|
||||
}
|
||||
@ -133,5 +131,11 @@ public class KnowtypeServiceImpl implements KnowtypeService {
|
||||
public List<KnowtypeDO> getKnowtypeList(KnowtypeListReqVO listReqVO) {
|
||||
return knowtypeMapper.selectList(listReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KnowtypeDO> getKnowtypeList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return knowtypeMapper.selectBatchIds(ids);
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
DELETE FROM "bpm_form";
|
||||
DELETE FROM "bpm_user_group";
|
||||
DELETE FROM "bpm_category";
|
||||
DELETE FROM "des_knowtype";
|
||||
DELETE FROM "des_knowledge";
|
||||
|
@ -41,3 +41,34 @@ CREATE TABLE IF NOT EXISTS "bpm_form" (
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '动态表单';
|
||||
CREATE TABLE IF NOT EXISTS "des_knowtype" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"parent_id" bigint,
|
||||
"node_name" varchar NOT NULL,
|
||||
"order_num" int,
|
||||
"status" varchar NOT NULL,
|
||||
"creator" varchar DEFAULT '',
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updater" varchar DEFAULT '',
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '知识分类表';
|
||||
-- 将该建表 SQL 语句,添加到 yudao-module-bpm-biz 模块的 test/resources/sql/create_tables.sql 文件里
|
||||
CREATE TABLE IF NOT EXISTS "des_knowledge" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"type_id" bigint NOT NULL,
|
||||
"dept_id" bigint,
|
||||
"know_title" varchar NOT NULL,
|
||||
"content" varchar,
|
||||
"status" varchar,
|
||||
"file_path" varchar,
|
||||
"creator" varchar DEFAULT '',
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updater" varchar DEFAULT '',
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '知识表';
|
||||
|
Loading…
Reference in New Issue
Block a user