mirror of
https://git.hmsn.ink/kospo/helptalk/api.git
synced 2026-03-19 19:25:11 +09:00
버그 수정
This commit is contained in:
17
build.gradle
17
build.gradle
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'org.springframework.boot' version '3.3.2'
|
id 'org.springframework.boot' version '3.5.6'
|
||||||
id 'io.spring.dependency-management' version '1.1.6'
|
id 'io.spring.dependency-management' version '1.1.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,6 +19,19 @@ configurations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ✅ Spring Boot 실행 시 JVM 옵션
|
||||||
|
bootRun {
|
||||||
|
jvmArgs = [
|
||||||
|
'-Xms32g',
|
||||||
|
'-Xmx32g',
|
||||||
|
'-XX:+UseZGC',
|
||||||
|
'-XX:+ZGenerational',
|
||||||
|
'-XX:MaxMetaspaceSize=512m',
|
||||||
|
'-XX:+ZUncommit',
|
||||||
|
'-XX:ZUncommitDelay=300'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
@@ -37,6 +50,8 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-reactor-netty'
|
implementation 'org.springframework.boot:spring-boot-starter-reactor-netty'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-webflux'
|
implementation 'org.springframework.boot:spring-boot-starter-webflux'
|
||||||
|
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-parent:3.5.6'
|
||||||
implementation 'org.springframework.retry:spring-retry:2.0.8'
|
implementation 'org.springframework.retry:spring-retry:2.0.8'
|
||||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
|
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
|
||||||
|
|
||||||
|
|||||||
@@ -144,9 +144,7 @@
|
|||||||
serviceWorkerLocation: `./service-worker.js?v=1.05`, // 서비스워커 교체시 v=1.06 버전 변경
|
serviceWorkerLocation: `./service-worker.js?v=1.05`, // 서비스워커 교체시 v=1.06 버전 변경
|
||||||
encSabun: 'h0VFCEwCVSn9SBCunLhGPWMgqQjf7h8CQ+ca7q43GRTmdr8QT1LK1uWOGZnDE6JzG/GULHGarfrOUve6qUOQAoOqOlYg2quU4Zy9bM1TG5jMH4aMp+yo5cRBXM5eJr+7oI78XE7m3pmebFZf6YEi77Xm5BtxSW436jrrOzfeEbHDDYVxOMd9Km5fOcNuLtDLDGKdhllA4w0Zv/xBfgQLJ1oC1+zo3PxGWOI5ypXDnDqUOmAldnHZEx4wM+gf7ZqHX4qiJ4tV+0baXrUuy43iA5XbnJ17s/gAk1oafG2MBL5N0n2aOJ6+367CKE2yditqEUPronrNWqwAHZiG5K8dHg=='
|
encSabun: 'h0VFCEwCVSn9SBCunLhGPWMgqQjf7h8CQ+ca7q43GRTmdr8QT1LK1uWOGZnDE6JzG/GULHGarfrOUve6qUOQAoOqOlYg2quU4Zy9bM1TG5jMH4aMp+yo5cRBXM5eJr+7oI78XE7m3pmebFZf6YEi77Xm5BtxSW436jrrOzfeEbHDDYVxOMd9Km5fOcNuLtDLDGKdhllA4w0Zv/xBfgQLJ1oC1+zo3PxGWOI5ypXDnDqUOmAldnHZEx4wM+gf7ZqHX4qiJ4tV+0baXrUuy43iA5XbnJ17s/gAk1oafG2MBL5N0n2aOJ6+367CKE2yditqEUPronrNWqwAHZiG5K8dHg=='
|
||||||
})
|
})
|
||||||
talk.run().then(() => {
|
talk.run()
|
||||||
console.log(1)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const startBtn = document.querySelector('#talk-start-btn');
|
const startBtn = document.querySelector('#talk-start-btn');
|
||||||
|
|||||||
@@ -142,11 +142,9 @@
|
|||||||
activeColor: '#fff', // optional
|
activeColor: '#fff', // optional
|
||||||
},
|
},
|
||||||
serviceWorkerLocation: `./service-worker.js?v=1.05`, // 서비스워커 교체시 v=1.06 버전 변경
|
serviceWorkerLocation: `./service-worker.js?v=1.05`, // 서비스워커 교체시 v=1.06 버전 변경
|
||||||
encSabun: 'h0VFCEwCVSn9SBCunLhGPWMgqQjf7h8CQ+ca7q43GRTmdr8QT1LK1uWOGZnDE6JzG/GULHGarfrOUve6qUOQAoOqOlYg2quU4Zy9bM1TG5jMH4aMp+yo5cRBXM5eJr+7oI78XE7m3pmebFZf6YEi77Xm5BtxSW436jrrOzfeEbHDDYVxOMd9Km5fOcNuLtDLDGKdhllA4w0Zv/xBfgQLJ1oC1+zo3PxGWOI5ypXDnDqUOmAldnHZEx4wM+gf7ZqHX4qiJ4tV+0baXrUuy43iA5XbnJ17s/gAk1oafG2MBL5N0n2aOJ6+367CKE2yditqEUPronrNWqwAHZiG5K8dHg=='
|
encSabun: 'Xqx6thmfy42Jcr0rAZkN3QWpNO7o25pzU7qrXXSCjexLmubXSKHKWozgwzaOMNsIUtZKmBeQuWeMyuxV33JXvWdJ7TKdcOSjJDLFDayT5st+Kx09nyw75qH7Yt5zO/MhVYuA7Iszt8ANrI+GC5Issey4ZYo8gvNvfCkft4hEPr3mClLg7m8LZg723GJI606f8O1yNKnkIPexReeYBxAF7MYp0OvMrP6GoU4nfwwCAZyexuW+56256BtrBoPcaBPs8EFhkbrsQAUBG8TEwNM8uA0eN0DOz9iICrwoUU/Q+hWcNjkKuFenOX13E+Dx2scwKYDN0uTFjoIUpwvt2WAUvQ=='
|
||||||
})
|
|
||||||
talk.run().then(() => {
|
|
||||||
console.log(1)
|
|
||||||
})
|
})
|
||||||
|
talk.run()
|
||||||
|
|
||||||
|
|
||||||
const startBtn = document.querySelector('#talk-start-btn');
|
const startBtn = document.querySelector('#talk-start-btn');
|
||||||
|
|||||||
@@ -157,10 +157,10 @@ const talkEvent = {
|
|||||||
},
|
},
|
||||||
// 개인 사번 구독
|
// 개인 사번 구독
|
||||||
userSubscribe: () => {
|
userSubscribe: () => {
|
||||||
return global.stomp.subscribe(`/exchange/user.exchange/user.${global.user.sabun}`, async function (content) {
|
const sessionId = talkEvent.generateTabUUID()
|
||||||
|
return global.stomp.subscribe(`/exchange/user.exchange/user.${global.user.sabun}.${sessionId}`, async function (content) {
|
||||||
const payload = JSON.parse(content.body);
|
const payload = JSON.parse(content.body);
|
||||||
if(payload.type === 'DEAD_MESSAGE') {
|
if(payload.type === 'DEAD_MESSAGE') {
|
||||||
console.log('asdfasdfasdfasdfasdf');
|
|
||||||
global.shadowRoot.querySelector('.socket-error').classList.remove('cus-hide')
|
global.shadowRoot.querySelector('.socket-error').classList.remove('cus-hide')
|
||||||
} else {
|
} else {
|
||||||
console.log('userSubscribe', payload)
|
console.log('userSubscribe', payload)
|
||||||
@@ -181,9 +181,9 @@ const talkEvent = {
|
|||||||
},
|
},
|
||||||
// 업무 구독
|
// 업무 구독
|
||||||
workSubscribe: () => {
|
workSubscribe: () => {
|
||||||
return global.stomp.subscribe(`/exchange/work.exchange/work.${global.work.workId}`, async function (content) {
|
const sessionId = talkEvent.generateTabUUID()
|
||||||
|
return global.stomp.subscribe(`/exchange/work.exchange/work.${global.work.workId}.${sessionId}`, async function (content) {
|
||||||
const payload = JSON.parse(content.body);
|
const payload = JSON.parse(content.body);
|
||||||
console.log('workSubscribe', payload)
|
|
||||||
let sendFlag = false;
|
let sendFlag = false;
|
||||||
while (!sendFlag) {
|
while (!sendFlag) {
|
||||||
if (global.serviceWorkerConnect) {
|
if (global.serviceWorkerConnect) {
|
||||||
|
|||||||
@@ -6,13 +6,8 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.messaging.simp.broker.SubscriptionRegistry;
|
import org.springframework.messaging.simp.broker.SubscriptionRegistry;
|
||||||
import org.springframework.security.core.session.SessionRegistry;
|
import org.springframework.security.core.session.SessionRegistry;
|
||||||
import org.springframework.web.socket.WebSocketSession;
|
|
||||||
import org.springframework.web.socket.messaging.SessionConnectedEvent;
|
|
||||||
import org.springframework.web.socket.messaging.SessionDisconnectEvent;
|
import org.springframework.web.socket.messaging.SessionDisconnectEvent;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CustomMessageListener {
|
public class CustomMessageListener {
|
||||||
@@ -29,8 +24,13 @@ public class CustomMessageListener {
|
|||||||
|
|
||||||
@EventListener
|
@EventListener
|
||||||
public void handleDisconnect(SessionDisconnectEvent event) {
|
public void handleDisconnect(SessionDisconnectEvent event) {
|
||||||
|
|
||||||
System.out.println("handleDisconnect : " + event.getSessionId());
|
System.out.println("handleDisconnect : " + event.getSessionId());
|
||||||
subscriptionRegistry.unregisterAllSubscriptions(event.getSessionId());
|
try {
|
||||||
|
subscriptionRegistry.unregisterAllSubscriptions(event.getSessionId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
sessionRegistry.removeSessionInformation(event.getSessionId());
|
sessionRegistry.removeSessionInformation(event.getSessionId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class SecurityConfig {
|
|||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
String origin = request.getHeader("Origin");
|
String origin = request.getHeader("Origin");
|
||||||
config.setAllowCredentials(true);
|
config.setAllowCredentials(true);
|
||||||
config.setAllowedOrigins(Arrays.asList("http://kisp.kospo.co.kr:8010", "http://localhost:8010"));
|
config.setAllowedOrigins(Arrays.asList("http://kisp.kospo.co.kr:8010", "http://localhost:8010", "http://talk.kospo.co.kr:3000"));
|
||||||
config.setAllowedMethods(Arrays.asList("POST","GET","DELETE","PUT","OPTIONS"));
|
config.setAllowedMethods(Arrays.asList("POST","GET","DELETE","PUT","OPTIONS"));
|
||||||
config.setAllowedHeaders(Arrays.asList("*"));
|
config.setAllowedHeaders(Arrays.asList("*"));
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.kospo.talk.config.utils;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ApplicationContextProvider implements ApplicationContextAware {
|
||||||
|
|
||||||
|
private static ApplicationContext context;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
context = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApplicationContext getApplicationContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T getBean(Class<T> beanClass) {
|
||||||
|
return context.getBean(beanClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev # 운영 prod 개발 dev
|
active: prod # 운영 prod 개발 dev
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
log.config.path=./logs/
|
log.config.path=./logs/
|
||||||
log.config.filename=api_log
|
log.config.filename=api_log
|
||||||
#log.level=debug
|
log.level=debug
|
||||||
log.level=warn
|
#log.level=warn
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,12 @@
|
|||||||
</root>
|
</root>
|
||||||
|
|
||||||
<!-- 특정패키지 로깅레벨 설정 -->
|
<!-- 특정패키지 로깅레벨 설정 -->
|
||||||
<logger name="org.springframework" level="warn" additivity="false">
|
<logger name="org.springframework" level="off" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
|
<appender-ref ref="FILE"/>
|
||||||
|
<appender-ref ref="Error"/>
|
||||||
|
</logger>
|
||||||
|
<logger name="org.springframework.messaging.simp" level="debug" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="FILE"/>
|
<appender-ref ref="FILE"/>
|
||||||
<appender-ref ref="Error"/>
|
<appender-ref ref="Error"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user