From ab7c8a74d78453c29960903ef66c4fa35ec3350f Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Mon, 31 Mar 2025 13:23:54 +0700 Subject: [PATCH] add logs system --- BMA.EHR.Recurit.Exam.Service.csproj | 1 + Core/DateTimeFixConverter.cs | 25 ++ Core/RequestLoggingMiddleware.cs | 264 ++++++++++++++++++ Program.cs | 3 + appsettings.Development.json | 74 +---- appsettings.json | 20 +- bin/Debug/net7.0/appsettings.Development.json | 74 +---- bin/Debug/net7.0/appsettings.json | 20 +- ...CoreApp,Version=v7.0.AssemblyAttributes.cs | 8 +- 9 files changed, 321 insertions(+), 168 deletions(-) create mode 100644 Core/DateTimeFixConverter.cs create mode 100644 Core/RequestLoggingMiddleware.cs diff --git a/BMA.EHR.Recurit.Exam.Service.csproj b/BMA.EHR.Recurit.Exam.Service.csproj index f2f6177..660ef11 100644 --- a/BMA.EHR.Recurit.Exam.Service.csproj +++ b/BMA.EHR.Recurit.Exam.Service.csproj @@ -43,6 +43,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Core/DateTimeFixConverter.cs b/Core/DateTimeFixConverter.cs new file mode 100644 index 0000000..b696ee9 --- /dev/null +++ b/Core/DateTimeFixConverter.cs @@ -0,0 +1,25 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace BMA.EHR.Recurit.Exam.Service.Core +{ + public class DateTimeFixConverter : JsonConverter + { + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + { + if (DateTime.TryParse(reader.GetString(), out var date)) + { + return date; + } + } + throw new JsonException("Invalid date format."); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString("yyyy-MM-dd")); + } + } +} diff --git a/Core/RequestLoggingMiddleware.cs b/Core/RequestLoggingMiddleware.cs new file mode 100644 index 0000000..d4a8292 --- /dev/null +++ b/Core/RequestLoggingMiddleware.cs @@ -0,0 +1,264 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Nest; +using Newtonsoft.Json; +using System.Diagnostics; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text.Encodings.Web; +using System.Text.Json; +using JsonSerializer = System.Text.Json.JsonSerializer; + +namespace BMA.EHR.Recurit.Exam.Service.Core +{ + public class RequestLoggingMiddleware + { + private readonly RequestDelegate _next; + private readonly IConfiguration _configuration; + + private string Uri = ""; + private string IndexFormat = ""; + private string SystemName = ""; + private string APIKey = ""; + + public RequestLoggingMiddleware(RequestDelegate next, IConfiguration configuration) + { + _next = next; + _configuration = configuration; + + Uri = _configuration["ElasticConfiguration:Uri"] ?? "http://192.168.1.40:9200"; + IndexFormat = _configuration["ElasticConfiguration:IndexFormat"] ?? "bma-ehr-log-index"; + SystemName = _configuration["ElasticConfiguration:SystemName"] ?? "Unknown"; + } + + protected async Task GetExternalAPIAsync(string apiPath, string accessToken, string apiKey) + { + try + { + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", apiKey); + var _res = await client.GetAsync(apiPath); + if (_res.IsSuccessStatusCode) + { + var _result = await _res.Content.ReadAsStringAsync(); + + return _result; + } + return string.Empty; + } + } + catch + { + throw; + } + } + + public async Task GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken) + { + try + { + var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak/{keycloakId}"; + var apiKey = _configuration["API_KEY"]; + + var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey); + if (apiResult != null) + { + var raw = JsonConvert.DeserializeObject(apiResult); + if (raw != null) + return raw.Result; + } + + return null; + } + catch + { + throw; + } + } + + public async Task Invoke(HttpContext context) + { + var settings = new ConnectionSettings(new Uri(Uri)) + .DefaultIndex(IndexFormat); + + var client = new ElasticClient(settings); + + + var startTime = DateTime.UtcNow; + var stopwatch = Stopwatch.StartNew(); + string? responseBodyJson = null; + string? requestBodyJson = null; + + string requestBody = await ReadRequestBodyAsync(context); + if (requestBody != "") + { + if (context.Request.HasFormContentType) + { + var form = await context.Request.ReadFormAsync(); // อ่าน form-data + + var formData = new Dictionary(); + foreach (var field in form) + { + formData[field.Key] = field.Value.ToString(); + } + // อ่านไฟล์ที่ถูกส่งมา (ถ้ามี) + if (form.Files.Count > 0) + { + var fileDataList = new List(); + + foreach (var file in form.Files) + { + fileDataList.Add(new + { + FileName = file.FileName, + ContentType = file.ContentType, + Size = file.Length + }); + } + + formData["Files"] = fileDataList; + } + + requestBodyJson = JsonSerializer.Serialize(formData, new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true, Converters = { new DateTimeFixConverter() } }); + } + else + { + requestBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize(requestBody), new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true, Converters = { new DateTimeFixConverter() } }); + } + } + + + + + var originalBodyStream = context.Response.Body; + + + using (var memoryStream = new MemoryStream()) + { + // เปลี่ยน stream ของ Response เพื่อให้สามารถอ่านได้ + context.Response.Body = memoryStream; + + + + var keycloakId = context.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? Guid.Empty.ToString("D"); + var token = context.Request.Headers["Authorization"]; + + var pf = await GetProfileByKeycloakIdAsync(Guid.Parse(keycloakId), token); + + await _next(context); // ดำเนินการต่อไปยัง Middleware อื่น ๆ + + stopwatch.Stop(); + var processTime = stopwatch.ElapsedMilliseconds; + var endTime = DateTime.UtcNow; + + var logType = context.Response.StatusCode switch + { + >= 500 => "error", + >= 400 => "warning", + _ => "info" + }; + + string? message = null; + + // อ่านข้อมูลจาก Response หลังจากที่ได้ถูกส่งออกไป + memoryStream.Seek(0, SeekOrigin.Begin); + var responseBody = new StreamReader(memoryStream).ReadToEnd(); + if (responseBody != "") + responseBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize(responseBody), new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true, Converters = { new DateTimeFixConverter() } }); + + var json = JsonSerializer.Deserialize(responseBody); + if (json.TryGetProperty("message", out var messageElement)) + { + message = messageElement.GetString(); + } + + var logData = new + { + logType = logType, + ip = context.Connection.RemoteIpAddress?.ToString(), + rootId = pf == null ? null : pf.RootId, + systemName = SystemName, + startTimeStamp = startTime.ToString("o"), + endTimeStamp = endTime.ToString("o"), + processTime = processTime, + host = context.Request.Host.Value, + method = context.Request.Method, + endpoint = context.Request.Path + context.Request.QueryString, + responseCode = context.Response.StatusCode == 304 ? "200" : context.Response.StatusCode.ToString(), + responseDescription = message, + input = requestBodyJson, + output = responseBodyJson, + + userId = keycloakId, + userName = $"{pf?.Prefix ?? ""}{pf?.FirstName ?? ""} {pf?.LastName ?? ""}", + user = pf?.CitizenId ?? "" + + }; + + // เขียนข้อมูลกลับไปยัง original Response body + memoryStream.Seek(0, SeekOrigin.Begin); + await memoryStream.CopyToAsync(originalBodyStream); + + client.IndexDocument(logData); + + } + + + //Log.Information("API Request Log: {@LogData}", logData); + } + + private async Task ReadRequestBodyAsync(HttpContext context) + { + context.Request.EnableBuffering(); + using var reader = new StreamReader(context.Request.Body, leaveOpen: true); + var body = await reader.ReadToEndAsync(); + context.Request.Body.Position = 0; + return body; + } + } + + public class GetProfileByKeycloakIdLocal + { + public Guid Id { get; set; } + + public string? Prefix { get; set; } + public string? FirstName { get; set; } + public string? LastName { get; set; } + public string? CitizenId { get; set; } + + public string? Root { get; set; } + public string? Child1 { get; set; } + public string? Child2 { get; set; } + public string? Child3 { get; set; } + public string? Child4 { get; set; } + public Guid? RootId { get; set; } + public Guid? Child1Id { get; set; } + public Guid? Child2Id { get; set; } + public Guid? Child3Id { get; set; } + public Guid? Child4Id { get; set; } + public Guid? RootDnaId { get; set; } + public Guid? Child1DnaId { get; set; } + public Guid? Child2DnaId { get; set; } + public Guid? Child3DnaId { get; set; } + public Guid? Child4DnaId { get; set; } + public double? Amount { get; set; } + public double? PositionSalaryAmount { get; set; } + public string? Commander { get; set; } + + public Guid? CommanderId { get; set; } + + public Guid? CommanderKeycloak { get; set; } + + } + + public class GetProfileByKeycloakIdResultLocal + { + public string Message { get; set; } = string.Empty; + + public int Status { get; set; } = -1; + + public GetProfileByKeycloakIdLocal? Result { get; set; } + } +} diff --git a/Program.cs b/Program.cs index 077f7d1..d565fcf 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ using BMA.EHR.Recurit.Exam.Service; +using BMA.EHR.Recurit.Exam.Service.Core; using BMA.EHR.Recurit.Exam.Service.Data; using BMA.EHR.Recurit.Exam.Service.Services; using Microsoft.AspNetCore.Authentication.JwtBearer; @@ -131,6 +132,8 @@ app.UseDefaultFiles(); app.UseStaticFiles(); app.MapControllers(); +app.UseMiddleware(); + // apply migrations await using var scope = app.Services.CreateAsyncScope(); await using var db = scope.ServiceProvider.GetRequiredService(); diff --git a/appsettings.Development.json b/appsettings.Development.json index 96572ba..d86fcd2 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -7,77 +7,5 @@ "System": "Warning" } } - }, - "ElasticConfiguration": { - "Uri": "http://192.168.1.61:9200" - }, - "AllowedHosts": "*", - "ConnectionStrings": { - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - }, - "Jwt": { - "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" - } - }, - "MinIO": { - "Endpoint": "http://127.0.0.1:9000", - "AccessKey": "ZQOGEjHxDesiVIHR", - "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", - "BucketName": "bma-recruit" - }, - "Protocol": "HTTPS", - "KeycloakCron": { - "Hour": "08", - "Minute": "00" - }, - "Rabbit": { - "Host": "192.168.1.61", - "User": "admin", - "Password": "admin123456", - "Queue": "hrms-checkin-queue" - }, - "Mail": { - "Server": "mail.bangkok.go.th", - "User": "saraban.csc.rd@bangkok.go.th", - "Password": "Saraban5222", - "MailFrom": "saraban.csc.rd@bangkok.go.th", - "Port": "25" - }, - "telerikReporting": { - "privateFonts": [ - { - "fontFamily": "TH SarabunIT๙", - "path": "Fonts/THSarabunIT.ttf" - }, - { - "fontFamily": "TH SarabunIT๙", - "path": "Fonts/THSarabunITBold.ttf", - "fontStyle": "Bold" - }, - { - "fontFamily": "TH SarabunPSK", - "path": "Fonts/THSarabunNew.ttf" - }, - { - "fontFamily": "TH SarabunPSK", - "path": "Fonts/THSarabunNewBold.ttf", - "fontStyle": "Bold" - } - ] - }, - "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", - "API": "https://bma-ehr.frappet.synology.me/api/v1", - "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", - "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" + } } \ No newline at end of file diff --git a/appsettings.json b/appsettings.json index 96572ba..fcc6c10 100644 --- a/appsettings.json +++ b/appsettings.json @@ -9,21 +9,23 @@ } }, "ElasticConfiguration": { - "Uri": "http://192.168.1.61:9200" + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "recruiting" }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_organization;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" + "Issuer": "https://id.frappet.synology.me/realms/hrms" }, "EPPlus": { "ExcelPackage": { diff --git a/bin/Debug/net7.0/appsettings.Development.json b/bin/Debug/net7.0/appsettings.Development.json index 96572ba..d86fcd2 100644 --- a/bin/Debug/net7.0/appsettings.Development.json +++ b/bin/Debug/net7.0/appsettings.Development.json @@ -7,77 +7,5 @@ "System": "Warning" } } - }, - "ElasticConfiguration": { - "Uri": "http://192.168.1.61:9200" - }, - "AllowedHosts": "*", - "ConnectionStrings": { - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - }, - "Jwt": { - "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" - } - }, - "MinIO": { - "Endpoint": "http://127.0.0.1:9000", - "AccessKey": "ZQOGEjHxDesiVIHR", - "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", - "BucketName": "bma-recruit" - }, - "Protocol": "HTTPS", - "KeycloakCron": { - "Hour": "08", - "Minute": "00" - }, - "Rabbit": { - "Host": "192.168.1.61", - "User": "admin", - "Password": "admin123456", - "Queue": "hrms-checkin-queue" - }, - "Mail": { - "Server": "mail.bangkok.go.th", - "User": "saraban.csc.rd@bangkok.go.th", - "Password": "Saraban5222", - "MailFrom": "saraban.csc.rd@bangkok.go.th", - "Port": "25" - }, - "telerikReporting": { - "privateFonts": [ - { - "fontFamily": "TH SarabunIT๙", - "path": "Fonts/THSarabunIT.ttf" - }, - { - "fontFamily": "TH SarabunIT๙", - "path": "Fonts/THSarabunITBold.ttf", - "fontStyle": "Bold" - }, - { - "fontFamily": "TH SarabunPSK", - "path": "Fonts/THSarabunNew.ttf" - }, - { - "fontFamily": "TH SarabunPSK", - "path": "Fonts/THSarabunNewBold.ttf", - "fontStyle": "Bold" - } - ] - }, - "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", - "API": "https://bma-ehr.frappet.synology.me/api/v1", - "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", - "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" + } } \ No newline at end of file diff --git a/bin/Debug/net7.0/appsettings.json b/bin/Debug/net7.0/appsettings.json index 96572ba..fcc6c10 100644 --- a/bin/Debug/net7.0/appsettings.json +++ b/bin/Debug/net7.0/appsettings.json @@ -9,21 +9,23 @@ } }, "ElasticConfiguration": { - "Uri": "http://192.168.1.61:9200" + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "recruiting" }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_organization;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" + "Issuer": "https://id.frappet.synology.me/realms/hrms" }, "EPPlus": { "ExcelPackage": { diff --git a/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs b/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs index 4257f4b..a9058da 100644 --- a/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs +++ b/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs @@ -1,4 +1,4 @@ -// -using System; -using System.Reflection; -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")] +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]