feat:搭建webfirst模块
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Dtos
|
||||||
|
{
|
||||||
|
public class WebFirstGetOutputDto
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using SqlSugar;
|
||||||
|
using Yi.Framework.Infrastructure.Data.Auditing;
|
||||||
|
using Yi.Framework.Infrastructure.Ddd.Entities;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Entities
|
||||||
|
{
|
||||||
|
public class TemplateEntity : IEntity<long>, ICreationAuditedObject
|
||||||
|
{
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模板字符串
|
||||||
|
/// </summary>
|
||||||
|
public string TemplateStr { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public long? CreatorId { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreationTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Entities
|
||||||
|
{
|
||||||
|
public class TemplateVarEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 变量名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }=string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 变量值
|
||||||
|
/// </summary>
|
||||||
|
public string Value { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager
|
||||||
|
{
|
||||||
|
public interface ITemplateService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager
|
||||||
|
{
|
||||||
|
public interface ITemplateVarService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager
|
||||||
|
{
|
||||||
|
public interface IWebFirstService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||||
|
{
|
||||||
|
public class TemplateService: ITemplateService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||||
|
{
|
||||||
|
public class TemplateVarService: ITemplateVarService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
|
using Yi.Framework.Infrastructure.Ddd.Repositories;
|
||||||
|
using Yi.Framework.Infrastructure.Ddd.Services;
|
||||||
|
using Yi.Framework.Module.WebFirstManager.Dtos;
|
||||||
|
using Yi.Framework.Module.WebFirstManager.Entities;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||||
|
{
|
||||||
|
public class WebFirstService : ApplicationService, IWebFirstService
|
||||||
|
{
|
||||||
|
private IRepository<TemplateEntity> _repository;
|
||||||
|
public WebFirstService(IRepository<TemplateEntity> repository) { _repository = repository; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据模板id生成对应的结果
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<WebFirstGetOutputDto> GetAsync(Guid id)
|
||||||
|
{
|
||||||
|
var entity = await _repository.GetByIdAsync(id);
|
||||||
|
|
||||||
|
return entity.Adapt<WebFirstGetOutputDto>();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user