设计初心:拥有自己的技术博客网页,创造自己的笔记中心、知识存储库。
![知识库知识栈.png](./知识库知识栈.png)
### 侧边栏数据库设计
* 根据代码逻辑设计:
```html
<a-menu-item key="home">
<template #icon>
<iconpark-icon name="jinliyu"></iconpark-icon>
</template>
知识库必读
</a-menu-item>
<a-sub-menu key="sub1">
<template #icon>
<iconpark-icon name="css"></iconpark-icon>
</template>
<template #title>css</template>
<a-menu-item-group key="g1">
<template #title>
<iconpark-icon name="css" class="mr-1"></iconpark-icon>Item 1
</template>
<a-menu-item key="1">
<template #icon> <iconpark-icon name="css"></iconpark-icon> </template>
css
</a-menu-item>
<a-menu-item key="2">Option 2</a-menu-item>
</a-menu-item-group>
</a-sub-menu>
```
![数据库.png](./数据库.png)
## SpringBoot 后端
* 工具:IntelliJ IDEA 2020.3.1 x64
* 系统:Windows x64
* 项目 java 版本:jdk1.8
* spring boot 版本 :2.2.6.RELEASE
#### 1、新建 spring boot 项目
1. 选择依赖:Spring Boot DevTools、Lombok、Spring Configuration Processor、Spring Web、MySQL Driver
### 2、添加依赖
> 如无则添,如有则忽略
>
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- 实体类需求-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--mp代码生成器-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
<!-- hutool工具类-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.3.3</version>
</dependency>
```
### 3、添加配置文件
> 在目录 src/main/resources 中
>
添加名为:application 的 yml 文件
```yaml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/***?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai #数据库配置
username: *** #数据库用户名
password: *** #数据库密码
mybatis-plus:
mapper-locations: classpath*:/mapper/**Mapper.xml
server:
port: 5000 #启动端口
```
### 4、添加必须文件
> 在目录 src/main/java/包名 中新建 util 包
>
* 根据数据库表自动生成器
```java
public class CodeGeneration {
/**
* <p>
* 读取控制台内容
* </p>
*/
public static String scanner(String tip) {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入" + tip + ":");
if (scanner.hasNext()) {
String ipt = scanner.next();
if (StringUtils.isNotEmpty(ipt)) {
return ipt;
}
}
throw new MybatisPlusException("请输入正确的" + tip + "!");
}
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("关注公众号:l鲤鱼乡"); //选择性配置
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
gc.setServiceName("%sService");
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://localhost:3306/***?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("***");
dsc.setPassword("***");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName(null);
pc.setParent("com.knowledgeBase");//包名按需更改
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
// String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return projectPath + "/src/main/resources/mapper/"
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("t_");//按照表名t_切割
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
```
* MybatisPlus 配置文件
```java
@Configuration
@EnableTransactionManagement
@MapperScan("com.knowledgeBase.mapper") //mapper包所在目录
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
return paginationInterceptor;
}
}
```
* 解决跨域问题
```java
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.allowCredentials(true)
.maxAge(3600)
.allowedHeaders("*");
}
}
```
### 使用
克隆项目:git clone https://gitee.com/lyxalyh/knowledge-base.git
也可以到https://gitee.com/lyxalyh/knowledge-base.git下载zip包
#### 前端vue使用
> 环�
没有合适的资源?快使用搜索试试~ 我知道了~
基于SpringBoot + Vue的知识库管理系统源码 + sql.zip
共1822个文件
js:420个
wxss:354个
wxml:338个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 180 浏览量
2023-03-14
21:43:21
上传
评论 2
收藏 16.19MB ZIP 举报
温馨提示
基于SpringBoot + Vue的知识库管理系统源码 + sql.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot + Vue的知识库管理系统源码 + sql.zip (1822个子文件)
.browserslistrc 44B
mvnw.cmd 7KB
config 307B
description 73B
Dockerfile 651B
docker.dockerignore 40B
.editorconfig 127B
exclude 240B
.gitignore 428B
.gitignore 254B
HEAD 187B
HEAD 187B
HEAD 32B
HEAD 23B
emailTemplate.html 1KB
index.html 897B
pack-631ba46bb2643e3b55ae4c934f8e9ae894bcd198.idx 37KB
index 246KB
maven-wrapper.jar 57KB
GlobalExceptionHandle.java 6KB
MenuitemgroupController.java 5KB
ContentController.java 5KB
CodeGeneration.java 4KB
MenuitemGroupItemController.java 4KB
MenuitemController.java 4KB
RestResponse.java 4KB
RmbController.java 4KB
HouseController.java 3KB
OssServiceImpl.java 3KB
ContentAndMenuItem.java 3KB
MailController.java 3KB
ContentMapper.java 3KB
MenuitemgroupitemMapper.java 2KB
MenuitemgroupMapper.java 2KB
MenuitemMapper.java 2KB
KnowledgeBaseSpringBootApplicationTests.java 1KB
PasswordController.java 1KB
Content.java 1KB
AppConstant.java 1KB
MenuitemGroupItem.java 1KB
Rmb.java 1KB
RmbMapper.java 1KB
OssController.java 1KB
MenuitemGroup.java 1KB
Menuitem.java 1KB
House.java 974B
HouseMapper.java 910B
OssClientConfig.java 793B
CorsConfig.java 779B
MybatisPlusConfig.java 774B
Password.java 722B
PasswordMapper.java 620B
MenuitemgroupitemServiceImpl.java 607B
MenuitemgroupServiceImpl.java 579B
PasswordServiceImpl.java 559B
MenuitemServiceImpl.java 544B
ContentServiceImpl.java 537B
WaterServiceImpl.java 523B
RmbServiceImpl.java 509B
IOssService.java 370B
KnowledgeBaseSpringBootApplication.java 369B
MenuitemgroupitemService.java 348B
PasswordService.java 336B
MenuitemgroupService.java 336B
MenuitemService.java 321B
ContentService.java 318B
WaterService.java 312B
AndMenuitem.java 308B
RmbService.java 306B
RmbVo.java 226B
echarts.js 965KB
runtime.js 23KB
runtime.js 23KB
index.js 13KB
index.js 13KB
index.js 13KB
index.js 13KB
basic.js 12KB
basic.js 12KB
index.js 11KB
index.js 11KB
index.js 10KB
index.js 10KB
index.js 9KB
index.js 9KB
index.js 9KB
index.js 9KB
index.js 9KB
index.js 8KB
index.js 8KB
index.js 7KB
index.js 7KB
ec-canvas.js 7KB
index.js 7KB
index.js 7KB
index.js 7KB
index.js 7KB
index.js 7KB
index.js 7KB
index.js 7KB
共 1822 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
- weixin_62495322024-04-07资源内容详实,描述详尽,解决了我的问题,受益匪浅,学到了。
omyligaga
- 粉丝: 54
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功