mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-30 05:36:37 +08:00
添加excel模块
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public interface IEntityDto
|
||||
{
|
||||
}
|
||||
|
||||
public interface IEntityDto<TKey> : IEntityDto
|
||||
{
|
||||
TKey Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public interface IHasTotalCount
|
||||
{
|
||||
long Total { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public interface IListResult<T>
|
||||
{
|
||||
IReadOnlyList<T> Items { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos.Abstract
|
||||
{
|
||||
public interface IPagedAllResultRequestDto
|
||||
{
|
||||
DateTime? StartTime { get; set; }
|
||||
DateTime? EndTime { 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.Core.Enums;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public interface IPagedAndSortedResultRequestDto
|
||||
{
|
||||
int PageIndex { get; set; }
|
||||
int PageSize { get; set; }
|
||||
string? SortBy { get; set; }
|
||||
|
||||
OrderByEnum SortType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public interface IPagedResult<T> : IListResult<T>, IHasTotalCount
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
[Serializable]
|
||||
public abstract class EntityDto<TKey> : EntityDto, IEntityDto<TKey>, IEntityDto
|
||||
{
|
||||
//
|
||||
// 摘要:
|
||||
// Id of the entity.
|
||||
public TKey Id { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[DTO: {GetType().Name}] Id = {Id}";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public abstract class EntityDto : IEntityDto
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "[DTO: " + GetType().Name + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
[Serializable]
|
||||
public class ListResultDto<T> : IListResult<T>
|
||||
{
|
||||
public IReadOnlyList<T> Items
|
||||
{
|
||||
get { return _items ?? (_items = new List<T>()); }
|
||||
set { _items = value; }
|
||||
}
|
||||
private IReadOnlyList<T> _items;
|
||||
|
||||
public ListResultDto()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ListResultDto(IReadOnlyList<T> items)
|
||||
{
|
||||
Items = items;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.Abstract;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public class PagedAllResultRequestDto : PagedAndSortedResultRequestDto, IPageTimeResultRequestDto, IPagedAndSortedResultRequestDto
|
||||
{
|
||||
public DateTime? StartTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Core.Enums;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public class PagedAndSortedResultRequestDto : IPagedAndSortedResultRequestDto
|
||||
{
|
||||
public int PageIndex { get; set; } = 1;
|
||||
public int PageSize { get; set; } = int.MaxValue;
|
||||
public string? SortBy { get; set; }
|
||||
public OrderByEnum SortType { get; set; } = OrderByEnum.Desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public class PagedResultDto<T>:ListResultDto<T>, IPagedResult<T>
|
||||
{
|
||||
public long Total { get; set; }
|
||||
|
||||
public PagedResultDto()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PagedResultDto(long totalCount, IReadOnlyList<T> items)
|
||||
: base(items)
|
||||
{
|
||||
Total = totalCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user