diff --git a/src/main/java/com/khpt/projectkim/controller/api/ChatRestController.java b/src/main/java/com/khpt/projectkim/controller/api/ChatRestController.java index 6c89631..bf9bd8a 100644 --- a/src/main/java/com/khpt/projectkim/controller/api/ChatRestController.java +++ b/src/main/java/com/khpt/projectkim/controller/api/ChatRestController.java @@ -65,6 +65,7 @@ public class ChatRestController { @PostConstruct public void init() { this.openAiService = new OpenAiService(token); + discordWebhookService.queueStatusLog("Server start up"); } @PostMapping("/example") @@ -274,10 +275,10 @@ public SseEmitter getChatEvents(HttpSession session, HttpServletResponse respons ChatMessageRole.SYSTEM.value(), "Below is job_code_table." )); - chatMessages.add(new ChatMessage( - ChatMessageRole.SYSTEM.value(), - CsvReader.getDetailedJobCode(user.getCategory()) - )); +// chatMessages.add(new ChatMessage( +// ChatMessageRole.SYSTEM.value(), +// CsvReader.getDetailedJobCode(user.getCategory()) +// )); chatMessages.add(accumulatedMessage); chatMessages.add(callResponse); diff --git a/src/main/java/com/khpt/projectkim/service/DiscordWebhookService.java b/src/main/java/com/khpt/projectkim/service/DiscordWebhookService.java index b93f952..5deb86a 100644 --- a/src/main/java/com/khpt/projectkim/service/DiscordWebhookService.java +++ b/src/main/java/com/khpt/projectkim/service/DiscordWebhookService.java @@ -68,6 +68,16 @@ public void queueErrorLog(String userId, String message, Throwable e) { errorLogQueue.add(embed); } + public void queueStatusLog(String message) { + DiscordWebhook.EmbedObject embed = new DiscordWebhook.EmbedObject() + .setTitle("김비서 상태") + .setColor(Color.LIGHT_GRAY) + .addField("message", message, false) + .setFooter(sdf.format(new Date()), ""); + + errorLogQueue.add(embed); + } + public void queueChatLog(String userId, String userName, String message) { if (message.length() > 300) { message = message.substring(0, 300);