Files
lol_coder/lck_cl_data_solution/LolDataRequestLib/ResponseData/없는데이터/경기종료정보.cs
2026-04-01 20:20:09 +09:00

69 lines
1.9 KiB
C#

using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
BsonValue bufGameEndData = null;
if (recvDocument != null)
{
bufGameEndData = recvDocument["eventDocument"];
}
DataTable gameEndData = new DataTable();
try
{
gameEndData.TableName = DBDefine...ToString();
gameEndData.Columns.Add("승리팀");
gameEndData.Columns.Add("경기시간");
DataRow bufRow = gameEndData.NewRow();
bufRow["승리팀"] = (DBDefine.)bufGameEndData["winningTeam"].ToInt32();
bufRow["경기시간"] = bufGameEndData["gameTime"].ToInt32() / 1000;
gameEndData.Rows.Add(bufRow);
}
catch(Exception ex) { }
return gameEndData;
}
protected override BsonDocument getDataFromMongo()
{
//var filter = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
var projection = Builders<BsonDocument>.Projection
.Exclude("_id")
.Include("eventDocument");
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("game_end")
.Find(new BsonDocument()) //.Find(filter)
.SortByDescending(x => x["sequenceIndex"])
.Project(projection)
.Limit(1)
.ToList();
return documents.Last();
}
}
}