You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.9 KiB
81 lines
1.9 KiB
|
3 years ago
|
## 翰林博得 在线教育服务
|
||
|
|
|
||
|
|
### 项目介绍
|
||
|
|
```
|
||
|
|
创建于2021年5月19日:第一版
|
||
|
|
```
|
||
|
|
### 模块说明
|
||
|
|
```
|
||
|
|
hly-project--项目依赖,父依赖,项目框架为spring-cloud----
|
||
|
|
eureka--注册中心
|
||
|
|
common--公共服务库
|
||
|
|
common-base --
|
||
|
|
最基础的服务 例如日志跟踪等
|
||
|
|
common-security-feign--服务调用依赖组件库
|
||
|
|
common-rabbitmq-config--服务队列依赖组建库
|
||
|
|
common-web-base--接口前端返回数据结构
|
||
|
|
...
|
||
|
|
hly-service--基础服务提供-按业务属性拆分
|
||
|
|
hly-service-all--服务为拆分前业务
|
||
|
|
hly-service-api--基础服务api
|
||
|
|
hly-service-api-all--服务为拆分前业务
|
||
|
|
hly-api--前端接口服务
|
||
|
|
hly-api-interface--翰林在线前端接口
|
||
|
|
hly-job--异步队列服务
|
||
|
|
hly-job-front--前端异步队列处理
|
||
|
|
|
||
|
|
|
||
|
|
```
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
##redis引用
|
||
|
|
```
|
||
|
|
1,加入配置文件
|
||
|
|
application-redis.properties
|
||
|
|
2,引入资源包
|
||
|
|
<dependency>
|
||
|
|
<groupId>com.hly.cloud.common</groupId>
|
||
|
|
<artifactId>common-redis-config</artifactId>
|
||
|
|
<version>1.0.0</version>
|
||
|
|
</dependency>
|
||
|
|
3,项目中引用实例
|
||
|
|
@Resource
|
||
|
|
@Qualifier(DataRedisConstants.redisMasterTemplate)
|
||
|
|
private RedisTemplate<Object,Object> redisMasterTemplate;
|
||
|
|
```
|
||
|
|
|
||
|
|
##mybatis引用
|
||
|
|
```
|
||
|
|
1,引入資源包
|
||
|
|
<dependency>
|
||
|
|
<groupId>com.hly.cloud.common</groupId>
|
||
|
|
<artifactId>common-mybatis-config</artifactId>
|
||
|
|
<version>1.0.0</version>
|
||
|
|
</dependency>
|
||
|
|
2,引入要使用的數據源
|
||
|
|
@Configuration
|
||
|
|
public class HlCoreDbConfig extends HlCoreDbConfigBase {
|
||
|
|
|
||
|
|
public final static String mapperPath = "com.hlbd.provider.all.mapper.core";
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public String getBasePackage() {
|
||
|
|
return mapperPath;
|
||
|
|
}
|
||
|
|
3,引入配置@PropertySource(value = { "application-mysql.properties" })
|
||
|
|
application-mysql.properties
|
||
|
|
application-mysql.properties 中间的连接对应 pre
|
||
|
|
|
||
|
|
4,mybatis-plus
|
||
|
|
参考
|
||
|
|
|
||
|
|
|
||
|
|
https://mybatis.plus/
|
||
|
|
```
|
||
|
|
|
||
|
|
```
|
||
|
|
测试环境:
|
||
|
|
http://localhost:8080/swagger-ui
|
||
|
|
```
|