LFlow/LFlow.UserManagement/UserManagementModule.cs

32 lines
1.0 KiB
C#
Raw Normal View History

2024-10-29 15:46:44 +08:00
using LFlow.Base.Interfaces;
using LFlow.Base.Utils;
using LFlow.UserManagement.Model;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using System.Reflection;
namespace LFlow.UserManagement
{
2024-11-04 10:10:05 +08:00
/// <summary>
/// 用户管理模块
/// </summary>
public class UserManagementModule : IModule
2024-10-29 15:46:44 +08:00
{
2024-11-04 10:10:05 +08:00
/// <summary>
/// 配置模块
/// </summary>
/// <param name="services"></param>
2024-10-29 15:46:44 +08:00
public void ConfigureModule(IServiceCollection services)
{
CodeFirst.AddType(typeof(UserModel));
2024-11-04 10:10:05 +08:00
var assembly = Assembly.GetAssembly(typeof(UserManagementModule))!;
2024-10-29 15:46:44 +08:00
var types = assembly.GetTypes().ToList();
2024-11-04 10:10:05 +08:00
types.RegisterAllService(services);
types.RegisterAllRepo(services);
2024-11-01 16:46:18 +08:00
//RegisterModule.RegisterAllModel(types, services);
2024-10-29 15:46:44 +08:00
services.AddControllers().AddApplicationPart(assembly);
2024-11-04 10:10:05 +08:00
Log.Logger?.Information("UserManagementModule ConfigureModule done");
2024-10-29 15:46:44 +08:00
}
}
}