feat: 完成子文章的操作
This commit is contained in:
@@ -13,6 +13,8 @@ using Yi.Framework.Core.Configuration;
|
||||
using Yi.Framework.Core.Model;
|
||||
using Yi.Framework.Core.Sqlsugar.Const;
|
||||
using Yi.Framework.Core.Sqlsugar.Options;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Data.Entities;
|
||||
using DbType = SqlSugar.DbType;
|
||||
|
||||
namespace Yi.Framework.Core.Sqlsugar.Extensions
|
||||
@@ -93,15 +95,46 @@ namespace Yi.Framework.Core.Sqlsugar.Extensions
|
||||
}
|
||||
db.Aop.DataExecuting = (oldValue, entityInfo) =>
|
||||
{
|
||||
//这里将进行审计日志
|
||||
|
||||
switch (entityInfo.OperationType)
|
||||
{
|
||||
case DataFilterType.InsertByObject:
|
||||
break;
|
||||
case DataFilterType.UpdateByObject:
|
||||
|
||||
if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.LastModificationTime)))
|
||||
{
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
}
|
||||
//if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.LastModifierId)))
|
||||
//{
|
||||
// if (_currentUser != null)
|
||||
// {
|
||||
// entityInfo.SetValue(_currentUser.Id);
|
||||
// }
|
||||
//}
|
||||
break;
|
||||
case DataFilterType.InsertByObject:
|
||||
if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.CreationTime)))
|
||||
{
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
}
|
||||
//if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.CreatorId)))
|
||||
//{
|
||||
// if (_currentUser != null)
|
||||
// {
|
||||
// entityInfo.SetValue(_currentUser.Id);
|
||||
// }
|
||||
//}
|
||||
|
||||
//插入时,需要租户id,先预留
|
||||
if (entityInfo.PropertyName.Equals(nameof(IMultiTenant.TenantId)))
|
||||
{
|
||||
//if (this.CurrentTenant is not null)
|
||||
//{
|
||||
// entityInfo.SetValue(this.CurrentTenant.Id);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量定义
|
||||
/// </summary>
|
||||
|
||||
public class DictionaryConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.Framework.DictionaryManager.Entities;
|
||||
using Yi.Framework.DictionaryManager.Dtos.Dictionary;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class DictionaryService : CrudAppService<DictionaryEntity, DictionaryGetOutputDto, DictionaryGetListOutputDto, long, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>,
|
||||
IDictionaryService, IAutoApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
|
||||
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
|
||||
{
|
||||
int total = 0;
|
||||
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
|
||||
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
return new PagedResultDto<DictionaryGetListOutputDto>
|
||||
{
|
||||
Total = total,
|
||||
Items = await MapToGetListOutputDtosAsync(entities)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据字典类型获取字典列表
|
||||
/// </summary>
|
||||
/// <param name="dicType"></param>
|
||||
/// <returns></returns>
|
||||
[Route("/api/dictionary/dic-type/{dicType}")]
|
||||
public async Task<List<DictionaryGetListOutputDto>> GetDicType([FromRoute] string dicType)
|
||||
{
|
||||
var entities = await _repository.GetListAsync(u => u.DictType == dicType && u.State == true);
|
||||
var result = await MapToGetListOutputDtosAsync(entities);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量定义
|
||||
/// </summary>
|
||||
|
||||
public class DictionaryTypeConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.DictionaryManager.Dtos.DictionaryType;
|
||||
using Yi.Framework.DictionaryManager.Entities;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// DictionaryType服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class DictionaryTypeService : CrudAppService<DictionaryTypeEntity, DictionaryTypeGetOutputDto, DictionaryTypeGetListOutputDto, long, DictionaryTypeGetListInputVo, DictionaryTypeCreateInputVo, DictionaryTypeUpdateInputVo>,
|
||||
IDictionaryTypeService, IAutoApiService
|
||||
{
|
||||
|
||||
|
||||
public async override Task<PagedResultDto<DictionaryTypeGetListOutputDto>> GetListAsync(DictionaryTypeGetListInputVo input)
|
||||
{
|
||||
|
||||
int total = 0;
|
||||
var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!))
|
||||
.WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
|
||||
return new PagedResultDto<DictionaryTypeGetListOutputDto>
|
||||
{
|
||||
Total = total,
|
||||
Items = await MapToGetListOutputDtosAsync(entities)
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.Dictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary输入创建对象
|
||||
/// </summary>
|
||||
public class DictionaryCreateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? ListClass { get; set; }
|
||||
public string? CssClass { get; set; }
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? DictLabel { get; set; }
|
||||
public string DictValue { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.Dictionary
|
||||
{
|
||||
public class DictionaryGetListInputVo : PagedAndSortedResultRequestDto
|
||||
{
|
||||
public string? DictType { get; set; }
|
||||
public string? DictLabel { get; set; }
|
||||
public bool? State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.Dictionary
|
||||
{
|
||||
public class DictionaryGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? ListClass { get; set; }
|
||||
public string? CssClass { get; set; }
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? DictLabel { get; set; }
|
||||
public string DictValue { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; }
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.Dictionary
|
||||
{
|
||||
public class DictionaryGetOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? ListClass { get; set; }
|
||||
public string? CssClass { get; set; }
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? DictLabel { get; set; }
|
||||
public string DictValue { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.Dictionary
|
||||
{
|
||||
public class DictionaryUpdateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? ListClass { get; set; }
|
||||
public string? CssClass { get; set; }
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? DictLabel { get; set; }
|
||||
public string DictValue { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.DictionaryType
|
||||
{
|
||||
/// <summary>
|
||||
/// DictionaryType输入创建对象
|
||||
/// </summary>
|
||||
public class DictionaryTypeCreateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string DictName { get; set; } = string.Empty;
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.DictionaryType
|
||||
{
|
||||
public class DictionaryTypeGetListInputVo : PagedAllResultRequestDto
|
||||
{
|
||||
public string? DictName { get; set; }
|
||||
public string? DictType { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public bool? State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.DictionaryType
|
||||
{
|
||||
public class DictionaryTypeGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string DictName { get; set; } = string.Empty;
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.DictionaryType
|
||||
{
|
||||
public class DictionaryTypeGetOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string DictName { get; set; } = string.Empty;
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Dtos.DictionaryType
|
||||
{
|
||||
public class DictionaryTypeUpdateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public string DictName { get; set; } = string.Empty;
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
public bool State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Data.Entities;
|
||||
using Yi.Framework.Ddd.Entities;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Entities
|
||||
{
|
||||
[SugarTable("Dictionary")]
|
||||
public class DictionaryEntity : AuditedObject, IEntity<long>, ISoftDelete, IOrderNum, IState
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 逻辑删除
|
||||
/// </summary>
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public bool State { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// tag类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ListClass")]
|
||||
public string? ListClass { get; set; }
|
||||
/// <summary>
|
||||
/// tagClass
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CssClass")]
|
||||
public string? CssClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictType")]
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 字典标签
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictLabel")]
|
||||
public string? DictLabel { get; set; }
|
||||
/// <summary>
|
||||
/// 字典值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictValue")]
|
||||
public string DictValue { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 是否为该类型的默认值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDefault")]
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Data.Entities;
|
||||
using Yi.Framework.Ddd.Entities;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager.Entities
|
||||
{
|
||||
[SugarTable("DictionaryType")]
|
||||
public class DictionaryTypeEntity : AuditedObject, IEntity<long>, ISoftDelete, IOrderNum
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 逻辑删除
|
||||
/// </summary>
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; } = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public bool? State { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictName")]
|
||||
public string DictName { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictType")]
|
||||
public string DictType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
using Yi.Framework.DictionaryManager.Dtos.Dictionary;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary服务抽象
|
||||
/// </summary>
|
||||
public interface IDictionaryService : ICrudAppService<DictionaryGetOutputDto, DictionaryGetListOutputDto, long, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
using Yi.Framework.DictionaryManager.Dtos.DictionaryType;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// DictionaryType服务抽象
|
||||
/// </summary>
|
||||
public interface IDictionaryTypeService : ICrudAppService<DictionaryTypeGetOutputDto, DictionaryTypeGetListOutputDto, long, DictionaryTypeGetListInputVo, DictionaryTypeCreateInputVo, DictionaryTypeUpdateInputVo>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd\Yi.Framework.Ddd.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StartupModules;
|
||||
|
||||
namespace Yi.Framework.DictionaryManager
|
||||
{
|
||||
public class YiFrameworkDictionaryManagerModule : IStartupModule
|
||||
{
|
||||
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -14,7 +14,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string? Introduction { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public DateTime? CreateTime { get; set; } = DateTime.Now;
|
||||
public string Content { get; set; }
|
||||
public string? Color { get; set; }
|
||||
|
||||
|
||||
@@ -20,5 +20,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||
public int SeeNum { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string? Color { get; set; }
|
||||
|
||||
public long PlateId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||
public int SeeNum { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string? Color { get; set; }
|
||||
|
||||
public long PlateId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||
public string Title { get; set; }
|
||||
public string Types { get; set; }
|
||||
public string? Introduction { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public int AgreeNum { get; set; }
|
||||
public int SeeNum { get; set; }
|
||||
public string Content { get; set; }
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Yi.BBS.Application.Forum
|
||||
var entities = await _DbQueryable
|
||||
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title))
|
||||
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
|
||||
.OrderByDescending(x => x.CreateTime)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
var items = await MapToGetListOutputDtosAsync(entities);
|
||||
return new PagedResultDto<DiscussGetListOutputDto>(total, items);
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Yi.BBS.Domain.Forum.Entities
|
||||
/// <returns></returns>
|
||||
public static List<ArticleEntity> Tile(this List<ArticleEntity> entities)
|
||||
{
|
||||
if(entities is null)return new List<ArticleEntity>();
|
||||
var result = new List<ArticleEntity>();
|
||||
return StartRecursion(entities, result);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -15,8 +15,8 @@
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Yi.Framework.DictionaryManager\Yi.Framework.DictionaryManager.csproj" />
|
||||
<ProjectReference Include="..\..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.DictionaryManager\Yi.Framework.DictionaryManager.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.EventBus\Yi.Framework.EventBus.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.FileManager\Yi.Framework.FileManager.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.OperLogManager\Yi.Framework.OperLogManager.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user