├── .gitattributes
├── .gitignore
├── .jpb
└── jpb-settings.xml
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── LICENSE
├── README.md
├── architecture.png
├── command.txt
├── connector-video-event.json
├── connector-worker-event-result.json
├── docker-compose.yaml
├── event.txt
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
├── main
│ ├── java
│ │ └── com
│ │ │ └── joejoe2
│ │ │ └── video
│ │ │ ├── VideoApplication.java
│ │ │ ├── config
│ │ │ ├── CacheConfig.java
│ │ │ ├── InterceptorConfig.java
│ │ │ ├── JwtConfig.java
│ │ │ ├── KafkaConfig.java
│ │ │ ├── ObjectStorageConfiguration.java
│ │ │ ├── PrivateKeyConverter.java
│ │ │ ├── PublicKeyConverter.java
│ │ │ ├── RedisConfig.java
│ │ │ ├── RetryConfig.java
│ │ │ ├── SecurityConfig.java
│ │ │ ├── SpringDocConfig.java
│ │ │ ├── StreamConfig.java
│ │ │ └── StringTrimConfig.java
│ │ │ ├── controller
│ │ │ ├── GlobalExceptionHandler.java
│ │ │ ├── constraint
│ │ │ │ ├── auth
│ │ │ │ │ └── AuthenticatedApi.java
│ │ │ │ └── checker
│ │ │ │ │ └── ControllerAuthConstraintChecker.java
│ │ │ ├── storage
│ │ │ │ └── StorageController.java
│ │ │ └── video
│ │ │ │ └── VideoController.java
│ │ │ ├── data
│ │ │ ├── ErrorMessageResponse.java
│ │ │ ├── InvalidRequestResponse.java
│ │ │ ├── UserDetail.java
│ │ │ ├── storage
│ │ │ │ ├── DownloadRequest.java
│ │ │ │ └── UploadRequest.java
│ │ │ └── video
│ │ │ │ ├── CreateRequest.java
│ │ │ │ ├── EventResultDto.java
│ │ │ │ ├── EventResultDtoDeserializer.java
│ │ │ │ ├── TsRequest.java
│ │ │ │ ├── VideoProfile.java
│ │ │ │ └── VideoRequest.java
│ │ │ ├── exception
│ │ │ ├── AlreadyExist.java
│ │ │ ├── ControllerConstraintViolation.java
│ │ │ ├── DoesNotExist.java
│ │ │ ├── InvalidOperation.java
│ │ │ ├── InvalidTokenException.java
│ │ │ └── ValidationError.java
│ │ │ ├── filter
│ │ │ └── JwtAuthenticationFilter.java
│ │ │ ├── interceptor
│ │ │ └── ControllerConstraintInterceptor.java
│ │ │ ├── models
│ │ │ ├── User.java
│ │ │ └── video
│ │ │ │ ├── EventResult.java
│ │ │ │ ├── MicroToInstantConverter.java
│ │ │ │ ├── Operation.java
│ │ │ │ ├── ResultStatus.java
│ │ │ │ ├── Video.java
│ │ │ │ ├── VideoEvent.java
│ │ │ │ ├── VideoEventResult.java
│ │ │ │ └── VideoStatus.java
│ │ │ ├── repository
│ │ │ ├── VideoEventResultRepository.java
│ │ │ ├── user
│ │ │ │ └── UserRepository.java
│ │ │ └── video
│ │ │ │ ├── VideoEventRepository.java
│ │ │ │ └── VideoRepository.java
│ │ │ ├── service
│ │ │ ├── jwt
│ │ │ │ ├── JwtService.java
│ │ │ │ └── JwtServiceImpl.java
│ │ │ ├── redis
│ │ │ │ ├── RedisService.java
│ │ │ │ └── RedisServiceImpl.java
│ │ │ ├── storage
│ │ │ │ ├── MinioObjectStorageServiceImpl.java
│ │ │ │ ├── MinioService.java
│ │ │ │ ├── MinioServiceImpl.java
│ │ │ │ └── ObjectStorageService.java
│ │ │ ├── user
│ │ │ │ └── auth
│ │ │ │ │ └── UserDetailService.java
│ │ │ └── video
│ │ │ │ ├── VideoEventHandler.java
│ │ │ │ ├── VideoService.java
│ │ │ │ └── VideoServiceImpl.java
│ │ │ ├── utils
│ │ │ ├── AuthUtil.java
│ │ │ ├── HttpUtil.java
│ │ │ ├── IPUtils.java
│ │ │ └── JwtUtil.java
│ │ │ └── validation
│ │ │ ├── UUID.java
│ │ │ ├── UUIDValidator.java
│ │ │ ├── Validator.java
│ │ │ ├── VideoFileName.java
│ │ │ └── VideoFileNameValidator.java
│ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-dev.yml
│ │ ├── application-test.properties
│ │ ├── application-test.yml
│ │ ├── application.properties
│ │ └── application.yml
└── test
│ └── java
│ └── com
│ └── joejoe2
│ └── video
│ ├── TestContext.java
│ ├── VideoApplicationTests.java
│ └── validation
│ └── VideoFileNameValidatorTest.java
└── worker
├── .gitignore
├── .jpb
└── jpb-settings.xml
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
├── main
│ ├── java
│ │ └── com
│ │ │ └── joejoe2
│ │ │ └── worker
│ │ │ ├── WorkerApplication.java
│ │ │ ├── config
│ │ │ ├── KafkaConfig.java
│ │ │ └── MinioConfiguration.java
│ │ │ ├── data
│ │ │ ├── EventDto.java
│ │ │ ├── EventDtoDeserializer.java
│ │ │ └── MicroToInstantConverter.java
│ │ │ ├── model
│ │ │ ├── EventResult.java
│ │ │ ├── Operation.java
│ │ │ ├── ResultStatus.java
│ │ │ ├── VideoEvent.java
│ │ │ ├── VideoEventResult.java
│ │ │ └── VideoStatus.java
│ │ │ ├── repository
│ │ │ └── VideoEventResultRepository.java
│ │ │ ├── service
│ │ │ ├── KafkaManager.java
│ │ │ ├── MinioService.java
│ │ │ ├── MinioServiceImpl.java
│ │ │ ├── VideoEventHandler.java
│ │ │ ├── VideoService.java
│ │ │ └── VideoServiceImpl.java
│ │ │ └── util
│ │ │ ├── FileUtil.java
│ │ │ └── VideoUtil.java
│ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-test.properties
│ │ └── application.properties
└── test
│ └── java
│ └── com
│ └── joejoe2
│ └── worker
│ ├── TestContext.java
│ ├── WorkerApplicationTests.java
│ ├── service
│ └── VideoServiceTest.java
│ └── util
│ └── VideoUtilTest.java
└── test.mp4
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | /target
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !/worker/.mvn/wrapper/maven-wrapper.jar
5 | !**/src/main/**/target/
6 | !**/src/test/**/target/
7 | /kafka/
8 | /postgresql/
9 | /zookeeper/
10 | /minio/
11 | /worker/tmp/
12 |
13 | ### STS ###
14 | .apt_generated
15 | .classpath
16 | .factorypath
17 | .project
18 | .settings
19 | .springBeans
20 | .sts4-cache
21 |
22 | ### IntelliJ IDEA ###
23 | .idea
24 | *.iws
25 | *.iml
26 | *.ipr
27 |
28 | ### NetBeans ###
29 | /nbproject/private/
30 | /nbbuild/
31 | /dist/
32 | /nbdist/
33 | /.nb-gradle/
34 | build/
35 | !**/src/main/**/build/
36 | !**/src/test/**/build/
37 |
38 | ### VS Code ###
39 | .vscode/
40 |
41 | ### other files ###
42 | *.key
43 | *.pem
44 | *.env
45 |
--------------------------------------------------------------------------------
/.jpb/jpb-settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joejoe2/spring-video/05eddc3d3907d7a393c7d8e84165a8208d5aaf18/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 joejoe2
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # spring-video
2 |
3 | ## Description
4 |
5 | HLS video streaming application with Minio object storage, Kafka, Debezium and FFmpeg.
6 |
7 | ## Architecture
8 |
9 | 
10 |
11 | ## Get Started
12 |
13 | 1. install ffmpeg
14 |
15 |
16 | 2. follow [this](https://github.com/joejoe2/spring-jwt-template)
17 | to setup an authentication service and run it at port 8080
18 |
19 |
20 | 3. run `docker-sompose up -d`
21 |
22 |
23 | 4. run commands in `./command.txt`
24 |
25 |
26 | 5. run the current project and worker project (at `./worker`)
27 |
28 |
29 | 6. goto http://localhost:8080/swagger-ui/index.html#/auth-controller/login and login to get an access token
30 |
31 |
32 | 7. goto http://localhost:8082/swagger-ui/index.html#/storage-controller/upload and upload a mp4 file
33 |
34 |
35 | 8. goto http://localhost:8082/swagger-ui/index.html#/video-controller/create and create a video with the filename in 7. , please copy the video id from response
36 |
37 |
38 | 9. goto http://localhost:8082/swagger-ui/index.html#/video-controller/profile with video id and wait for the video status become READY
39 |
40 |
41 | 10. use http://localhost:8082/api/video/{your_video_id}/index.m3u8 for any HLS player
42 |
43 | ## Testing
44 |
45 | run `mvn test` or `./mvnw test`
46 |
47 | ## Lint
48 |
49 | run
50 | ```
51 | mvn spotless:check
52 | mvn spotless:apply
53 | ```
54 | or
55 | ```
56 | ./mvnw spotless:check
57 | ./mvnw spotless:apply
58 | ```
--------------------------------------------------------------------------------
/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joejoe2/spring-video/05eddc3d3907d7a393c7d8e84165a8208d5aaf18/architecture.png
--------------------------------------------------------------------------------
/command.txt:
--------------------------------------------------------------------------------
1 | curl.exe -i -X POST -H "Content-Type:application/json" localhost:8071/connectors/ -d "@./connector-video-event.json"
2 | curl.exe -i -X POST -H "Content-Type:application/json" localhost:8071/connectors/ -d "@./connector-worker-event-result.json"
--------------------------------------------------------------------------------
/connector-video-event.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "spring-video-event-connector",
3 | "config": {
4 | "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
5 | "topic.prefix": "spring-video",
6 | "key.converter": "org.apache.kafka.connect.json.JsonConverter",
7 | "key.converter.schemas.enable": "false",
8 | "value.converter": "org.apache.kafka.connect.json.JsonConverter",
9 | "value.converter.schemas.enable": "false",
10 | "database.hostname": "video-db",
11 | "database.port": "5432",
12 | "database.user": "postgres",
13 | "database.password": "root_password",
14 | "database.dbname" : "spring-video",
15 | "database.server.name": "video-db",
16 | "table.include.list": "public.video_event",
17 | "message.key.columns": "public.video_event:video_id",
18 | "skipped.operations": "u,d,t"
19 | }
20 | }
--------------------------------------------------------------------------------
/connector-worker-event-result.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "spring-worker-event-result-connector",
3 | "config": {
4 | "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
5 | "topic.prefix": "spring-worker",
6 | "key.converter": "org.apache.kafka.connect.json.JsonConverter",
7 | "key.converter.schemas.enable": "false",
8 | "value.converter": "org.apache.kafka.connect.json.JsonConverter",
9 | "value.converter.schemas.enable": "false",
10 | "database.hostname": "worker-db",
11 | "database.port": "5432",
12 | "database.user": "postgres",
13 | "database.password": "root_password",
14 | "database.dbname" : "spring-worker",
15 | "database.server.name": "worker-db",
16 | "table.include.list": "public.video_event_result",
17 | "message.key.columns": "public.video_event_result:video_id",
18 | "skipped.operations": "u,d,t"
19 | }
20 | }
--------------------------------------------------------------------------------
/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 | video-db:
4 | image: debezium/postgres:15
5 | container_name: video-db
6 | hostname: video-db
7 | environment:
8 | POSTGRES_PASSWORD: root_password # please change it
9 | POSTGRES_DB: spring-video
10 | volumes:
11 | - ./postgresql/video-db:/var/lib/postgresql/data
12 | ports:
13 | - 5433:5432
14 | networks:
15 | - local
16 |
17 | worker-db:
18 | image: debezium/postgres:15
19 | container_name: worker-db
20 | hostname: worker-db
21 | environment:
22 | POSTGRES_PASSWORD: root_password # please change it
23 | POSTGRES_DB: spring-worker
24 | volumes:
25 | - ./postgresql/worker-db:/var/lib/postgresql/data
26 | ports:
27 | - 5434:5432
28 | networks:
29 | - local
30 |
31 | minio:
32 | image: minio/minio
33 | container_name: minio
34 | hostname: minio
35 | restart: always
36 | ports:
37 | - 9000:9000 # api
38 | - 9001:9001 # ui
39 | environment:
40 | MINIO_ROOT_USER: minio
41 | MINIO_ROOT_PASSWORD: root_password # please change it
42 | volumes:
43 | - ./minio/data:/data
44 | command: server --console-address ':9001' /data
45 | networks:
46 | - local
47 |
48 | zookeeper:
49 | image: debezium/zookeeper:2.2
50 | container_name: zookeeper
51 | restart: always
52 | ports:
53 | - 2181:2181
54 | - 2888:2888
55 | - 3888:3888
56 | environment:
57 | JMXPORT: 9010
58 | JMXHOST: zookeeper
59 | volumes:
60 | - ./zookeeper/data:/zookeeper/data
61 | - ./zookeeper/txns:/zookeeper/txns
62 | - ./zookeeper/log:/zookeeper/logs
63 | - ./zookeeper/conf:/zookeeper/conf
64 | networks:
65 | - local
66 |
67 | kafka1:
68 | image: debezium/kafka:2.2
69 | container_name: kafka1
70 | restart: always
71 | ports:
72 | - 9092:9092
73 | - 29092:29092
74 | environment:
75 | ZOOKEEPER_CONNECT: "zookeeper:2181"
76 | BOOTSTRAP_SERVERS: "kafka1:29092,kafka2:29093"
77 | ALLOW_PLAINTEXT_LISTENER: "yes"
78 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
79 | KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
80 | KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:29092,PLAINTEXT_HOST://0.0.0.0:9092
81 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092
82 | BROKER_ID: 1
83 | ADVERTISED_HOST_NAME: kafka1
84 | JMXPORT: 9011
85 | JMXHOST: kafka1
86 | depends_on:
87 | - zookeeper
88 | volumes:
89 | - ./kafka/kafka-1/data:/kafka/data
90 | - ./kafka/kafka-1/log:/kafka/log
91 | - ./kafka/kafka-1/config:/kafka/config
92 | networks:
93 | - local
94 |
95 | kafka2:
96 | image: debezium/kafka:2.2
97 | container_name: kafka2
98 | restart: always
99 | ports:
100 | - 9093:9093
101 | - 29093:29093
102 | environment:
103 | ZOOKEEPER_CONNECT: "zookeeper:2181"
104 | BOOTSTRAP_SERVERS: "kafka1:29092,kafka2:29093"
105 | ALLOW_PLAINTEXT_LISTENER: "yes"
106 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
107 | KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
108 | KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:29093,PLAINTEXT_HOST://0.0.0.0:9093
109 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29093,PLAINTEXT_HOST://localhost:9093
110 | BROKER_ID: 2
111 | ADVERTISED_HOST_NAME: kafka2
112 | JMXPORT: 9011
113 | JMXHOST: kafka2
114 | depends_on:
115 | - zookeeper
116 | volumes:
117 | - ./kafka/kafka-2/data:/kafka/data
118 | - ./kafka/kafka-2/log:/kafka/log
119 | - ./kafka/kafka-2/config:/kafka/config
120 | networks:
121 | - local
122 |
123 | kafka-ui:
124 | image: provectuslabs/kafka-ui
125 | container_name: kafka-ui
126 | ports:
127 | - "8070:8080"
128 | restart: always
129 | environment:
130 | KAFKA_CLUSTERS_0_NAME: "local"
131 | KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: "kafka1:29092,kafka2:29093"
132 | KAFKA_CLUSTERS_0_ZOOKEEPER: "zookeeper:2181"
133 | KAFKA_CLUSTERS_0_METRICS_PORT: 9011
134 | KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: connect
135 | KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://connect:8083
136 | networks:
137 | - local
138 |
139 | connect:
140 | image: debezium/connect:2.2
141 | container_name: connect
142 | restart: always
143 | ports:
144 | - 8071:8083
145 | environment:
146 | GROUP_ID: 1
147 | CONFIG_STORAGE_TOPIC: connect_configs
148 | OFFSET_STORAGE_TOPIC: connect_offsets
149 | STATUS_STORAGE_TOPIC: connect_statuses
150 | BOOTSTRAP_SERVERS: "kafka1:29092,kafka2:29093"
151 | JMXPORT: 9012
152 | JMXHOST: connect
153 | depends_on:
154 | - kafka1
155 | - kafka2
156 | networks:
157 | - local
158 |
159 | networks:
160 | local:
--------------------------------------------------------------------------------
/event.txt:
--------------------------------------------------------------------------------
1 | {
2 | "before": null,
3 | "after": {
4 | "id": "8c3c8d61-5251-493b-9246-255a5e98aad9",
5 | "operation": "PROCESS",
6 | "source": "minio.bucket.store://user/ec2c44ac-7446-4c75-b8ff-0e4746e5514c/test.mp4",
7 | "start_at": 1681459296200081,
8 | "user_id": "ec2c44ac-7446-4c75-b8ff-0e4746e5514c",
9 | "video_id": "47ecf9f4-1de5-4c82-bf21-70691f1b9a98"
10 | },
11 | "source": {
12 | "version": "2.2.0.Beta1",
13 | "connector": "postgresql",
14 | "name": "spring-video",
15 | "ts_ms": 1681459296204,
16 | "snapshot": "false",
17 | "db": "spring-video",
18 | "sequence": "[\"27700856\",\"27701736\"]",
19 | "schema": "public",
20 | "table": "video_event",
21 | "txId": 749,
22 | "lsn": 27701736,
23 | "xmin": null
24 | },
25 | "op": "c",
26 | "ts_ms": 1681459296711,
27 | "transaction": null
28 | }
29 |
30 | {
31 | "before": null,
32 | "after": {
33 | "id": "8c3c8d61-5251-493b-9246-255a5e98aad9",
34 | "complete_at": 1681459643525071,
35 | "detail": "user/ec2c44ac-7446-4c75-b8ff-0e4746e5514c/video/47ecf9f4-1de5-4c82-bf21-70691f1b9a98/",
36 | "operation": "PROCESS",
37 | "start_at": 1681459296200081,
38 | "status": "SUCCESS",
39 | "user_id": "ec2c44ac-7446-4c75-b8ff-0e4746e5514c",
40 | "video_id": "47ecf9f4-1de5-4c82-bf21-70691f1b9a98"
41 | },
42 | "source": {
43 | "version": "2.2.0.Beta1",
44 | "connector": "postgresql",
45 | "name": "spring-worker",
46 | "ts_ms": 1681459643544,
47 | "snapshot": "false",
48 | "db": "spring-worker",
49 | "sequence": "[\"27588200\",\"27588256\"]",
50 | "schema": "public",
51 | "table": "video_event_result",
52 | "txId": 739,
53 | "lsn": 27588256,
54 | "xmin": null
55 | },
56 | "op": "c",
57 | "ts_ms": 1681459643866,
58 | "transaction": null
59 | }
--------------------------------------------------------------------------------
/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /usr/local/etc/mavenrc ] ; then
40 | . /usr/local/etc/mavenrc
41 | fi
42 |
43 | if [ -f /etc/mavenrc ] ; then
44 | . /etc/mavenrc
45 | fi
46 |
47 | if [ -f "$HOME/.mavenrc" ] ; then
48 | . "$HOME/.mavenrc"
49 | fi
50 |
51 | fi
52 |
53 | # OS specific support. $var _must_ be set to either true or false.
54 | cygwin=false;
55 | darwin=false;
56 | mingw=false
57 | case "`uname`" in
58 | CYGWIN*) cygwin=true ;;
59 | MINGW*) mingw=true;;
60 | Darwin*) darwin=true
61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
63 | if [ -z "$JAVA_HOME" ]; then
64 | if [ -x "/usr/libexec/java_home" ]; then
65 | export JAVA_HOME="`/usr/libexec/java_home`"
66 | else
67 | export JAVA_HOME="/Library/Java/Home"
68 | fi
69 | fi
70 | ;;
71 | esac
72 |
73 | if [ -z "$JAVA_HOME" ] ; then
74 | if [ -r /etc/gentoo-release ] ; then
75 | JAVA_HOME=`java-config --jre-home`
76 | fi
77 | fi
78 |
79 | if [ -z "$M2_HOME" ] ; then
80 | ## resolve links - $0 may be a link to maven's home
81 | PRG="$0"
82 |
83 | # need this for relative symlinks
84 | while [ -h "$PRG" ] ; do
85 | ls=`ls -ld "$PRG"`
86 | link=`expr "$ls" : '.*-> \(.*\)$'`
87 | if expr "$link" : '/.*' > /dev/null; then
88 | PRG="$link"
89 | else
90 | PRG="`dirname "$PRG"`/$link"
91 | fi
92 | done
93 |
94 | saveddir=`pwd`
95 |
96 | M2_HOME=`dirname "$PRG"`/..
97 |
98 | # make it fully qualified
99 | M2_HOME=`cd "$M2_HOME" && pwd`
100 |
101 | cd "$saveddir"
102 | # echo Using m2 at $M2_HOME
103 | fi
104 |
105 | # For Cygwin, ensure paths are in UNIX format before anything is touched
106 | if $cygwin ; then
107 | [ -n "$M2_HOME" ] &&
108 | M2_HOME=`cygpath --unix "$M2_HOME"`
109 | [ -n "$JAVA_HOME" ] &&
110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
111 | [ -n "$CLASSPATH" ] &&
112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
113 | fi
114 |
115 | # For Mingw, ensure paths are in UNIX format before anything is touched
116 | if $mingw ; then
117 | [ -n "$M2_HOME" ] &&
118 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
119 | [ -n "$JAVA_HOME" ] &&
120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
121 | fi
122 |
123 | if [ -z "$JAVA_HOME" ]; then
124 | javaExecutable="`which javac`"
125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
126 | # readlink(1) is not available as standard on Solaris 10.
127 | readLink=`which readlink`
128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
129 | if $darwin ; then
130 | javaHome="`dirname \"$javaExecutable\"`"
131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
132 | else
133 | javaExecutable="`readlink -f \"$javaExecutable\"`"
134 | fi
135 | javaHome="`dirname \"$javaExecutable\"`"
136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
137 | JAVA_HOME="$javaHome"
138 | export JAVA_HOME
139 | fi
140 | fi
141 | fi
142 |
143 | if [ -z "$JAVACMD" ] ; then
144 | if [ -n "$JAVA_HOME" ] ; then
145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
146 | # IBM's JDK on AIX uses strange locations for the executables
147 | JAVACMD="$JAVA_HOME/jre/sh/java"
148 | else
149 | JAVACMD="$JAVA_HOME/bin/java"
150 | fi
151 | else
152 | JAVACMD="`\\unset -f command; \\command -v java`"
153 | fi
154 | fi
155 |
156 | if [ ! -x "$JAVACMD" ] ; then
157 | echo "Error: JAVA_HOME is not defined correctly." >&2
158 | echo " We cannot execute $JAVACMD" >&2
159 | exit 1
160 | fi
161 |
162 | if [ -z "$JAVA_HOME" ] ; then
163 | echo "Warning: JAVA_HOME environment variable is not set."
164 | fi
165 |
166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
167 |
168 | # traverses directory structure from process work directory to filesystem root
169 | # first directory with .mvn subdirectory is considered project base directory
170 | find_maven_basedir() {
171 |
172 | if [ -z "$1" ]
173 | then
174 | echo "Path not specified to find_maven_basedir"
175 | return 1
176 | fi
177 |
178 | basedir="$1"
179 | wdir="$1"
180 | while [ "$wdir" != '/' ] ; do
181 | if [ -d "$wdir"/.mvn ] ; then
182 | basedir=$wdir
183 | break
184 | fi
185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
186 | if [ -d "${wdir}" ]; then
187 | wdir=`cd "$wdir/.."; pwd`
188 | fi
189 | # end of workaround
190 | done
191 | echo "${basedir}"
192 | }
193 |
194 | # concatenates all lines of a file
195 | concat_lines() {
196 | if [ -f "$1" ]; then
197 | echo "$(tr -s '\n' ' ' < "$1")"
198 | fi
199 | }
200 |
201 | BASE_DIR=`find_maven_basedir "$(pwd)"`
202 | if [ -z "$BASE_DIR" ]; then
203 | exit 1;
204 | fi
205 |
206 | ##########################################################################################
207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
208 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
209 | ##########################################################################################
210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
211 | if [ "$MVNW_VERBOSE" = true ]; then
212 | echo "Found .mvn/wrapper/maven-wrapper.jar"
213 | fi
214 | else
215 | if [ "$MVNW_VERBOSE" = true ]; then
216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
217 | fi
218 | if [ -n "$MVNW_REPOURL" ]; then
219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
220 | else
221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
222 | fi
223 | while IFS="=" read key value; do
224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
225 | esac
226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
227 | if [ "$MVNW_VERBOSE" = true ]; then
228 | echo "Downloading from: $jarUrl"
229 | fi
230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
231 | if $cygwin; then
232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
233 | fi
234 |
235 | if command -v wget > /dev/null; then
236 | if [ "$MVNW_VERBOSE" = true ]; then
237 | echo "Found wget ... using wget"
238 | fi
239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
241 | else
242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
243 | fi
244 | elif command -v curl > /dev/null; then
245 | if [ "$MVNW_VERBOSE" = true ]; then
246 | echo "Found curl ... using curl"
247 | fi
248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
249 | curl -o "$wrapperJarPath" "$jarUrl" -f
250 | else
251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
252 | fi
253 |
254 | else
255 | if [ "$MVNW_VERBOSE" = true ]; then
256 | echo "Falling back to using Java to download"
257 | fi
258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
259 | # For Cygwin, switch paths to Windows format before running javac
260 | if $cygwin; then
261 | javaClass=`cygpath --path --windows "$javaClass"`
262 | fi
263 | if [ -e "$javaClass" ]; then
264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
265 | if [ "$MVNW_VERBOSE" = true ]; then
266 | echo " - Compiling MavenWrapperDownloader.java ..."
267 | fi
268 | # Compiling the Java class
269 | ("$JAVA_HOME/bin/javac" "$javaClass")
270 | fi
271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
272 | # Running the downloader
273 | if [ "$MVNW_VERBOSE" = true ]; then
274 | echo " - Running MavenWrapperDownloader.java ..."
275 | fi
276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
277 | fi
278 | fi
279 | fi
280 | fi
281 | ##########################################################################################
282 | # End of extension
283 | ##########################################################################################
284 |
285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
286 | if [ "$MVNW_VERBOSE" = true ]; then
287 | echo $MAVEN_PROJECTBASEDIR
288 | fi
289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
290 |
291 | # For Cygwin, switch paths to Windows format before running java
292 | if $cygwin; then
293 | [ -n "$M2_HOME" ] &&
294 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
295 | [ -n "$JAVA_HOME" ] &&
296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
297 | [ -n "$CLASSPATH" ] &&
298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
299 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
301 | fi
302 |
303 | # Provide a "standardized" way to retrieve the CLI args that will
304 | # work with both Windows and non-Windows executions.
305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
306 | export MAVEN_CMD_LINE_ARGS
307 |
308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
309 |
310 | exec "$JAVACMD" \
311 | $MAVEN_OPTS \
312 | $MAVEN_DEBUG_OPTS \
313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
314 | "-Dmaven.home=${M2_HOME}" \
315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
317 |
--------------------------------------------------------------------------------
/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
124 |
125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127 | )
128 |
129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131 | if exist %WRAPPER_JAR% (
132 | if "%MVNW_VERBOSE%" == "true" (
133 | echo Found %WRAPPER_JAR%
134 | )
135 | ) else (
136 | if not "%MVNW_REPOURL%" == "" (
137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
138 | )
139 | if "%MVNW_VERBOSE%" == "true" (
140 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
141 | echo Downloading from: %DOWNLOAD_URL%
142 | )
143 |
144 | powershell -Command "&{"^
145 | "$webclient = new-object System.Net.WebClient;"^
146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148 | "}"^
149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150 | "}"
151 | if "%MVNW_VERBOSE%" == "true" (
152 | echo Finished downloading %WRAPPER_JAR%
153 | )
154 | )
155 | @REM End of extension
156 |
157 | @REM Provide a "standardized" way to retrieve the CLI args that will
158 | @REM work with both Windows and non-Windows executions.
159 | set MAVEN_CMD_LINE_ARGS=%*
160 |
161 | %MAVEN_JAVA_EXE% ^
162 | %JVM_CONFIG_MAVEN_PROPS% ^
163 | %MAVEN_OPTS% ^
164 | %MAVEN_DEBUG_OPTS% ^
165 | -classpath %WRAPPER_JAR% ^
166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
168 | if ERRORLEVEL 1 goto error
169 | goto end
170 |
171 | :error
172 | set ERROR_CODE=1
173 |
174 | :end
175 | @endlocal & set ERROR_CODE=%ERROR_CODE%
176 |
177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
181 | :skipRcPost
182 |
183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause
185 |
186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
187 |
188 | cmd /C exit /B %ERROR_CODE%
189 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.7.9
9 |
10 |
11 | com.joejoe2
12 | video
13 | 0.0.1-SNAPSHOT
14 | storage
15 | Demo project for Spring Boot
16 |
17 | 17
18 | 1.17.6
19 |
20 |
21 |
22 | org.springframework.boot
23 | spring-boot-starter-data-jpa
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-data-redis
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-security
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-web
36 |
37 |
38 | org.springframework.boot
39 | spring-boot-starter-cache
40 |
41 |
42 | org.springframework.retry
43 | spring-retry
44 | 2.0.1
45 |
46 |
47 | io.jsonwebtoken
48 | jjwt-api
49 | 0.11.2
50 |
51 |
52 | io.jsonwebtoken
53 | jjwt-impl
54 | 0.11.2
55 | runtime
56 |
57 |
58 | io.jsonwebtoken
59 | jjwt-jackson
60 | 0.11.2
61 | runtime
62 |
63 |
64 | io.minio
65 | minio
66 | 8.5.2
67 |
68 |
69 | org.springframework.kafka
70 | spring-kafka
71 |
72 |
73 | org.springdoc
74 | springdoc-openapi-ui
75 | 1.6.9
76 |
77 |
78 |
79 | org.springframework.boot
80 | spring-boot-devtools
81 | runtime
82 | true
83 |
84 |
85 | org.postgresql
86 | postgresql
87 | runtime
88 |
89 |
90 | org.springframework.boot
91 | spring-boot-configuration-processor
92 | true
93 |
94 |
95 | org.projectlombok
96 | lombok
97 | true
98 |
99 |
100 | org.springframework.boot
101 | spring-boot-starter-test
102 | test
103 |
104 |
105 | org.mockito
106 | mockito-inline
107 | 4.4.0
108 | test
109 |
110 |
111 | org.springframework.security
112 | spring-security-test
113 | test
114 |
115 |
116 | org.testcontainers
117 | junit-jupiter
118 | test
119 |
120 |
121 | org.testcontainers
122 | postgresql
123 | test
124 |
125 |
126 |
127 |
128 |
129 | org.testcontainers
130 | testcontainers-bom
131 | ${testcontainers.version}
132 | pom
133 | import
134 |
135 |
136 |
137 |
138 |
139 | ${project.artifactId}
140 |
141 |
142 | org.springframework.boot
143 | spring-boot-maven-plugin
144 |
145 |
146 |
147 | org.projectlombok
148 | lombok
149 |
150 |
151 |
152 |
153 |
154 | com.diffplug.spotless
155 | spotless-maven-plugin
156 | 2.35.0
157 |
158 |
159 |
160 |
161 |
162 |
163 | .gitignore
164 |
165 |
166 |
167 |
168 |
169 | true
170 | 4
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | 1.16.0
181 |
182 | true
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/VideoApplication.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video;
2 |
3 | import java.util.Locale;
4 | import java.util.TimeZone;
5 | import javax.annotation.PostConstruct;
6 | import org.springframework.boot.SpringApplication;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.scheduling.annotation.EnableAsync;
9 |
10 | @SpringBootApplication
11 | @EnableAsync
12 | public class VideoApplication {
13 |
14 | public static void main(String[] args) {
15 | Locale.setDefault(Locale.ENGLISH);
16 | SpringApplication.run(VideoApplication.class, args);
17 | }
18 |
19 | @PostConstruct
20 | public void init() {
21 | TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/CacheConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.time.Duration;
4 | import org.springframework.cache.CacheManager;
5 | import org.springframework.cache.annotation.EnableCaching;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.data.redis.cache.RedisCacheConfiguration;
9 | import org.springframework.data.redis.cache.RedisCacheManager;
10 | import org.springframework.data.redis.connection.RedisConnectionFactory;
11 | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
12 | import org.springframework.data.redis.serializer.RedisSerializationContext;
13 | import org.springframework.data.redis.serializer.StringRedisSerializer;
14 |
15 | @Configuration
16 | @EnableCaching
17 | public class CacheConfig {
18 | @Bean
19 | public CacheManager cacheManager(RedisConnectionFactory lettuceConnectionFactory) {
20 | RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();
21 | defaultCacheConfig =
22 | defaultCacheConfig
23 | .entryTtl(Duration.ofMinutes(30))
24 | .serializeKeysWith(
25 | RedisSerializationContext.SerializationPair.fromSerializer(
26 | new StringRedisSerializer()))
27 | .serializeValuesWith(
28 | RedisSerializationContext.SerializationPair.fromSerializer(
29 | new GenericJackson2JsonRedisSerializer()))
30 | .disableCachingNullValues();
31 |
32 | return RedisCacheManager.builder(lettuceConnectionFactory)
33 | .cacheDefaults(defaultCacheConfig)
34 | .build();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/InterceptorConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import com.joejoe2.video.interceptor.ControllerConstraintInterceptor;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9 |
10 | @Configuration
11 | @EnableWebMvc
12 | public class InterceptorConfig implements WebMvcConfigurer {
13 | @Autowired ControllerConstraintInterceptor controllerConstraintInterceptor;
14 |
15 | @Override
16 | public void addInterceptors(InterceptorRegistry registry) {
17 | registry.addInterceptor(controllerConstraintInterceptor).addPathPatterns("/**");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/JwtConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.security.interfaces.RSAPublicKey;
4 | import lombok.Data;
5 | import org.springframework.beans.factory.annotation.Value;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | @Data
9 | @Configuration
10 | public class JwtConfig {
11 | @Value("${jwt.secret.publicKey}")
12 | private RSAPublicKey publicKey;
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/KafkaConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import org.apache.kafka.clients.admin.AdminClientConfig;
6 | import org.apache.kafka.clients.admin.NewTopic;
7 | import org.apache.kafka.clients.consumer.ConsumerConfig;
8 | import org.apache.kafka.common.serialization.StringDeserializer;
9 | import org.springframework.beans.factory.annotation.Value;
10 | import org.springframework.context.annotation.Bean;
11 | import org.springframework.context.annotation.Configuration;
12 | import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
13 | import org.springframework.kafka.core.ConsumerFactory;
14 | import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
15 | import org.springframework.kafka.core.KafkaAdmin;
16 | import org.springframework.kafka.listener.ContainerProperties;
17 |
18 | @Configuration
19 | public class KafkaConfig {
20 |
21 | @Value(value = "${kafka.bootstrapServers:localhost:9092}")
22 | private String bootstrapAddress;
23 |
24 | @Bean
25 | public KafkaAdmin kafkaAdmin() {
26 | Map configs = new HashMap<>();
27 | configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress);
28 | return new KafkaAdmin(configs);
29 | }
30 |
31 | @Bean
32 | public ConsumerFactory consumerFactory() {
33 | HashMap props = new HashMap<>();
34 | props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress);
35 | props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
36 | props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
37 | props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
38 | props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
39 | return new DefaultKafkaConsumerFactory<>(props);
40 | }
41 |
42 | @Bean
43 | public ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory() {
44 |
45 | ConcurrentKafkaListenerContainerFactory factory =
46 | new ConcurrentKafkaListenerContainerFactory<>();
47 | factory.setConsumerFactory(consumerFactory());
48 | factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);
49 | return factory;
50 | }
51 |
52 | @Bean
53 | public NewTopic videoEventTopic() {
54 | return new NewTopic("spring-video.public.video_event", 2, (short) 2);
55 | }
56 |
57 | @Bean
58 | public NewTopic videoEventResultTopic() {
59 | return new NewTopic("spring-worker.public.video_event_result", 2, (short) 2);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/ObjectStorageConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import io.minio.BucketExistsArgs;
4 | import io.minio.MakeBucketArgs;
5 | import io.minio.MinioClient;
6 | import lombok.Data;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 | import org.springframework.beans.factory.annotation.Value;
10 | import org.springframework.context.annotation.Bean;
11 | import org.springframework.context.annotation.Configuration;
12 |
13 | @Configuration
14 | @Data
15 | public class ObjectStorageConfiguration {
16 | @Value("${minio.access-key}")
17 | private String accessKey;
18 |
19 | @Value("${minio.secret-key}")
20 | private String secretKey;
21 |
22 | @Value("${minio.url}")
23 | private String url;
24 |
25 | @Value("${minio.bucket.store}")
26 | private String storeBucket;
27 |
28 | @Value("${minio.bucket.stream}")
29 | private String streamBucket;
30 |
31 | private static final Logger logger = LoggerFactory.getLogger(ObjectStorageConfiguration.class);
32 |
33 | @Bean
34 | public MinioClient minioClient() throws Exception {
35 | MinioClient minioClient =
36 | MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
37 | initBucket(minioClient, storeBucket);
38 | initBucket(minioClient, streamBucket);
39 | return minioClient;
40 | }
41 |
42 | private void initBucket(MinioClient minioClient, String bucket) throws Exception {
43 | boolean exists = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucket).build());
44 | if (!exists) {
45 | minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build());
46 | logger.info("successfully create bucket {} !", bucket);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/PrivateKeyConverter.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.security.KeyFactory;
4 | import java.security.PrivateKey;
5 | import java.security.spec.PKCS8EncodedKeySpec;
6 | import java.util.Base64;
7 | import lombok.SneakyThrows;
8 | import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
9 | import org.springframework.core.convert.converter.Converter;
10 | import org.springframework.stereotype.Component;
11 |
12 | @Component
13 | @ConfigurationPropertiesBinding
14 | public class PrivateKeyConverter implements Converter {
15 | @SneakyThrows
16 | @Override
17 | public PrivateKey convert(String from) {
18 | byte[] bytes = Base64.getDecoder().decode(from.getBytes());
19 | PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(bytes);
20 | KeyFactory factory = KeyFactory.getInstance("RSA");
21 | return factory.generatePrivate(spec);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/PublicKeyConverter.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.security.PublicKey;
5 | import lombok.SneakyThrows;
6 | import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
7 | import org.springframework.core.convert.converter.Converter;
8 | import org.springframework.security.converter.RsaKeyConverters;
9 | import org.springframework.stereotype.Component;
10 |
11 | @Component
12 | @ConfigurationPropertiesBinding
13 | public class PublicKeyConverter implements Converter {
14 | @SneakyThrows
15 | @Override
16 | public PublicKey convert(String from) {
17 | return RsaKeyConverters.x509().convert(new ByteArrayInputStream(from.getBytes()));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import java.util.Map;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 | import org.springframework.data.redis.connection.RedisConnectionFactory;
8 | import org.springframework.data.redis.core.RedisTemplate;
9 | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
10 | import org.springframework.data.redis.serializer.StringRedisSerializer;
11 |
12 | @Configuration
13 | public class RedisConfig {
14 | @Autowired RedisConnectionFactory redisConnectionFactory;
15 |
16 | @Bean
17 | public RedisTemplate> hashRedisTemplate() {
18 | RedisTemplate> redisTemplate = new RedisTemplate<>();
19 | redisTemplate.setConnectionFactory(redisConnectionFactory);
20 | redisTemplate.setKeySerializer(new StringRedisSerializer());
21 | redisTemplate.setHashKeySerializer(new StringRedisSerializer());
22 | redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
23 | redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
24 | redisTemplate.afterPropertiesSet();
25 | return redisTemplate;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/RetryConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.core.Ordered;
5 | import org.springframework.retry.annotation.EnableRetry;
6 |
7 | @Configuration
8 | @EnableRetry(order = Ordered.HIGHEST_PRECEDENCE)
9 | public class RetryConfig {}
10 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/SecurityConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import com.joejoe2.video.filter.JwtAuthenticationFilter;
4 | import com.joejoe2.video.service.user.auth.UserDetailService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.security.authentication.AuthenticationManager;
8 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
9 | import org.springframework.security.config.annotation.web.builders.HttpSecurity;
10 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
11 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
12 | import org.springframework.security.config.http.SessionCreationPolicy;
13 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
14 | import org.springframework.security.crypto.password.PasswordEncoder;
15 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
16 | import org.springframework.web.cors.CorsConfiguration;
17 | import org.springframework.web.cors.CorsConfigurationSource;
18 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
19 |
20 | @EnableWebSecurity
21 | public class SecurityConfig extends WebSecurityConfigurerAdapter {
22 | @Autowired UserDetailService userDetailService;
23 | @Autowired JwtAuthenticationFilter jwtAuthenticationFilter;
24 |
25 | @Bean
26 | PasswordEncoder passwordEncoder() {
27 | return new BCryptPasswordEncoder();
28 | }
29 |
30 | @Override
31 | protected void configure(HttpSecurity http) throws Exception {
32 | // blank will allow any request
33 | http.cors()
34 | .and()
35 | .csrf()
36 | .disable()
37 | .sessionManagement()
38 | .sessionCreationPolicy(SessionCreationPolicy.NEVER) // use jwt instead of session
39 | .and()
40 | .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
41 | .formLogin()
42 | .disable();
43 | }
44 |
45 | @Override
46 | protected void configure(AuthenticationManagerBuilder auth) throws Exception {
47 | auth.userDetailsService(userDetailService).passwordEncoder(passwordEncoder());
48 | }
49 |
50 | @Override
51 | @Bean
52 | public AuthenticationManager authenticationManagerBean() throws Exception {
53 | return super.authenticationManagerBean();
54 | }
55 |
56 | @Bean
57 | CorsConfigurationSource corsConfigurationSource() {
58 | CorsConfiguration apiConfiguration = new CorsConfiguration();
59 | apiConfiguration.addAllowedOrigin("*");
60 | apiConfiguration.addAllowedHeader("*");
61 | apiConfiguration.addAllowedMethod("*");
62 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
63 | source.registerCorsConfiguration("/api/**", apiConfiguration);
64 | return source;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/SpringDocConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import io.swagger.v3.oas.annotations.OpenAPIDefinition;
4 | import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
5 | import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
6 | import io.swagger.v3.oas.annotations.info.Info;
7 | import io.swagger.v3.oas.annotations.security.SecurityScheme;
8 | import org.springframework.context.annotation.Configuration;
9 |
10 | @OpenAPIDefinition(info = @Info(title = "Spring Video API", version = "v0.0.1"))
11 | @SecurityScheme(
12 | name = "jwt",
13 | scheme = "bearer",
14 | bearerFormat = "jwt",
15 | type = SecuritySchemeType.HTTP,
16 | in = SecuritySchemeIn.HEADER)
17 | @Configuration
18 | public class SpringDocConfig {}
19 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/StreamConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | @Data
8 | @Configuration
9 | public class StreamConfig {
10 | @Value("${server.stream.prefix:http://localhost:8082/api/video/}")
11 | private String prefix;
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/config/StringTrimConfig.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.config;
2 |
3 | import com.fasterxml.jackson.core.JsonParser;
4 | import com.fasterxml.jackson.databind.DeserializationContext;
5 | import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
6 | import java.io.IOException;
7 | import org.springframework.beans.propertyeditors.StringTrimmerEditor;
8 | import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
9 | import org.springframework.context.annotation.Bean;
10 | import org.springframework.context.annotation.Configuration;
11 | import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
12 | import org.springframework.util.StringUtils;
13 | import org.springframework.web.bind.WebDataBinder;
14 | import org.springframework.web.bind.annotation.ControllerAdvice;
15 | import org.springframework.web.bind.annotation.InitBinder;
16 |
17 | @Configuration
18 | public class StringTrimConfig {
19 |
20 | @ControllerAdvice
21 | public static class ControllerStringParamTrimConfig {
22 | @InitBinder
23 | public void initBinder(WebDataBinder binder) {
24 | StringTrimmerEditor propertyEditor = new StringTrimmerEditor(false);
25 | binder.registerCustomEditor(String.class, propertyEditor);
26 | }
27 | }
28 |
29 | @Bean
30 | public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
31 | return new Jackson2ObjectMapperBuilderCustomizer() {
32 | @Override
33 | public void customize(Jackson2ObjectMapperBuilder jacksonObjectMapperBuilder) {
34 | jacksonObjectMapperBuilder.deserializerByType(
35 | String.class,
36 | new StdScalarDeserializer(String.class) {
37 | @Override
38 | public String deserialize(JsonParser jsonParser, DeserializationContext ctx)
39 | throws IOException {
40 | return StringUtils.trimWhitespace(jsonParser.getValueAsString());
41 | }
42 | });
43 | }
44 | };
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/joejoe2/video/controller/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.joejoe2.video.controller;
2 |
3 | import com.joejoe2.video.data.ErrorMessageResponse;
4 | import com.joejoe2.video.data.InvalidRequestResponse;
5 | import io.swagger.v3.oas.annotations.media.Content;
6 | import io.swagger.v3.oas.annotations.media.ExampleObject;
7 | import io.swagger.v3.oas.annotations.media.Schema;
8 | import io.swagger.v3.oas.annotations.responses.ApiResponse;
9 | import java.util.HashMap;
10 | import java.util.Map;
11 | import java.util.TreeSet;
12 | import org.springframework.http.HttpHeaders;
13 | import org.springframework.http.HttpStatus;
14 | import org.springframework.http.ResponseEntity;
15 | import org.springframework.http.converter.HttpMessageNotReadableException;
16 | import org.springframework.validation.BindException;
17 | import org.springframework.validation.FieldError;
18 | import org.springframework.web.bind.MethodArgumentNotValidException;
19 | import org.springframework.web.bind.annotation.ControllerAdvice;
20 | import org.springframework.web.bind.annotation.ExceptionHandler;
21 | import org.springframework.web.context.request.WebRequest;
22 | import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
23 |
24 | @ControllerAdvice
25 | public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
26 |
27 | @Override
28 | protected ResponseEntity