add logs system
This commit is contained in:
parent
7d891378be
commit
ab7c8a74d7
9 changed files with 321 additions and 168 deletions
|
|
@ -43,6 +43,7 @@
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.0" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.0" />
|
||||||
|
<PackageReference Include="NEST" Version="7.17.5" />
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
|
||||||
<PackageReference Include="Sentry.AspNetCore" Version="3.30.0" />
|
<PackageReference Include="Sentry.AspNetCore" Version="3.30.0" />
|
||||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||||
|
|
|
||||||
25
Core/DateTimeFixConverter.cs
Normal file
25
Core/DateTimeFixConverter.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Recurit.Exam.Service.Core
|
||||||
|
{
|
||||||
|
public class DateTimeFixConverter : JsonConverter<DateTime>
|
||||||
|
{
|
||||||
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
264
Core/RequestLoggingMiddleware.cs
Normal file
264
Core/RequestLoggingMiddleware.cs
Normal file
|
|
@ -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<string> 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<GetProfileByKeycloakIdLocal?> 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<GetProfileByKeycloakIdResultLocal>(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<string, object>();
|
||||||
|
foreach (var field in form)
|
||||||
|
{
|
||||||
|
formData[field.Key] = field.Value.ToString();
|
||||||
|
}
|
||||||
|
// อ่านไฟล์ที่ถูกส่งมา (ถ้ามี)
|
||||||
|
if (form.Files.Count > 0)
|
||||||
|
{
|
||||||
|
var fileDataList = new List<object>();
|
||||||
|
|
||||||
|
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<object>(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<object>(responseBody), new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true, Converters = { new DateTimeFixConverter() } });
|
||||||
|
|
||||||
|
var json = JsonSerializer.Deserialize<JsonElement>(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<string> 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using BMA.EHR.Recurit.Exam.Service;
|
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.Data;
|
||||||
using BMA.EHR.Recurit.Exam.Service.Services;
|
using BMA.EHR.Recurit.Exam.Service.Services;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
|
@ -131,6 +132,8 @@ app.UseDefaultFiles();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
|
app.UseMiddleware<RequestLoggingMiddleware>();
|
||||||
|
|
||||||
// apply migrations
|
// apply migrations
|
||||||
await using var scope = app.Services.CreateAsyncScope();
|
await using var scope = app.Services.CreateAsyncScope();
|
||||||
await using var db = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
await using var db = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||||
|
|
|
||||||
|
|
@ -7,77 +7,5 @@
|
||||||
"System": "Warning"
|
"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"
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,21 +9,23 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ElasticConfiguration": {
|
"ElasticConfiguration": {
|
||||||
"Uri": "http://192.168.1.61:9200"
|
"Uri": "http://192.168.1.40:9200",
|
||||||
|
"IndexFormat": "bma-ehr-log-index",
|
||||||
|
"SystemName": "recruiting"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"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;",
|
"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=bma_ehr_exam_demo;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=bma_ehr_leave_demo;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=bma_ehr_discipline_demo;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=bma_ehr_recruit_demo;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=bma_ehr_organization_demo;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=bma_ehr_history_demo;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": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
|
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||||
},
|
},
|
||||||
"EPPlus": {
|
"EPPlus": {
|
||||||
"ExcelPackage": {
|
"ExcelPackage": {
|
||||||
|
|
|
||||||
|
|
@ -7,77 +7,5 @@
|
||||||
"System": "Warning"
|
"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"
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,21 +9,23 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ElasticConfiguration": {
|
"ElasticConfiguration": {
|
||||||
"Uri": "http://192.168.1.61:9200"
|
"Uri": "http://192.168.1.40:9200",
|
||||||
|
"IndexFormat": "bma-ehr-log-index",
|
||||||
|
"SystemName": "recruiting"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"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;",
|
"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=bma_ehr_exam_demo;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=bma_ehr_leave_demo;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=bma_ehr_discipline_demo;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=bma_ehr_recruit_demo;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=bma_ehr_organization_demo;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=bma_ehr_history_demo;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": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
|
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||||
},
|
},
|
||||||
"EPPlus": {
|
"EPPlus": {
|
||||||
"ExcelPackage": {
|
"ExcelPackage": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// <autogenerated />
|
// <autogenerated />
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue