File tree 5 files changed +135
-0
lines changed
main/java/newCar/socket_app
test/java/newCar/socket_app
5 files changed +135
-0
lines changed Original file line number Diff line number Diff line change
1
+ HELP.md
2
+ .gradle
3
+ build /
4
+ ! gradle /wrapper /gradle-wrapper.jar
5
+ ! ** /src /main /** /build /
6
+ ! ** /src /test /** /build /
7
+
8
+ # ## yml ###
9
+ ** /src /main /resources /application.yml
10
+ ** /src /main /resources /application-local.yml
11
+
12
+ # ## STS ###
13
+ .apt_generated
14
+ .classpath
15
+ .factorypath
16
+ .project
17
+ .settings
18
+ .springBeans
19
+ .sts4-cache
20
+ bin /
21
+ ! ** /src /main /** /bin /
22
+ ! ** /src /test /** /bin /
23
+
24
+ # ## IntelliJ IDEA ###
25
+ .idea
26
+ * .iws
27
+ * .iml
28
+ * .ipr
29
+ out /
30
+ ! ** /src /main /** /out /
31
+ ! ** /src /test /** /out /
32
+
33
+ # ## NetBeans ###
34
+ /nbproject /private /
35
+ /nbbuild /
36
+ /dist /
37
+ /nbdist /
38
+ /.nb-gradle /
39
+
40
+ # ## VS Code ###
41
+ .vscode /
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id ' java'
3
+ id ' org.springframework.boot' version ' 3.3.2'
4
+ id ' io.spring.dependency-management' version ' 1.1.6'
5
+ }
6
+
7
+ group = ' newCar'
8
+ version = ' 0.0.1-SNAPSHOT'
9
+
10
+ java {
11
+ toolchain {
12
+ languageVersion = JavaLanguageVersion . of(17 )
13
+ }
14
+ }
15
+
16
+ configurations {
17
+ compileOnly {
18
+ extendsFrom annotationProcessor
19
+ }
20
+ }
21
+
22
+ repositories {
23
+ mavenCentral()
24
+ }
25
+
26
+ dependencies {
27
+ implementation ' org.springframework.boot:spring-boot-starter-data-redis'
28
+ implementation ' org.springframework.boot:spring-boot-starter-web'
29
+ implementation ' org.springframework.boot:spring-boot-starter-websocket'
30
+ implementation ' org.springframework.boot:spring-boot-starter-validation'
31
+ compileOnly ' org.projectlombok:lombok'
32
+ annotationProcessor ' org.projectlombok:lombok'
33
+ testImplementation ' org.springframework.boot:spring-boot-starter-test'
34
+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
35
+
36
+
37
+ implementation ' org.springframework.boot:spring-boot-starter-data-redis'
38
+ implementation ' redis.clients:jedis:5.1.4'
39
+ implementation ' software.amazon.awssdk:sns:2.27.1'
40
+ }
41
+
42
+ tasks. named(' test' ) {
43
+ useJUnitPlatform()
44
+ }
Original file line number Diff line number Diff line change
1
+ package newCar .socket_app ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+
6
+ @ SpringBootApplication
7
+ public class SocketAppApplication {
8
+
9
+ public static void main (String [] args ) {
10
+ SpringApplication .run (SocketAppApplication .class , args );
11
+ }
12
+
13
+ }
Original file line number Diff line number Diff line change
1
+ package newCar .socket_app .config ;
2
+
3
+ import org .springframework .context .annotation .Configuration ;
4
+ import org .springframework .messaging .simp .config .MessageBrokerRegistry ;
5
+ import org .springframework .web .socket .config .annotation .EnableWebSocketMessageBroker ;
6
+ import org .springframework .web .socket .config .annotation .StompEndpointRegistry ;
7
+ import org .springframework .web .socket .config .annotation .WebSocketMessageBrokerConfigurer ;
8
+
9
+ @ Configuration
10
+ @ EnableWebSocketMessageBroker
11
+ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
12
+
13
+ @ Override //STOMP 엔드포인트 설정
14
+ public void registerStompEndpoints (StompEndpointRegistry registry ) {
15
+ registry .addEndpoint ("/ws" ).setAllowedOriginPatterns ("*" ).withSockJS ();
16
+ }
17
+
18
+ @ Override //메시지를 라우팅
19
+ public void configureMessageBroker (MessageBrokerRegistry registry ) {
20
+ registry .enableSimpleBroker ("/topic" );
21
+ registry .setApplicationDestinationPrefixes ("/app" );
22
+ }
23
+ }
24
+
Original file line number Diff line number Diff line change
1
+ package newCar .socket_app ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+ import org .springframework .boot .test .context .SpringBootTest ;
5
+
6
+ @ SpringBootTest
7
+ class SocketAppApplicationTests {
8
+
9
+ @ Test
10
+ void contextLoads () {
11
+ }
12
+
13
+ }
You can’t perform that action at this time.
0 commit comments