添加dto模式的demo测试

This commit is contained in:
chenchun
2023-01-01 23:51:05 +08:00
parent b9384afd5d
commit 5d7d115910
55 changed files with 582 additions and 98 deletions

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class GiveRoleSetMenuDto
{

View File

@@ -4,11 +4,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class GiveUserSetRoleDto
{
public List<long> UserIds { get; set; }
public List<long> RoleIds { get; set;}
public List<long> RoleIds { get; set; }
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class LoginDto
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class RegisterDto
{

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Model.RABC.Entitys;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class RoleInfoDto
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class UpdatePasswordDto
{

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Model.RABC.Entitys;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class UserInfoDto
{

View File

@@ -5,15 +5,15 @@ using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Model.RABC.Entitys;
namespace Yi.Framework.DTOModel
namespace Yi.Framework.DTOModel.Base.Dto
{
public class UserRoleMenuDto
{
public UserEntity User { get; set; }=new ();
public UserEntity User { get; set; } = new();
public HashSet<RoleEntity> Roles { get; set; } = new();
public HashSet<MenuEntity> Menus { get; set; }=new();
public HashSet<MenuEntity> Menus { get; set; } = new();
public List<string> RoleCodes { get; set; } =new();
public List<string> RoleCodes { get; set; } = new();
public List<string> PermissionCodes { get; set; } = new();
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel.Vo
namespace Yi.Framework.DTOModel.Base.Vo
{
public class ArticleVo
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel.Vo
namespace Yi.Framework.DTOModel.Base.Vo
{
public class CommentVo
{
@@ -51,11 +51,11 @@ namespace Yi.Framework.DTOModel.Vo
/// <summary>
/// 被回复的用户信息
///</summary>
public UserVo? UserInfo { get; set; }
public UserVo UserInfo { get; set; }
/// <summary>
/// 创建评论的用户信息
///</summary>
public UserVo? CreateUserInfo { get; set; }
public UserVo CreateUserInfo { get; set; }
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.DTOModel.Vo
namespace Yi.Framework.DTOModel.Base.Vo
{
/// <summary>
/// 前端只需要这些数据即可

View File

@@ -0,0 +1,22 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Model.RABC.Entitys;
namespace Yi.Framework.DTOModel.RABC.Student.MapperConfig
{
public class StudentProfile : Profile
{
public StudentProfile()
{
CreateMap<StudentCreateInput, StudentEntity>();
CreateMap<StudentUpdateInput, StudentEntity>();
CreateMap<StudentCreateUpdateInput, StudentEntity>();
CreateMap<StudentEntity, StudentGetOutput>();
CreateMap<StudentEntity, StudentListOutput>();
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Yi.Framework.DTOModel.RABC.Student
{
public class StudentCreateInput
{
public string Name { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Yi.Framework.DTOModel.RABC.Student
{
public class StudentCreateUpdateInput
{
public string Name { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Yi.Framework.Model.Base;
namespace Yi.Framework.DTOModel.RABC.Student
{
public class StudentGetOutput : EntityDto<Guid>
{
public string Name { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Yi.Framework.Model.Base;
namespace Yi.Framework.DTOModel.RABC.Student
{
public class StudentListOutput : EntityDto<Guid>
{
public string Name { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Yi.Framework.DTOModel.RABC.Student
{
public class StudentUpdateInput
{
public string Name { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -8,4 +8,9 @@
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="BBS\" />
<Folder Include="Shop\" />
</ItemGroup>
</Project>