diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 359cd76..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.preferCSharpExtension": true -} \ No newline at end of file diff --git a/Project/Web/Controller/CommonController.cs b/Project/Web/Controller/CommonController.cs index 997dfe8..b7b8cfc 100644 --- a/Project/Web/Controller/CommonController.cs +++ b/Project/Web/Controller/CommonController.cs @@ -333,6 +333,82 @@ namespace Project.Web.Controllers } } + [HttpGet] + public HttpResponseMessage GetNavigationMenu() + { + try + { + // 메뉴 정보를 하드코딩하거나 데이터베이스에서 가져올 수 있습니다. + // 향후 사용자 권한에 따른 메뉴 표시/숨김 기능도 추가 가능합니다. + var menuItems = new[] + { + new { + key = "dashboard", + title = "대시보드", + url = "/Dashboard/", + icon = "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z", + isVisible = true, + sortOrder = 1 + }, + new { + key = "common", + title = "공용코드", + url = "/Common", + icon = "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z", + isVisible = true, + sortOrder = 2 + }, + new { + key = "jobreport", + title = "업무일지", + url = "/Jobreport/", + icon = "M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2", + isVisible = true, + sortOrder = 3 + }, + new { + key = "kuntae", + title = "근태관리", + url = "/Kuntae/", + icon = "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z", + isVisible = true, + sortOrder = 4 + }, + new { + key = "todo", + title = "할일관리", + url = "/Todo/", + icon = "M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2M12 12l2 2 4-4", + isVisible = true, + sortOrder = 5 + } + }; + + // 사용자 권한에 따른 메뉴 필터링 로직을 여기에 추가할 수 있습니다. + // 예: var userLevel = FCOMMON.info.Login.level; + // if (userLevel < 5) { /* 특정 메뉴 숨김 */ } + + var response = new + { + Success = true, + Data = menuItems, + Message = "메뉴 정보를 성공적으로 가져왔습니다." + }; + + return CreateJsonResponse(response); + } + catch (Exception ex) + { + var response = new + { + Success = false, + Data = (object)null, + Message = "메뉴 정보를 가져오는 중 오류가 발생했습니다: " + ex.Message + }; + return CreateJsonResponse(response); + } + } + private HttpResponseMessage CreateJsonResponse(object data) { var json = JsonConvert.SerializeObject(data, new JsonSerializerSettings diff --git a/Project/Web/Controller/TodoController.cs b/Project/Web/Controller/TodoController.cs new file mode 100644 index 0000000..ecf8cde --- /dev/null +++ b/Project/Web/Controller/TodoController.cs @@ -0,0 +1,389 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Web.Http; +using Newtonsoft.Json; +using FCOMMON; +using Project.Web.Model; + +namespace Project.Web.Controllers +{ + public class TodoController : BaseController + { + [HttpGet] + public HttpResponseMessage Index() + { + var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "Todo", "index.html"); + var contents = string.Empty; + + if (System.IO.File.Exists(filePath)) + { + contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8); + } + else + { + contents = "
The requested file was not found: " + filePath + "
"; + } + + ApplyCommonValue(ref contents); + + var resp = new HttpResponseMessage() + { + Content = new StringContent( + contents, + System.Text.Encoding.UTF8, + "text/html") + }; + + return resp; + } + + [HttpGet] + public HttpResponseMessage GetTodos() + { + try + { + var currentUser = GetCurrentUser(); + if (currentUser == null) + { + return CreateJsonResponse(new + { + Success = false, + Message = "로그인되지 않은 상태입니다." + }); + } + + string gcode = FCOMMON.info.Login.gcode; + string uid = FCOMMON.info.Login.no; + + var sql = "SELECT * FROM EETGW_Todo WHERE gcode = @gcode AND uid = @uid ORDER BY flag DESC, seqno DESC, expire ASC, wdate ASC"; + var todos = DBM.Query시스템 공용코드를 관리합니다
-