Files
Yi.Admin/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/WebFirstService.cs

55 lines
1.7 KiB
C#
Raw Normal View History

2023-06-10 13:53:00 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2023-09-19 23:48:37 +08:00
using Furion.DependencyInjection;
using Furion.DynamicApiController;
2023-06-10 13:53:00 +08:00
using Mapster;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
2023-09-19 23:48:37 +08:00
using Microsoft.AspNetCore.Mvc;
2023-06-10 13:53:00 +08:00
using Yi.Framework.Infrastructure.Ddd.Repositories;
using Yi.Framework.Infrastructure.Ddd.Services;
2023-09-21 19:55:55 +08:00
using Yi.Framework.Module.WebFirstManager.Domain;
2023-09-19 23:48:37 +08:00
using Yi.Framework.Module.WebFirstManager.Dtos.WebFirst;
2023-06-10 13:53:00 +08:00
using Yi.Framework.Module.WebFirstManager.Entities;
namespace Yi.Framework.Module.WebFirstManager.Impl
{
2023-09-19 23:48:37 +08:00
[ApiDescriptionSettings("WebFirstManager")]
2023-09-21 00:04:55 +08:00
public class WebFirstService : ApplicationService, IWebFirstService, IDynamicApiController, ITransient
2023-06-10 13:53:00 +08:00
{
2023-09-21 19:55:55 +08:00
private IRepository<TableEntity> _tableRepository;
private TemplateManager _templateManager;
public WebFirstService(IRepository<TableEntity> tableRepository, TemplateManager templateManager)
2023-09-21 00:04:55 +08:00
{
2023-09-21 19:55:55 +08:00
_tableRepository = tableRepository;
_templateManager = templateManager;
2023-09-21 00:04:55 +08:00
}
2023-06-10 13:53:00 +08:00
/// <summary>
2023-09-21 19:55:55 +08:00
/// 一键构建生成代码
2023-06-10 13:53:00 +08:00
/// </summary>
/// <returns></returns>
2023-09-21 19:55:55 +08:00
public async Task PostBuildCodeAsync()
2023-06-10 13:53:00 +08:00
{
2023-09-21 19:55:55 +08:00
//获取全部表
var tables = await _tableRepository.GetListAsync();
foreach (var table in tables)
{
2023-09-21 19:59:38 +08:00
await _templateManager.HandlerAsync(table);
2023-09-21 19:55:55 +08:00
}
2023-06-10 13:53:00 +08:00
}
2023-09-21 19:55:55 +08:00
/// <summary>
/// 一键构建生成表
/// </summary>
/// <returns></returns>
public async Task PostBuildTableAsync()
2023-09-21 00:04:55 +08:00
{
2023-09-21 19:55:55 +08:00
}
2023-06-10 13:53:00 +08:00
}
}