This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 반환될_채팅_메시지_정보 FROM ( | |
SELECT TOP(50) 채팅_메시지_정보 | |
FROM [채팅_메시지_테이블] AS [c] | |
WHERE [c].[채팅방_ID] = (찾을_채팅방_ID) | |
ORDER BY [c].[전송_시각] DESC | |
) AS [t] | |
LEFT JOIN [채팅방_참여자_정보] AS [c0] ON [t].[채팅방_참여자_정보_ID] = [c0].[Id] | |
ORDER BY [t].[전송_시각] DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 채팅방 정보를 가져오기 */ | |
SELECT TOP(1) 채팅방 참여자 정보 | |
FROM 채팅방 참여자 정보 테이블 | |
WHERE (채팅방 참여자 정보의 챗봇 = 사전 정의 된 챗봇) OR (채팅방 참여자 정보 = 요청을 보낸 참여자) | |
GROUP BY 채팅방 참여자 정보 테이블에 있는 채팅방 ID | |
HAVING COUNT(*) = 2; | |
/* 봇이 참여하고 있는 '채팅방 참여자 정보' 가져오기 */ | |
SELECT TOP(1) 채팅방 참여자 정보 | |
FROM 채팅방 참여자 정보 테이블 AS [c] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 채팅방 정보를 가져오기 | |
var roomId = await database.ChatRoomParticipants | |
.Where(p => p.ChatbotId == bot.Id || p.UserId == user.Id) | |
.GroupBy(p => p.RoomId) | |
.Where(g => g.Count() == 2) | |
.Select(g => g.Key) | |
.FirstOrDefaultAsync() ?? await CreateAndGetRoomId(bot, user, database); | |
// 봇이 참여하고 있는 '채팅방 참여자 정보' 가져오기 | |
var chatroomParticipantId = await database.ChatRoomParticipants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 채팅방 정보 불러오기 */ | |
SELECT [채팅방_정보], [채팅방_참여자_정보] | |
FROM ( | |
SELECT TOP(1) [채팅방_정보] | |
FROM [채팅방_테이블] AS [채팅방] | |
WHERE (( | |
SELECT COUNT(*) | |
FROM [채팅방_참여자_테이블] AS [참여자1] | |
WHERE ([채팅방].[Id] = [참여자1].[채팅방Id]) AND (([참여자1].[챗봇Id] = '챗봇ID') OR ([참여자1].[사용자Id] = '사용자ID'))) = 2) AND (( | |
SELECT COUNT(*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 채팅방 정보 불러오기 | |
var room = await database.ChatRooms | |
.Include(r => r.Participants) | |
.ThenInclude(p => p.Chatbot) | |
.FirstOrDefaultAsync(r => | |
r.Participants.Count(p => p.ChatbotId == botId || p.UserId == user.Id) == 2 && | |
r.Participants.Count == 2); | |
// '채팅방 참여자 정보'를 채팅방 정보에서 불러오기[ | |
// 해당 코드는 데이터베이스에서 이루어지는 코멘트가 아닌 LINQ 쿼리입니다!] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run Server with nohup | |
nohup /opt/mssql/bin/sqlservr --accept-eula & | |
# Sleep for 5 seconds.. | |
sleep 5 | |
# Setup default db | |
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P testPassword@ -Q "CREATE DATABASE [kdr-test]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_FILE=$1 # Base File | |
# Global New File | |
NEW_FILE=/tmp/newServer.jar | |
# Metadata for Set one | |
SET_ONE_NAME="Navi-Set1" | |
SET_ONE_PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# https://www.nginx.com/resources/wiki/start/ | |
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ | |
# https://wiki.debian.org/Nginx/DirectoryStructure | |
# | |
# In most cases, administrators will remove this file from sites-enabled/ and | |
# leave it as reference inside of sites-available where it will continue to be | |
# updated by the nginx packaging team. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM adoptopenjdk:11-jdk-hotspot | |
RUN apt update | |
RUN apt install git -y | |
RUN git clone https://github.com/Navi-Cloud/Navi-Server /root/Navi-Server | |
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo.domain | |
import com.mongodb.client.result.UpdateResult | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.data.mongodb.core.MongoTemplate | |
import org.springframework.data.mongodb.core.aggregation.* | |
import org.springframework.data.mongodb.core.query.Criteria | |
import org.springframework.data.mongodb.core.query.Query | |
import org.springframework.data.mongodb.core.query.Update | |
import org.springframework.stereotype.Repository |