firts commit

This commit is contained in:
2025-10-24 10:25:29 +09:00
commit ec77d8bc29
49 changed files with 134191 additions and 0 deletions

16
KART_API/Dto/CommonDto.cs Normal file
View File

@@ -0,0 +1,16 @@
using System.Data;
namespace KART_API.Dto
{
public class DataTabelToExcelSheet
{
public DataTable ExcelData { get; set; } = new DataTable();
public string SheetName { get; set; } = string.Empty;
public DataTabelToExcelSheet(DataTable excelData, string sheetName)
{
ExcelData = excelData;
SheetName = sheetName;
}
public DataTabelToExcelSheet() { }
}
}

34
KART_API/Dto/ExportDto.cs Normal file
View File

@@ -0,0 +1,34 @@
namespace KART_API.Dto
{
public class ExportFormParam
{
public string FormName { get; set; } = string.Empty;
public ExportFormParam(string formName)
{
FormName = formName;
}
public ExportFormParam() { }
}
public class ExportExcelParam
{
public string ExportTable { get; set; } = string.Empty;
public string Turn { get; set; } = string.Empty;
public ExportExcelParam( string exportTable, string turn)
{
ExportTable = exportTable;
Turn = turn;
}
public ExportExcelParam() { }
}
public class ExportQuotaParam
{
public string ExportTable { get; set; } = string.Empty;
public ExportQuotaParam(string exportTable)
{
ExportTable = exportTable;
}
public ExportQuotaParam() { }
}
}

26
KART_API/Dto/LogDto.cs Normal file
View File

@@ -0,0 +1,26 @@
namespace KART_API.Dto
{
public class VisitLogParam
{
public string LogContent { get; set; }
public VisitLogParam(string logContent)
{
LogContent = logContent;
}
public VisitLogParam() { }
}
public class SiteLogParam
{
public string LogTitle { get; set; }
public string LogContent { get; set; }
public SiteLogParam(string logTitle, string logContent)
{
LogTitle = logTitle;
LogContent = logContent;
}
public SiteLogParam() { }
}
}

199
KART_API/Dto/ProjectDto.cs Normal file
View File

