Skip to content

Commit 41bbb6c

Browse files
committed
update annotation
1 parent 7ff1d95 commit 41bbb6c

File tree

18 files changed

+137
-75
lines changed

18 files changed

+137
-75
lines changed

.idea/workspace.xml

Lines changed: 95 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book-api/src/main/java/com/imooc/controller/VlogController.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ public class VlogController extends BaseInfoProperties {
2323

2424
@Autowired
2525
private VlogService vlogService;
26-
26+
/**
27+
* @description: 这里的没用VO直接用BO是一样的,VlogBO是由前端进行构建的(在insert数据库时会加上创建时间等参数,那时候插入的vlog变量其实就是VLogDO)
28+
* 上传的简介等参数都会封装,url在前端上传完之后会自动获取
29+
* @param: vlogBO
30+
* @return: com.imooc.grace.result.GraceJSONResult
31+
* @author Administrator
32+
* @date: 2022/8/10 16:56
33+
*/
2734
@PostMapping("publish")
2835
public GraceJSONResult publish(@RequestBody VlogBO vlogBO) {
2936
// FIXME 作业,校验VlogBO

book-api/src/main/java/com/imooc/interceptor/PassportInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
3030
/**
3131
*拦截器Boolean
3232
* false代表请求拦截
33-
*true代表请求放行
33+
* true代表请求放行
3434
*/
3535
return true;
3636
}

book-api/src/main/java/com/imooc/interceptor/UserTokenInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
@Slf4j
1616
public class UserTokenInterceptor extends BaseInfoProperties implements HandlerInterceptor {
17-
17+
//通过请求头来校验修改资料权限
1818
@Override
1919
public boolean preHandle(HttpServletRequest request,
2020
HttpServletResponse response, Object handler) throws Exception {
@@ -24,7 +24,7 @@ public boolean preHandle(HttpServletRequest request,
2424
String userId = request.getHeader("headerUserId");
2525
String userToken = request.getHeader("headerUserToken");
2626

27-
// 判断header中用户id和token不能为空
27+
// 判断header中用户id和token不能为空,根据config的配置可以知道是用于在用户相关图片修改以及基础信息的修改(密码不算基础信息)
2828
if (StringUtils.isNotBlank(userId) && StringUtils.isNotBlank(userToken)) {
2929
String redisToken = redis.get(REDIS_USER_TOKEN + ":" + userId);
3030
if (StringUtils.isBlank(redisToken)) {

book-api/src/main/resources/application-dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ spring:
55
datasource: # 数据源的相关配置
66
type: com.zaxxer.hikari.HikariDataSource # 数据源的类型,可以更改为其他的数据源配置,比如druid
77
driver-class-name: com.mysql.cj.jdbc.Driver # mysql/MariaDB 的数据库驱动类名称
8-
url: jdbc:mysql://localhost:3306/imooc-red-book-dev?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=GMT%2B8
8+
url: jdbc:mysql://10.8.64.61:3306/imooc-red-book-dev?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=GMT%2B8
99
username: root
10-
password: 123456
10+
password: qnit123!@#
1111
hikari:
1212
connection-timeout: 30000 # 等待连接池分配连接的最大时间(毫秒),超过这个时长还没有可用的连接,则会抛出SQLException
1313
minimum-idle: 5 # 最小连接数
@@ -18,7 +18,7 @@ spring:
1818
max-lifetime: 18000000 # 连接池的最大生命时长(毫秒),超时则会被释放(retired)
1919
connection-test-query: SELECT 1
2020
redis:
21-
host: localhost
21+
host: 10.8.64.72
2222
port: 6379
2323
#集群是没有database这一个概念的,单机才需要指定
2424
database: 0
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
spring:
2+
#下面是Spring微服务注册的服务名的名称,再在Nacos上指示是哪一个服务
23
application:
34
name: imooc-red-book-nacos
5+
#配置具体的cloud云微服务配置
46
cloud:
57
nacos:
68
config:
79
server-addr: 10.8.64.72:8848 # nacos 所在的地址
8-
file-extension: yaml
10+
file-extension: yaml #文件类型必须指定
11+
namespace: #选择指定的配置文件可使用namespace

book-api/target/classes/application-dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spring:
2828
uri: mongodb://root:root@10.8.64.72:27017
2929
database: imooc-red-book
3030
rabbitmq:
31-
host: localhost
31+
host: 10.8.64.72
3232
# 访问端口和console端口不一样
3333
port: 5672
3434
username: admin
@@ -54,8 +54,8 @@ management:
5454

5555
# MinIO 配置
5656
minio:
57-
endpoint: http://10.8.64.72:9090 # MinIO服务地址
58-
fileHost: http://10.8.64.72:9090 # 文件地址host
57+
endpoint: http://10.8.64.72:9000 # MinIO服务地址
58+
fileHost: http://10.8.64.72:9000 # 文件地址host
5959
bucketName: imooc # 存储桶bucket名称
6060
accessKey: minioadmin # 用户名
6161
secretKey: minioadmin # 密码
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)