添加dto模式的demo测试
This commit is contained in:
@@ -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
|
||||
{
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
/// 前端只需要这些数据即可
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,9 @@
|
||||
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="BBS\" />
|
||||
<Folder Include="Shop\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user