Skip to content

Commit 00c8d97

Browse files
author
sunfuhao
committed
update annotation
1 parent 30558a4 commit 00c8d97

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

book-api/src/main/java/com/imooc/InterceptorConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ public UserTokenInterceptor userTokenInterceptor() {
2020
return new UserTokenInterceptor();
2121
}
2222

23+
2324
@Override
2425
public void addInterceptors(InterceptorRegistry registry) {
26+
//在添加拦截器到WebMvcConfigurer配置中时设置拦截范围,注意只能拦截Controller的请求路径
27+
//WebMvcConfigurer这个接口其实可以当作是对SpringWeb配置的模块,即实现JavaConfig的配置接口
2528
registry.addInterceptor(passportInterceptor())
2629
.addPathPatterns("/passport/getSMSCode");
2730

book-api/src/main/java/com/imooc/Knife4jConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
public class Knife4jConfig {
1717

1818
@Bean
19+
/**
20+
* @description: 建造者模式去创建 Docket对象
21+
* @param:
22+
* @return: springfox.documentation.spring.web.plugins.Docket
23+
* @author Administrator
24+
* @date: 2022/7/19 20:20
25+
*/
1926
public Docket defaultApi2() {
2027
Docket docket=new Docket(DocumentationType.SWAGGER_2)
2128
.apiInfo(new ApiInfoBuilder()

book-api/src/main/java/com/imooc/MinIOConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public class MinIOConfig {
2727
private Integer fileSize;
2828

2929
@Bean
30+
/**
31+
* @description: 创建MinIO客户端使用MinIO的Api,需要提供连接参数
32+
* @param:
33+
* @return: com.imooc.utils.MinIOUtils
34+
* @author Administrator
35+
* @date: 2022/7/19 20:18
36+
*/
3037
public MinIOUtils creatMinioClient() {
3138
return new MinIOUtils(endpoint, bucketName, accessKey, secretKey, imgSize, fileSize);
3239
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)