@@ -0,0 +1,199 @@
using System.Net;
using Newtonsoft.Json.Linq;
using KART_API.Utils;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using System.Text.RegularExpressions;
using KART_API.Services;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using OfficeOpenXml.Style;
namespace KART_API.Dto
{
public class projectCodeInfo
{
public string SecurityKey { get; set; } = string.Empty;
public string projectCode { get; set; } = string.Empty;
public string ver { get; set; } = string.Empty;
public projectCodeInfo(string securityKey)
{
Security security = new Security();
SecurityKey = securityKey;
projectCode = security.decryptString(WebUtility.UrlDecode(securityKey));
if (projectCode.IndexOf("|K|W|") > -1)
{
projectCode = projectCode.Replace("|K|W|", "");
ver = "KIWI";
}
else if(projectCode.IndexOf("|N|S|") > -1)
{
projectCode = projectCode.Replace("|N|S|", "");
ver = "NEWSSAK";
}
else
{
ver = "KON";
}
}
public projectCodeInfo() { }
}
/// <summary>
/// KON Question 정보
/// 문항 등록시에 사용
/// </summary>
public class QuestionInfo
{
public string variableName { get; set; } = string.Empty;
public string explain { get; set; } = string.Empty;
public string structureType { get; set; } = string.Empty;
public string questionType { get; set; } = string.Empty;
public string itemType { get; set; } = string.Empty;
public string variableType { get; set; } = string.Empty;
public string maxCount { get; set; } = string.Empty;
public string questionTitle { get; set; } = string.Empty;
public JObject attrJson { get; set; } = new JObject();
public JObject itemJson { get; set; } = new JObject();
public JObject optionJson { get; set; } = new JObject();
public QuestionInfo() { }
}
public class DataStructure
{
public string questionId { get; set; } = string.Empty;
public string l { get; set; } = "-1";
public string t { get; set; } = "0";
public string m { get; set; } = "0";
public string r { get; set; } = "0";
public string s { get; set; } = "0";
public bool isEtc { get; set; } = false;
public DataStructure() { }
public DataStructure(string[] fixHeader, string inString)
{
if(Array.IndexOf(fixHeader, inString) > -1)
{
questionId = inString;
}
else
{
Regex qidRegex = new Regex(@"^[A-Za-z0-9_]+(?=_[0-9]#|_ETC)");//알파벳으로 시작하고 숫자 또는 언더바
if (qidRegex.IsMatch(inString))
{
questionId = qidRegex.Match(inString).Value;
var tempArray = inString.Replace(questionId+"_", "").Split('_');
if(tempArray[tempArray.Length-1].ToUpper() == "ETC")
{
isEtc = true;
}
for (int i = 0; i < tempArray.Length; i++)
{
string keyString = tempArray[i].Substring(0, tempArray[i].Length - 2);
switch (tempArray[i].ToUpper().Substring(tempArray[i].Length - 1))
{
case "L":
l = keyString;
break;
case "T":
t = keyString;
break;
case "M":
m = keyString;
break;
case "R":
r = keyString;
break;
case "S":
s = keyString;
break;
}
}
}
else
{
questionId = inString;
}
}
}
}
public class DerivedParam
{
public string VariableID { get; set; } = string.Empty;
public string OriginID { get; set; } = string.Empty;
public string VariableType { get; set; } = string.Empty;
public string VariableTitle { get; set; } = string.Empty;
public string VariableInfo { get; set; } = string.Empty;
/// <summary>
/// DerivedParam 설정
/// </summary>
/// <param name="variableID">파생 변수명</param>
/// <param name="originID">수정 전 변수명</param>
/// <param name="variableType">파생변수 타입</param>
/// <param name="variableTitle">파생변수 제목</param>
/// <param name="variableInfo">파생변수 정보</param>
public DerivedParam(string variableID, string originID, string variableType, string variableTitle, string variableInfo)
{
VariableID = variableID;
OriginID = originID;
VariableType = variableType;
VariableTitle = variableTitle;
VariableInfo = variableInfo;
}
public DerivedParam() { }
}
public class BookmarkParam
{
public string BookmarkPage { get; set; }
public string BookmarkID { get; set; }
public string BookmarkTitle { get; set; }
public string BookmarkInfo { get; set; }
public string BookmarkJson { get; set; }
public string IsOpen { get; set; }
/// <summary>
/// BookmarkParam 설정
/// </summary>
/// <param name="bookmarkPage">TABULATION, CROSSTAB</param>
/// <param name="bookmarkID">북마크 ID</param>
/// <param name="bookmarkTitle">북마크 제목</param>
/// <param name="bookmarkInfo">북마크 설명</param>
/// <param name="bookmarkJson">북마크 정보</param>
/// <param name="isOpen">공개/비공개</param>
public BookmarkParam(string bookmarkPage, string bookmarkID, string bookmarkTitle, string bookmarkInfo, string bookmarkJson, string isOpen)
{
BookmarkPage = bookmarkPage;
BookmarkID = bookmarkID;
BookmarkTitle = bookmarkTitle;
BookmarkInfo = bookmarkInfo;
BookmarkJson = bookmarkJson;
IsOpen = isOpen;
}
public BookmarkParam() { }
}
public class LabelInfo
{
public string Value { get; set; }
public string Label { get; set; }
public LabelInfo(string value, string label)
{
Value = value;
Label = label;
}
public LabelInfo() { }
}
}

19
KART_API/Dto/ReportDto.cs Normal file
View File

@@ -0,0 +1,19 @@
namespace KART_API.Dto
{
public class ReportParam
{
public string IndexParam { get; set; } = string.Empty;
public string BannerParam { get; set; } = string.Empty;
public string FilterParam { get; set; } = string.Empty;
public string OptionParam { get; set; } = string.Empty;
public ReportParam(string indexParam, string bannerParam, string filterParam, string optionParam)
{
IndexParam = indexParam;
BannerParam = bannerParam;
FilterParam = filterParam;
OptionParam = optionParam;
}
public ReportParam() { }
}
}

View File

@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
namespace KART_API.Dto
{
public class LoginParam
{
public string ID { get; set; }
public string Password { get; set; }
public LoginParam(string id, string pw) { ID = id; Password = pw; }
public LoginParam() { }
}
public class ExternalParam
{
public string External { get; set; }
public ExternalParam(string external) { External = external; }
public ExternalParam() { }
}
public class Authentication
{
public string Token { get; set; }
public string Name { get; set; }
public string IsAdmin { get; set; }
public Authentication(string token, string name, string isAdmin)
{
Token = token;
Name = name;
IsAdmin = isAdmin;
}
public Authentication() { }
}
}

15
KART_API/Dto/UriDto.cs Normal file
View File

@@ -0,0 +1,15 @@
namespace KART_API.Dto
{
public class ShortURLParam
{
public string RealURI { get; set; }
public string Mode { get; set; }
public ShortURLParam(string realUri, string mode)
{
RealURI = realUri;
Mode = mode;
}
public ShortURLParam() { }
}
}

12
KART_API/Dto/UserDto.cs Normal file
View File

@@ -0,0 +1,12 @@
namespace KART_API.Dto
{
public class UserInfo
{
public string ID { get; set; }
public string Name { get; set; }
public string Team { get; set; }
public string IsAdmin { get; set; }
public UserInfo(string id, string name, string team, string isAdmin) { ID = id; Name = name; Team = team; IsAdmin = isAdmin;}
public UserInfo() { }
}
}