feat: 添加sample示例

This commit is contained in:
陈淳
2024-01-10 17:26:40 +08:00
parent a3f7c1e867
commit 2c8d579668
43 changed files with 907 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<ItemGroup>
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd.Application.Contracts\Yi.Framework.Ddd.Application.Contracts.csproj" />
<ProjectReference Include="..\..\module\bbs\Yi.Framework.Bbs.Application.Contracts\Yi.Framework.Bbs.Application.Contracts.csproj" />
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Application.Contracts\Yi.Framework.Rbac.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.Domain.Shared\Acme.BookStore.Domain.Shared.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using Acme.BookStore.Domain.Shared.Enums;
namespace Acme.BookStore.Application.Contracts.Dtos.Book
{
public class BookCreateUpdateDto
{
[Required]
[StringLength(128)]
public string Name { get; set; }
[Required]
public BookTypeEnum Type { get; set; } = BookTypeEnum.Undefined;
[Required]
[DataType(DataType.Date)]
public DateTime PublishDate { get; set; } = DateTime.Now;
[Required]
public float Price { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using Acme.BookStore.Domain.Shared.Enums;
using Volo.Abp.Application.Dtos;
namespace Acme.BookStore.Application.Contracts.Dtos.Book
{
public class BookDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public BookTypeEnum Type { get; set; }
public DateTime PublishDate { get; set; }
public float Price { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using Acme.BookStore.Application.Contracts.Dtos.Book;
using Volo.Abp.Application.Dtos;
using Yi.Framework.Ddd.Application.Contracts;
namespace Acme.BookStore.Application.Contracts.IServices
{
public interface IBookAppService :
IYiCrudAppService< //Defines CRUD methods
BookDto, //Used to show books
Guid, //Primary key of the book entity
PagedAndSortedResultRequestDto, //Used for paging/sorting
BookCreateUpdateDto> //Used to create/update a book
{
}
}

View File

@@ -0,0 +1,20 @@
using Volo.Abp.Modularity;
using Acme.BookStore.Domain.Shared;
using Yi.Framework.Bbs.Application.Contracts;
using Yi.Framework.Ddd.Application.Contracts;
using Yi.Framework.Rbac.Application.Contracts;
namespace Acme.BookStore.Application.Contracts
{
[DependsOn(
typeof(YiAbpDomainSharedModule),
typeof(YiFrameworkRbacApplicationContractsModule),
typeof(YiFrameworkBbsApplicationContractsModule),
typeof(YiFrameworkDddApplicationContractsModule))]
public class YiAbpApplicationContractsModule:AbpModule
{
}
}