버전정보 추가
This commit is contained in:
parent
10f5df4ff2
commit
063f2f0da6
|
|
@ -95,15 +95,43 @@ namespace Server.Git
|
||||||
//string EncryptoExcel = crypto.Compress(excel);
|
//string EncryptoExcel = crypto.Compress(excel);
|
||||||
//암호화
|
//암호화
|
||||||
ProtocolProcessor.cryptoData = crypto.Compress(excel);
|
ProtocolProcessor.cryptoData = crypto.Compress(excel);
|
||||||
// 스테이징
|
|
||||||
RepositorySet("add .", repositoryPath);
|
|
||||||
|
|
||||||
// 커밋
|
//초기세팅일 경우 데이터를 받아오고 아닐경우 데이터를저장
|
||||||
RepositorySet($"commit -m \"update excel data\"", repositoryPath);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
// 푸시
|
}
|
||||||
RepositorySet("push origin main", repositoryPath);
|
else
|
||||||
|
{
|
||||||
|
using (StreamWriter writer = new StreamWriter(repositoryPath + @"version"))
|
||||||
|
{
|
||||||
|
writer.Write(ProtocolProcessor.version);
|
||||||
|
}
|
||||||
|
|
||||||
|
//버전 정보가 있을때만 커밋
|
||||||
|
|
||||||
|
// 스테이징
|
||||||
|
RepositorySet("add .", repositoryPath);
|
||||||
|
|
||||||
|
// 커밋
|
||||||
|
RepositorySet($"commit -m \"update excel data\"", repositoryPath);
|
||||||
|
|
||||||
|
// 푸시
|
||||||
|
RepositorySet("push origin main", repositoryPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
DownlodeResp resp = new DownlodeResp();
|
DownlodeResp resp = new DownlodeResp();
|
||||||
resp.data = data;
|
resp.data = data;
|
||||||
|
resp.version = ProtocolProcessor.version;
|
||||||
resp.status = 200;
|
resp.status = 200;
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
}
|
}
|
||||||
|
|
@ -39,8 +40,6 @@ namespace Server.Service
|
||||||
public string version;
|
public string version;
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
if (version == "")
|
|
||||||
return false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,5 +47,6 @@ namespace Server.Service
|
||||||
public class DownlodeResp : Resp
|
public class DownlodeResp : Resp
|
||||||
{
|
{
|
||||||
public string data;
|
public string data;
|
||||||
|
public string version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ namespace Server.System
|
||||||
{
|
{
|
||||||
git = new XlsxToJson();
|
git = new XlsxToJson();
|
||||||
thread = new Thread(git.Init);
|
thread = new Thread(git.Init);
|
||||||
|
successResp = new ErrorResp();
|
||||||
successResp.status = 200;
|
successResp.status = 200;
|
||||||
successResp.message = "Success";
|
successResp.message = "Success";
|
||||||
thread.Start();
|
thread.Start();
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -136,3 +136,6 @@
|
||||||
2.0
|
2.0
|
||||||
2.0
|
2.0
|
||||||
2.0
|
2.0
|
||||||
|
2.0
|
||||||
|
2.0
|
||||||
|
2.0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue