feat: 完成yi-abp模块生成

This commit is contained in:
橙子
2024-06-02 14:12:37 +08:00
parent bca3ce1e5f
commit d9c9db332c
5 changed files with 37 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ namespace Yi.Abp.Tool.Application
/// 下载模块文件
/// </summary>
/// <returns></returns>
public async Task<IActionResult> CreateModuleAsync(TemplateGenCreateInputDto moduleCreateInputDto)
public async Task<byte[]> CreateModuleAsync(TemplateGenCreateInputDto moduleCreateInputDto)
{
moduleCreateInputDto.SetNameReplace();
@@ -33,17 +33,17 @@ namespace Yi.Abp.Tool.Application
input.SetTemplateFilePath(_templateGenManager._toolOptions.ModuleTemplateFilePath);
var filePath = await _templateGenManager.CreateTemplateAsync(input);
//考虑从路径中获取
var fileContentType = MimeHelper.GetMimeMapping(Path.GetFileName(filePath));
////考虑从路径中获取
//var fileContentType = MimeHelper.GetMimeMapping(Path.GetFileName(filePath));
//设置附件下载,下载名称
return new FileContentResult(await File.ReadAllBytesAsync(filePath), fileContentType);
return await File.ReadAllBytesAsync(filePath);
}
/// <summary>
/// 下载模块文件
/// </summary>
/// <returns></returns>
public async Task<IActionResult> CreateProjectAsync(TemplateGenCreateInputDto moduleCreateInputDto)
public async Task<byte[]> CreateProjectAsync(TemplateGenCreateInputDto moduleCreateInputDto)
{
moduleCreateInputDto.SetNameReplace();
@@ -52,9 +52,9 @@ namespace Yi.Abp.Tool.Application
var filePath = await _templateGenManager.CreateTemplateAsync(input);
//考虑从路径中获取
var fileContentType = MimeHelper.GetMimeMapping(Path.GetFileName(filePath));
// var fileContentType = MimeHelper.GetMimeMapping(Path.GetFileName(filePath));
//设置附件下载,下载名称
return new FileContentResult(await File.ReadAllBytesAsync(filePath), fileContentType);
return await File.ReadAllBytesAsync(filePath);
}
}
}