761 lines
44 KiB
C#
761 lines
44 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.AspNetCore.Mvc.Formatters;
|
|
using Newtonsoft.Json;
|
|
using Swashbuckle.AspNetCore.Swagger;
|
|
using System.IO;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Cors.Internal;
|
|
using Microsoft.AspNetCore.Cors.Infrastructure;
|
|
using Microsoft.AspNetCore.Http;
|
|
using NLog.Extensions.Logging;
|
|
|
|
using TTSW.EF;
|
|
using TTSW.Configure;
|
|
using TodoAPI2.Models;
|
|
using TTSW.Common;
|
|
using Microsoft.Extensions.FileProviders;
|
|
using TTSW.Utils;
|
|
using Microsoft.AspNetCore.Mvc.Routing;
|
|
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
|
|
|
using Microsoft.EntityFrameworkCore.Internal;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using IdentityServer4.AccessTokenValidation;
|
|
using STAFF_API.Services;
|
|
using STAFF_API.Configure;
|
|
|
|
namespace Test01
|
|
{
|
|
public class Startup
|
|
{
|
|
public static IConfiguration Configuration { get; private set; }
|
|
private readonly IHostingEnvironment _env;
|
|
|
|
public Startup(IConfiguration configuration, IHostingEnvironment env)
|
|
{
|
|
Configuration = configuration;
|
|
FileUtil.Configuration = Configuration;
|
|
_env = env;
|
|
}
|
|
|
|
// This method gets called by the runtime. Use this method to add services to the container.
|
|
// Test jenkins
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
string connectionString = MyHelper.GetConfig(Configuration, "connectionStrings:mainDBConnectionString");
|
|
|
|
string SiteInformation_appsite = MyHelper.GetConfig(Configuration, "SiteInformation:appsite");
|
|
string SiteInformation_apisite = MyHelper.GetConfig(Configuration, "SiteInformation:apisite");
|
|
string SiteInformation_mainsite = MyHelper.GetConfig(Configuration, "SiteInformation:mainsite");
|
|
string SiteInformation_modulesite = Environment.GetEnvironmentVariable("SiteInformation_modulesite");
|
|
string SiteInformation_sitename = MyHelper.GetConfig(Configuration, "SiteInformation:sitename");
|
|
string SiteInformation_modulename = Environment.GetEnvironmentVariable("SiteInformation_modulename");
|
|
string SiteInformation_chatsite = Environment.GetEnvironmentVariable("SiteInformation_chatsite");
|
|
|
|
string apiName = SiteInformation_apisite;
|
|
string appsite = SiteInformation_appsite;
|
|
|
|
#region Entity Framework
|
|
services.AddHttpContextAccessor();
|
|
// In case work in memory db
|
|
//services.AddDbContext<DataContext>(opt => opt.UseInMemoryDatabase("TodoList"));
|
|
|
|
//In case work in real db
|
|
services.AddDbContext<DataContext>(opt =>
|
|
opt.UseNpgsql(connectionString, o => o.MigrationsHistoryTable("__EvaMigrationsHistory")));
|
|
|
|
#endregion
|
|
|
|
#region MVC
|
|
services.AddMvc()
|
|
// Gen method description as XML
|
|
.AddMvcOptions(o => o.OutputFormatters.Add(
|
|
new XmlDataContractSerializerOutputFormatter()))
|
|
|
|
// Prevent ReferenceLoop error when convert EF model to json
|
|
.AddJsonOptions(opt => opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore);
|
|
#endregion
|
|
|
|
#region Authentication
|
|
// Add jwt token authentication with identity server
|
|
// services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
|
|
// .AddIdentityServerAuthentication(options =>
|
|
// {
|
|
// //Identity Server URL
|
|
// options.Authority = idUrl;
|
|
// options.RequireHttpsMetadata = false;
|
|
|
|
// options.ApiName = apiName; // api id synced with identity server
|
|
// });
|
|
#endregion
|
|
|
|
#region Swagger
|
|
// Register the Swagger generator, defining one or more Swagger documents
|
|
services.AddSwaggerGen(c =>
|
|
{
|
|
c.SwaggerDoc("v1", new Info { Title = "TB320EVA Project API", Version = "v1" });
|
|
|
|
// Set the comments path for the Swagger JSON and UI.
|
|
var basePath = System.AppContext.BaseDirectory;
|
|
var xmlPath = Path.Combine(basePath, "tb320eva.xml");
|
|
c.IncludeXmlComments(xmlPath);
|
|
|
|
// Add options for web api needed upload file controls
|
|
// Register File Upload Operation Filter for api HttpPost api/Attachment/UploadMultipleFiles
|
|
// http://www.talkingdotnet.com/how-to-upload-file-via-swagger-in-asp-net-core-web-api/
|
|
c.OperationFilter<SwaggerFileUploadOperation>();
|
|
|
|
//Allow passing token in the swagger ui
|
|
//https://ppolyzos.com/2017/10/30/add-jwt-bearer-authorization-to-swagger-and-asp-net-core/
|
|
// Swagger 2.+ support
|
|
var security = new Dictionary<string, IEnumerable<string>>
|
|
{
|
|
{"Bearer", new string[] { }},
|
|
};
|
|
|
|
c.AddSecurityDefinition("Bearer", new ApiKeyScheme
|
|
{
|
|
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
|
|
Name = "Authorization",
|
|
In = "header",
|
|
Type = "apiKey"
|
|
});
|
|
c.AddSecurityRequirement(security);
|
|
});
|
|
#endregion
|
|
|
|
#region Cors
|
|
services.Configure<MvcOptions>(options =>
|
|
{
|
|
options.Filters.Add(new CorsAuthorizationFilterFactory("SiteCorsPolicy"));
|
|
});
|
|
|
|
var corsBuilder = new CorsPolicyBuilder();
|
|
corsBuilder.AllowAnyHeader();
|
|
corsBuilder.AllowAnyMethod();
|
|
corsBuilder.AllowAnyOrigin();
|
|
corsBuilder.AllowCredentials();
|
|
services.AddCors(options =>
|
|
{
|
|
options.AddPolicy("SiteCorsPolicy", corsBuilder.Build());
|
|
});
|
|
#endregion
|
|
|
|
#region Service Class
|
|
services.AddTransient<IWebAPIClient, WebAPIClient>();
|
|
services.AddTransient<IMailService, MailService>();
|
|
services.AddTransient<IMyDatabase, MyDatabase>();
|
|
#endregion
|
|
|
|
#region Dependency Injection - Http
|
|
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
|
#endregion
|
|
|
|
#region Dependency Injection - Utils
|
|
|
|
#endregion
|
|
|
|
#region Dependency Injection - Service
|
|
|
|
services.AddScoped<Iexternal_linkageService, external_linkageService>();
|
|
|
|
services.AddScoped<Iexternal_employeeService, external_employeeService>();
|
|
|
|
// Main Service
|
|
|
|
services.AddScoped<IBaseRepository2<eva_create_evaluationEntity, int>, BaseRepository2<eva_create_evaluationEntity, int>>();
|
|
services.AddScoped<Ieva_create_evaluationService, eva_create_evaluationService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_create_evaluation_detailEntity, int>, BaseRepository2<eva_create_evaluation_detailEntity, int>>();
|
|
services.AddScoped<Ieva_create_evaluation_detailService, eva_create_evaluation_detailService>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_agreementService, eva_create_evaluation_detail_agreementService>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_processService, eva_create_evaluation_detail_processService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_evaluation_achievementEntity, int>, BaseRepository2<eva_evaluation_achievementEntity, int>>();
|
|
services.AddScoped<Ieva_evaluation_achievementService, eva_evaluation_achievementService>();
|
|
|
|
services.AddScoped<Ieva_evaluation_achievement_processService, eva_evaluation_achievement_processService>();
|
|
|
|
services.AddScoped<Ieva_evaluation_behavior_processService, eva_evaluation_behavior_processService>();
|
|
|
|
services.AddScoped<Ieva_evaluation_achievement_process2Service, eva_evaluation_achievement_process2Service>();
|
|
|
|
services.AddScoped<Ieva_evaluation_behavior_process2Service, eva_evaluation_behavior_process2Service>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_evaluation_behaviorEntity, int>, BaseRepository2<eva_evaluation_behaviorEntity, int>>();
|
|
services.AddScoped<Ieva_evaluation_behaviorService, eva_evaluation_behaviorService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_evaluation_groupEntity, Guid>, BaseRepository<eva_evaluation_groupEntity, Guid>>();
|
|
services.AddScoped<Ieva_evaluation_groupService, eva_evaluation_groupService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_evaluation_group_detailEntity, Guid>, BaseRepository<eva_evaluation_group_detailEntity, Guid>>();
|
|
services.AddScoped<Ieva_evaluation_group_detailService, eva_evaluation_group_detailService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_level_scoreEntity, Guid>, BaseRepository<eva_level_scoreEntity, Guid>>();
|
|
services.AddScoped<Ieva_level_scoreService, eva_level_scoreService>();
|
|
|
|
services.AddScoped<Irep_eva01Service, rep_eva01Service>();
|
|
|
|
services.AddScoped<Irep_eva02Service, rep_eva02Service>();
|
|
|
|
services.AddScoped<Irep_eva03Service, rep_eva03Service>();
|
|
|
|
services.AddScoped<Irep_familyService, rep_familyService>();
|
|
|
|
services.AddScoped<Irep_leave_summaryService, rep_leave_summaryService>();
|
|
|
|
services.AddScoped<Irep_leave_totalService, rep_leave_totalService>();
|
|
|
|
services.AddScoped<Irep_position_salaryService, rep_position_salaryService>();
|
|
|
|
services.AddScoped<Irep_samanaService, rep_samanaService>();
|
|
|
|
services.AddScoped<Irep_study_historyService, rep_study_historyService>();
|
|
|
|
services.AddScoped<Irep_working_typeService, rep_working_typeService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_performance_planEntity, Guid>, BaseRepository<eva_performance_planEntity, Guid>>();
|
|
services.AddScoped<Ieva_performance_planService, eva_performance_planService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_performance_plan_detailEntity, Guid>, BaseRepository<eva_performance_plan_detailEntity, Guid>>();
|
|
services.AddScoped<Ieva_performance_plan_detailService, eva_performance_plan_detailService>();
|
|
|
|
services.AddScoped<IBaseRepository<eva_promoted_percentageEntity, Guid>, BaseRepository<eva_promoted_percentageEntity, Guid>>();
|
|
services.AddScoped<Ieva_promoted_percentageService, eva_promoted_percentageService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_salary_cylinderEntity, int>, BaseRepository2<eva_salary_cylinderEntity, int>>();
|
|
services.AddScoped<Ieva_salary_cylinderService, eva_salary_cylinderService>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_summary1Service, eva_create_evaluation_detail_summary1Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_summary2Service, eva_create_evaluation_detail_summary2Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review01Service, eva_create_evaluation_detail_review01Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review02Service, eva_create_evaluation_detail_review02Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_statusService, eva_create_evaluation_detail_statusService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_adjust_postponementEntity, int>, BaseRepository2<eva_adjust_postponementEntity, int>>();
|
|
services.AddScoped<Ieva_adjust_postponementService, eva_adjust_postponementService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_normalService, eva_adjust_postponement_normalService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_adjust_postponement_detailEntity, int>, BaseRepository2<eva_adjust_postponement_detailEntity, int>>();
|
|
services.AddScoped<Ieva_adjust_postponement_detailService, eva_adjust_postponement_detailService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_detail_normalService, eva_adjust_postponement_detail_normalService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_quotaService, eva_adjust_postponement_quotaService>();
|
|
services.AddScoped<Ieva_adjust_postponement_detail_quotaService, eva_adjust_postponement_detail_quotaService>();
|
|
|
|
services.AddScoped<Iexternal_competencyService, external_competencyService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_detail_normal_02Service, eva_adjust_postponement_detail_normal_02Service>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_detail_quota_02Service, eva_adjust_postponement_detail_quota_02Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review03Service, eva_create_evaluation_detail_review03Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review04Service, eva_create_evaluation_detail_review04Service>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review05Service, eva_create_evaluation_detail_review05Service>();
|
|
|
|
services.AddScoped<Ieva_level_score_basicService, eva_level_score_basicService>();
|
|
|
|
services.AddScoped<Isearch_employeeService, search_employeeService>();
|
|
|
|
services.AddScoped<Isearch_employee_for_groupService, search_employee_for_groupService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_idp_planEntity, int>, BaseRepository2<eva_idp_planEntity, int>>();
|
|
services.AddScoped<Ieva_idp_planService, eva_idp_planService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_temp_fingerscanEntity, string>, BaseRepository2<eva_temp_fingerscanEntity, string>>();
|
|
services.AddScoped<Ieva_temp_fingerscanService, eva_temp_fingerscanService>();
|
|
|
|
services.AddScoped<Ieva_idp_plan_ownerService, eva_idp_plan_ownerService>();
|
|
|
|
services.AddScoped<Irep_leave_total_02Service, rep_leave_total_02Service>();
|
|
|
|
services.AddScoped<Irpt_payroll_summaryService, rpt_payroll_summaryService>();
|
|
|
|
services.AddScoped<Irep_eva_xService, rep_eva_xService>();
|
|
|
|
services.AddScoped<Irep_kp7Service, rep_kp7Service>();
|
|
|
|
services.AddScoped<Icore_permission_listService, core_permission_listService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_detail_migrationService, eva_adjust_postponement_detail_migrationService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_migrationService, eva_adjust_postponement_migrationService>();
|
|
|
|
services.AddScoped<Ieva_self_reviewService, eva_self_reviewService>();
|
|
|
|
services.AddScoped<Irep_eva_self_reviewService, rep_eva_self_reviewService>();
|
|
|
|
services.AddScoped<Irep_eva_self_review_allService, rep_eva_self_review_allService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_evaluation_operating_agreementEntity, int>, BaseRepository2<eva_evaluation_operating_agreementEntity, int>>();
|
|
services.AddScoped<Ieva_evaluation_operating_agreementService, eva_evaluation_operating_agreementService>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_firstdocService, eva_create_evaluation_detail_firstdocService>();
|
|
|
|
services.AddScoped<Ieva_create_evaluation_detail_review0AService, eva_create_evaluation_detail_review0AService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_limit_frame_employeeEntity, Guid>, BaseRepository2<eva_limit_frame_employeeEntity, Guid>>();
|
|
services.AddScoped<Ieva_limit_frame_employeeService, eva_limit_frame_employeeService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_limit_frame_groupEntity, Guid>, BaseRepository2<eva_limit_frame_groupEntity, Guid>>();
|
|
services.AddScoped<Ieva_limit_frame_groupService, eva_limit_frame_groupService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_limit_frame_planEntity, Guid>, BaseRepository2<eva_limit_frame_planEntity, Guid>>();
|
|
services.AddScoped<Ieva_limit_frame_planService, eva_limit_frame_planService>();
|
|
|
|
services.AddScoped<Irep_eva_limit_frame_planService, rep_eva_limit_frame_planService>();
|
|
|
|
services.AddScoped<Ivw_limit_frame_planService, vw_limit_frame_planService>();
|
|
|
|
services.AddScoped<Ivw_eva_performance_planService, vw_eva_performance_planService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_evaluation_achievement_attachEntity, int>, BaseRepository2<eva_evaluation_achievement_attachEntity, int>>();
|
|
services.AddScoped<Ieva_evaluation_achievement_attachService, eva_evaluation_achievement_attachService>();
|
|
|
|
services.AddScoped<Ieva_idp_plan_reviewerService, eva_idp_plan_reviewerService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_create_evaluation_detail_historyEntity, int>, BaseRepository2<eva_create_evaluation_detail_historyEntity, int>>();
|
|
services.AddScoped<Ieva_create_evaluation_detail_historyService, eva_create_evaluation_detail_historyService>();
|
|
|
|
services.AddScoped<Irep_summary_a01Service, rep_summary_a01Service>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_setup_permissionEntity, Guid>, BaseRepository2<eva_setup_permissionEntity, Guid>>();
|
|
services.AddScoped<Ieva_setup_permissionService, eva_setup_permissionService>();
|
|
|
|
services.AddScoped<IBaseRepository2<eva_level_score_detailEntity, Guid>, BaseRepository2<eva_level_score_detailEntity, Guid>>();
|
|
services.AddScoped<Ieva_level_score_detailService, eva_level_score_detailService>();
|
|
|
|
services.AddScoped<Ieva_adjust_postponement_update_statusService, eva_adjust_postponement_update_statusService>();
|
|
|
|
services.AddScoped<Ieva_adjust_quota_update_statusService, eva_adjust_quota_update_statusService>();
|
|
|
|
services.AddScoped<Ieva_adjust_quota_update_final_statusService, eva_adjust_quota_update_final_statusService>();
|
|
|
|
#endregion
|
|
|
|
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
|
|
|
#region Dependency Injection - Configuration
|
|
// Bind options using a sub-section of the appsettings.json file.
|
|
// More information https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options
|
|
services.Configure<IdentityServerConfig>(Configuration.GetSection("IdentityServer"));
|
|
services.Configure<MailConfig>(Configuration.GetSection("MailServer"));
|
|
#endregion
|
|
}
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
|
{
|
|
string appsite = MyHelper.GetConfig(Configuration, "SiteInformation:appsite");
|
|
|
|
#region Error Page
|
|
if (env.IsDevelopment())
|
|
{
|
|
app.UseDeveloperExceptionPage();
|
|
}
|
|
#endregion
|
|
|
|
#region Entity Framework
|
|
|
|
#endregion
|
|
|
|
#region Auto Mapper
|
|
AutoMapper.Mapper.Initialize(cfg =>
|
|
{
|
|
cfg.CreateMap<eva_create_evaluationInputModel, eva_create_evaluationEntity>();
|
|
cfg.CreateMap<eva_create_evaluationEntity, eva_create_evaluationViewModel>();
|
|
cfg.CreateMap<eva_create_evaluationEntity, eva_create_evaluationWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detailInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detailViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detailWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_agreementInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_agreementViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_agreementWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_processInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_processViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_processWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_achievementInputModel, eva_evaluation_achievementEntity>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievementViewModel>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievementWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_achievement_processInputModel, eva_evaluation_achievementEntity>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievement_processViewModel>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievement_processWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_achievement_process2InputModel, eva_evaluation_achievementEntity>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievement_process2ViewModel>();
|
|
cfg.CreateMap<eva_evaluation_achievementEntity, eva_evaluation_achievement_process2WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_behavior_processInputModel, eva_evaluation_behaviorEntity>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behavior_processViewModel>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behavior_processWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_behavior_process2InputModel, eva_evaluation_behaviorEntity>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behavior_process2ViewModel>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behavior_process2WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_behaviorInputModel, eva_evaluation_behaviorEntity>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behaviorViewModel>();
|
|
cfg.CreateMap<eva_evaluation_behaviorEntity, eva_evaluation_behaviorWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_groupInputModel, eva_evaluation_groupEntity>();
|
|
cfg.CreateMap<eva_evaluation_groupEntity, eva_evaluation_groupViewModel>();
|
|
cfg.CreateMap<eva_evaluation_groupEntity, eva_evaluation_groupWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_group_detailInputModel, eva_evaluation_group_detailEntity>();
|
|
cfg.CreateMap<eva_evaluation_group_detailEntity, eva_evaluation_group_detailViewModel>();
|
|
cfg.CreateMap<eva_evaluation_group_detailEntity, eva_evaluation_group_detailWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_level_scoreInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, eva_level_scoreViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, eva_level_scoreWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva01InputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva01ViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva01WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva02InputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva02ViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva02WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva03InputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva03ViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva03WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_familyInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_familyViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_familyWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_leave_summaryInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_summaryViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_summaryWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_leave_totalInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_totalViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_totalWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_position_salaryInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_position_salaryViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_position_salaryWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_samanaInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_samanaViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_samanaWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_study_historyInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_working_typeInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_working_typeViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_working_typeWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_performance_planInputModel, eva_performance_planEntity>();
|
|
cfg.CreateMap<eva_performance_planEntity, eva_performance_planViewModel>();
|
|
cfg.CreateMap<eva_performance_planEntity, eva_performance_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_performance_plan_detailInputModel, eva_performance_plan_detailEntity>();
|
|
cfg.CreateMap<eva_performance_plan_detailEntity, eva_performance_plan_detailViewModel>();
|
|
cfg.CreateMap<eva_performance_plan_detailEntity, eva_performance_plan_detailWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_promoted_percentageInputModel, eva_promoted_percentageEntity>();
|
|
cfg.CreateMap<eva_promoted_percentageEntity, eva_promoted_percentageViewModel>();
|
|
cfg.CreateMap<eva_promoted_percentageEntity, eva_promoted_percentageWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_salary_cylinderInputModel, eva_salary_cylinderEntity>();
|
|
cfg.CreateMap<eva_salary_cylinderEntity, eva_salary_cylinderViewModel>();
|
|
cfg.CreateMap<eva_salary_cylinderEntity, eva_salary_cylinderWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_summary1InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_summary1ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_summary1WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_summary2InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_summary2ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_summary2WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review01InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review01ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review01WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review02InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review02ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review02WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_statusInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_statusViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_statusWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponementInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponementViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponementWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_normalInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_normalViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_normalWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detailInputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detailViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detailWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detail_normalInputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normalViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normalWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_quotaInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_quotaViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_quotaWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detail_quotaInputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quotaViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quotaWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detail_normal_02InputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normal_02ViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normal_02WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detail_quota_02InputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quota_02ViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quota_02WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review03InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review03ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review03WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review04InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review04ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review04WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review05InputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review05ViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review05WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_level_score_basicInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, eva_level_score_basicViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, eva_level_score_basicWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_idp_planInputModel, eva_idp_planEntity>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_planViewModel>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_idp_plan_ownerInputModel, eva_idp_planEntity>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_plan_ownerViewModel>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_plan_ownerWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_leave_total_02InputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_total_02ViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_leave_total_02WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rpt_payroll_summaryInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rpt_payroll_summaryViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rpt_payroll_summaryWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva_xInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_xViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_xWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<core_permission_listInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, core_permission_listViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, core_permission_listWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_migrationInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_migrationViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_migrationWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_detail_migrationInputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_migrationViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_migrationWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_self_reviewInputModel, eva_adjust_postponement_detailEntity>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_self_reviewViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_self_reviewWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva_self_reviewInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_reviewViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_reviewWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva_self_review_allInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_review_allViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_review_allWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_operating_agreementInputModel, eva_evaluation_operating_agreementEntity>();
|
|
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementViewModel>();
|
|
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_firstdocInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_firstdocViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_firstdocWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_create_evaluation_detail_review0AInputModel, eva_create_evaluation_detailEntity>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review0AViewModel>();
|
|
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_review0AWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_limit_frame_employeeInputModel, eva_limit_frame_employeeEntity>();
|
|
cfg.CreateMap<eva_limit_frame_employeeEntity, eva_limit_frame_employeeViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_employeeEntity, eva_limit_frame_employeeWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_limit_frame_groupInputModel, eva_limit_frame_groupEntity>();
|
|
cfg.CreateMap<eva_limit_frame_groupEntity, eva_limit_frame_groupViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_groupEntity, eva_limit_frame_groupWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_limit_frame_planInputModel, eva_limit_frame_planEntity>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, eva_limit_frame_planViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, eva_limit_frame_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_eva_limit_frame_planInputModel, eva_limit_frame_groupEntity>();
|
|
cfg.CreateMap<eva_limit_frame_groupEntity, rep_eva_limit_frame_planViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_groupEntity, rep_eva_limit_frame_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<vw_limit_frame_planInputModel, eva_limit_frame_planEntity>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<vw_limit_frame_planInputModel, eva_limit_frame_planEntity>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planViewModel>();
|
|
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_evaluation_achievement_attachInputModel, eva_evaluation_achievement_attachEntity>();
|
|
cfg.CreateMap<eva_evaluation_achievement_attachEntity, eva_evaluation_achievement_attachViewModel>();
|
|
cfg.CreateMap<eva_evaluation_achievement_attachEntity, eva_evaluation_achievement_attachWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_idp_plan_reviewerInputModel, eva_idp_planEntity>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_plan_reviewerViewModel>();
|
|
cfg.CreateMap<eva_idp_planEntity, eva_idp_plan_reviewerWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_study_historyInputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<rep_summary_a01InputModel, eva_level_scoreEntity>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_summary_a01ViewModel>();
|
|
cfg.CreateMap<eva_level_scoreEntity, rep_summary_a01WithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_setup_permissionInputModel, eva_setup_permissionEntity>();
|
|
cfg.CreateMap<eva_setup_permissionEntity, eva_setup_permissionViewModel>();
|
|
cfg.CreateMap<eva_setup_permissionEntity, eva_setup_permissionWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_level_score_detailInputModel, eva_level_score_detailEntity>();
|
|
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailViewModel>();
|
|
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_postponement_update_statusInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_quota_update_statusInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_statusViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_statusWithSelectionViewModel>();
|
|
|
|
cfg.CreateMap<eva_adjust_quota_update_final_statusInputModel, eva_adjust_postponementEntity>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_final_statusViewModel>();
|
|
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_final_statusWithSelectionViewModel>();
|
|
});
|
|
#endregion
|
|
|
|
#region HTML Configure
|
|
app.UseStatusCodePages();
|
|
|
|
if (!Directory.Exists(FileUtil.GetAbsolutePath("")))
|
|
{
|
|
Directory.CreateDirectory(FileUtil.GetAbsolutePath(""));
|
|
}
|
|
|
|
if (!Directory.Exists(FileUtil.GetAbsolutePath(@"Uploads")))
|
|
{
|
|
Directory.CreateDirectory(FileUtil.GetAbsolutePath(@"Uploads"));
|
|
}
|
|
|
|
if (!Directory.Exists(FileUtil.GetAbsolutePath(@"Files")))
|
|
{
|
|
Directory.CreateDirectory(FileUtil.GetAbsolutePath(@"Files"));
|
|
}
|
|
|
|
var currentDir = Directory.GetCurrentDirectory();
|
|
var pdf_path = Path.Combine(currentDir, @"Files");
|
|
var target_path = FileUtil.GetAbsolutePath(@"Files");
|
|
var log = FileUtil.GetLogPath();
|
|
|
|
// For wwwroot
|
|
app.UseStaticFiles(appsite);
|
|
app.UsePathBase(appsite);
|
|
|
|
// Set static file for directory uploads
|
|
var rootUploadDir = FileUtil.GetDirectoryRootPath(TTSW.Constant.FilePathConstant.DirType.TempUpload);
|
|
app.UseStaticFiles(new StaticFileOptions
|
|
{
|
|
FileProvider = new PhysicalFileProvider(rootUploadDir.PhysicalPath),
|
|
RequestPath = "/Uploads"
|
|
});
|
|
|
|
// Set static file for directory attachments
|
|
rootUploadDir = FileUtil.GetDirectoryRootPath(TTSW.Constant.FilePathConstant.DirType.Files);
|
|
app.UseStaticFiles(new StaticFileOptions
|
|
{
|
|
FileProvider = new PhysicalFileProvider(rootUploadDir.PhysicalPath),
|
|
RequestPath = "/Files"
|
|
});
|
|
|
|
// Set static file for log files
|
|
app.UseStaticFiles(new StaticFileOptions
|
|
{
|
|
FileProvider = new PhysicalFileProvider(log),
|
|
RequestPath = "/Logs"
|
|
});
|
|
|
|
#endregion
|
|
|
|
#region Swagger
|
|
// Enable middleware to serve generated Swagger as a JSON endpoint.
|
|
app.UseSwagger();
|
|
|
|
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
|
|
app.UseSwaggerUI(c =>
|
|
{
|
|
c.SwaggerEndpoint(appsite + "/swagger/v1/swagger.json", "TB320EVA Project API V1");
|
|
});
|
|
#endregion
|
|
|
|
#region Authentication
|
|
//app.UseAuthentication();
|
|
#endregion
|
|
|
|
app.UseCors("SiteCorsPolicy");
|
|
|
|
#region MVC
|
|
app.UseMvc(routes =>
|
|
{
|
|
routes.MapRoute(
|
|
name: "default",
|
|
template: "{controller=Home}/{action=Index}/{id?}");
|
|
});
|
|
#endregion
|
|
}
|
|
|
|
}
|
|
}
|
|
|