코드들 내용 정리

This commit is contained in:
김판돌 2023-11-24 22:12:27 +09:00
parent 4e940ba8ec
commit f600bfe803
5 changed files with 17 additions and 17 deletions

View File

@ -73,10 +73,7 @@ namespace Server.Git
process.WaitForExit(); process.WaitForExit();
// Git 명령 실행 결과 출력 // Git 명령 실행 결과 출력
Console.WriteLine(process.StandardOutput.ReadToEnd()); logger.Info(process.StandardOutput.ReadToEnd());
// 오류 메시지 출력
Console.WriteLine(process.StandardError.ReadToEnd());
} }
} }
@ -91,7 +88,7 @@ namespace Server.Git
using (StreamWriter writer = new StreamWriter(repositoryPath + @"/excel.json")) using (StreamWriter writer = new StreamWriter(repositoryPath + @"/excel.json"))
{ {
writer.Write(excel); writer.Write(excel);
Console.WriteLine($"save file : {repositoryPath + @"/excel.json"}"); logger.Info($"save file : {repositoryPath + @"/excel.json"}");
} }
//이곳에서 json변경후 저장 //이곳에서 json변경후 저장
//압축 //압축

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using NLog;
using Npgsql; using Npgsql;
using Server.SQL; using Server.SQL;
using Server.System; using Server.System;
@ -8,6 +9,9 @@ namespace Server.Git
{ {
public class ExcelSQL public class ExcelSQL
{ {
private static readonly NLog.ILogger logger = LogManager.GetCurrentClassLogger();
List<sheet> sheets; List<sheet> sheets;
public ExcelSQL(List<sheet> sheets) public ExcelSQL(List<sheet> sheets)
@ -134,7 +138,7 @@ namespace Server.Git
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"Error: {ex.Message}"); logger.Error($"Error: {ex.Message}");
} }
} }
} }
@ -142,7 +146,7 @@ namespace Server.Git
{ {
using (NpgsqlCommand command = new NpgsqlCommand(query, connection)) using (NpgsqlCommand command = new NpgsqlCommand(query, connection))
{ {
Console.WriteLine(query); logger.Info(query);
command.ExecuteNonQuery(); command.ExecuteNonQuery();
} }
} }

View File

@ -1,6 +1,4 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
namespace Server.Git namespace Server.Git
{ {
@ -29,7 +27,7 @@ namespace Server.Git
} }
else else
{ {
Console.WriteLine("-1 : NotUpdate"); //Console.WriteLine("-1 : NotUpdate");
return ""; return "";
} }
} }

View File

@ -3,8 +3,12 @@
//0~100 테스트용 프로토콜 //0~100 테스트용 프로토콜
Test = 0, Test = 0,
AddUser = 1, AddUser = 1,
//로그인,버전확인등등
Downlode = 100,
Downlode = 100,//기획 데이터 다운로드
} }
public enum Error public enum Error

View File

@ -30,11 +30,7 @@ namespace Server.System
return Response; return Response;
ProtocolProcessor.version = eaDelivery; ProtocolProcessor.version = eaDelivery;
if (thread.ThreadState == ThreadState.Unstarted) if (thread.ThreadState == ThreadState.Stopped)
{
thread.Start();
}
else if (thread.ThreadState == ThreadState.Stopped)
{ {
thread = new Thread(git.Init); thread = new Thread(git.Init);
thread.Start(); thread.Start();
@ -66,6 +62,7 @@ namespace Server.System
thread = new Thread(git.Init); thread = new Thread(git.Init);
successResp.status = 200; successResp.status = 200;
successResp.message = "Success"; successResp.message = "Success";
thread.Start();
} }
} }
} }