feat:搭建webfirst模块

This commit is contained in:
陈淳
2023-06-10 13:53:00 +08:00
parent 496861587d
commit 1fe8b9c5c9
9 changed files with 154 additions and 0 deletions

View File

@@ -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
{
}
}

View File

@@ -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; }
}
}

View File

@@ -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;
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -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>();
}
}
}