버전정보 추가

This commit is contained in:
김판돌 2023-11-25 17:46:07 +09:00
parent 10f5df4ff2
commit 063f2f0da6
7 changed files with 40 additions and 8 deletions

View File

@ -95,6 +95,34 @@ namespace Server.Git
//string EncryptoExcel = crypto.Compress(excel);
//암호화
ProtocolProcessor.cryptoData = crypto.Compress(excel);
//초기세팅일 경우 데이터를 받아오고 아닐경우 데이터를저장
if(ProtocolProcessor.version == "")
{
string versionFilePath = Path.Combine(repositoryPath, "version");
if (File.Exists(versionFilePath))
{
using (StreamReader reader = new StreamReader(repositoryPath + @"version"))
{
ProtocolProcessor.version = reader.ReadToEnd();
}
}
else
{
Console.WriteLine("version file is null");
return;
}
}
else
{
using (StreamWriter writer = new StreamWriter(repositoryPath + @"version"))
{
writer.Write(ProtocolProcessor.version);
}
//버전 정보가 있을때만 커밋
// 스테이징
RepositorySet("add .", repositoryPath);
@ -103,7 +131,7 @@ namespace Server.Git
// 푸시
RepositorySet("push origin main", repositoryPath);
}
}
/// <summary>

View File

@ -27,6 +27,7 @@ namespace Server.Service
{
DownlodeResp resp = new DownlodeResp();
resp.data = data;
resp.version = ProtocolProcessor.version;
resp.status = 200;
return resp.ToJson();
}
@ -39,8 +40,6 @@ namespace Server.Service
public string version;
public override bool IsReceivedAllField()
{
if (version == "")
return false;
return true;
}
}
@ -48,5 +47,6 @@ namespace Server.Service
public class DownlodeResp : Resp
{
public string data;
public string version;
}
}

View File

@ -60,6 +60,7 @@ namespace Server.System
{
git = new XlsxToJson();
thread = new Thread(git.Init);
successResp = new ErrorResp();
successResp.status = 200;
successResp.message = "Success";
thread.Start();

Binary file not shown.

View File

@ -136,3 +136,6 @@
2.0
2.0
2.0
2.0
2.0
2.0