更改null操作

This commit is contained in:
橙子
2023-01-05 20:32:58 +08:00
parent efbf799218
commit b7c9b84449
25 changed files with 71 additions and 76 deletions

View File

@@ -8,7 +8,7 @@ namespace Yi.Framework.DtoModel.Base.Dto
{ {
public class GiveUserSetRoleDto public class GiveUserSetRoleDto
{ {
public List<long> UserIds { get; set; } public List<long>? UserIds { get; set; }
public List<long> RoleIds { get; set; } public List<long>? RoleIds { get; set; }
} }
} }

View File

@@ -8,11 +8,11 @@ namespace Yi.Framework.DtoModel.Base.Dto
{ {
public class LoginDto public class LoginDto
{ {
public string UserName { get; set; } public string UserName { get; set; }=string.Empty;
public string Password { get; set; } public string Password { get; set; } = string.Empty;
public string Uuid { get; set; } public string? Uuid { get; set; }
public string Code { get; set; } public string? Code { get; set; }
} }
} }

View File

@@ -8,9 +8,9 @@ namespace Yi.Framework.DtoModel.Base.Dto
{ {
public class RegisterDto public class RegisterDto
{ {
public string UserName { get; set; } public string UserName { get; set; } = string.Empty;
public string Password { get; set; } public string Password { get; set; } = string.Empty;
public string Name { get; set; } public string Name { get; set; } = string.Empty;
} }
} }

View File

@@ -9,9 +9,9 @@ namespace Yi.Framework.DtoModel.Base.Dto
{ {
public class UserInfoDto public class UserInfoDto
{ {
public UserEntity User { get; set; } public UserEntity? User { get; set; }
public List<long> RoleIds { get; set; } public List<long>? RoleIds { get; set; }
public List<long> PostIds { get; set; } public List<long>? PostIds { get; set; }
public long? DeptId { get; set; } public long? DeptId { get; set; }
} }
} }

View File

@@ -10,9 +10,9 @@ namespace Yi.Framework.DtoModel.Base.Vo
{ {
public long Id { get; set; } public long Id { get; set; }
public string Title { get; set; } public string Title { get; set; } = string.Empty;
public string Content { get; set; } public string Content { get; set; } = string.Empty;
public long? UserId { get; set; } public long? UserId { get; set; }
@@ -30,10 +30,10 @@ namespace Yi.Framework.DtoModel.Base.Vo
public int? OrderNum { get; set; } public int? OrderNum { get; set; }
public string Remark { get; set; } public string? Remark { get; set; }
public List<string> Images { get; set; } public List<string>? Images { get; set; }
public int? AgreeNum { get; set; } public int? AgreeNum { get; set; }
public UserVo User { get; set; } public UserVo? User { get; set; }
} }
} }

View File

@@ -14,7 +14,7 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// <summary> /// <summary>
/// 评论内容 /// 评论内容
///</summary> ///</summary>
public string Content { get; set; } public string Content { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 点赞数 /// 点赞数
///</summary> ///</summary>
@@ -41,7 +41,7 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// 描述 /// 描述
///</summary> ///</summary>
public string Remark { get; set; } public string? Remark { get; set; }
/// <summary> /// <summary>
/// 子评论数 /// 子评论数
///</summary> ///</summary>
@@ -51,11 +51,11 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// <summary> /// <summary>
/// 被回复的用户信息 /// 被回复的用户信息
///</summary> ///</summary>
public UserVo UserInfo { get; set; } public UserVo? UserInfo { get; set; }
/// <summary> /// <summary>
/// 创建评论的用户信息 /// 创建评论的用户信息
///</summary> ///</summary>
public UserVo CreateUserInfo { get; set; } public UserVo? CreateUserInfo { get; set; }
} }
} }

View File

@@ -11,15 +11,15 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// </summary> /// </summary>
public class UserVo public class UserVo
{ {
public string Name { get; set; } public string? Name { get; set; }
public int? Age { get; set; } public int? Age { get; set; }
public string UserName { get; set; } public string? UserName { get; set; }
public string Icon { get; set; } public string? Icon { get; set; }
public string Nick { get; set; } public string? Nick { get; set; }
//public string Email { get; set; } //public string Email { get; set; }
@@ -30,7 +30,7 @@ namespace Yi.Framework.DtoModel.Base.Vo
//public string Phone { get; set; } //public string Phone { get; set; }
public string Introduction { get; set; } public string? Introduction { get; set; }
public int? Sex { get; set; } public int? Sex { get; set; }
} }

View File

@@ -9,6 +9,5 @@ namespace Yi.Framework.Interface.RABC
public interface IStudentService : ICrudAppService<StudentGetOutput, StudentListOutput, Guid, StudentCreateInput, StudentUpdateInput> public interface IStudentService : ICrudAppService<StudentGetOutput, StudentListOutput, Guid, StudentCreateInput, StudentUpdateInput>
{ {
void GetError(); void GetError();
Task<List<StudentListOutput>> GetListAsync();
} }
} }

View File

@@ -8,7 +8,7 @@ namespace Yi.Framework.Model.Base
{ {
public class Entity<Key> : IEntity<Key> public class Entity<Key> : IEntity<Key>
{ {
public Key Id { get; set; } public Key Id { get; set; }=default(Key)!;
public object[] GetKeys() public object[] GetKeys()
{ {

View File

@@ -12,7 +12,7 @@ namespace Yi.Framework.Model.Base
// //
// 摘要: // 摘要:
// Id of the entity. // Id of the entity.
public TKey Id { get; set; } public TKey? Id { get; set; }
public override string ToString() public override string ToString()
{ {

View File

@@ -13,6 +13,6 @@ namespace Yi.Framework.Model.Base
public interface IEntityDto<TKey> : IEntityDto public interface IEntityDto<TKey> : IEntityDto
{ {
TKey Id { get; set; } TKey? Id { get; set; }
} }
} }

View File

@@ -11,8 +11,8 @@ namespace Yi.Framework.Model.Base.Query
{ {
public class QueryParameter public class QueryParameter
{ {
public string Key { get; set; } public string? Key { get; set; }
public string Value { get; set; } public string? Value { get; set; }
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public ConditionalType Type { get; set; } = ConditionalType.Like; public ConditionalType Type { get; set; } = ConditionalType.Like;
} }

View File

@@ -30,21 +30,21 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 物料编码 /// 物料编码
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 物料名称 /// 物料名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 物料单位 /// 物料单位
/// </summary> /// </summary>
public string UnitName { get; set; } public string UnitName { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remarks { get; set; } public string? Remarks { get; set; }
} }
} }

View File

@@ -41,12 +41,12 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 物料名称 /// 物料名称
/// </summary> /// </summary>
public string MaterialName { get; set; } public string MaterialName { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 物料单位 /// 物料单位
/// </summary> /// </summary>
public string MaterialUnit { get; set; } public string MaterialUnit { get; set; }=string.Empty ;
/// <summary> /// <summary>
@@ -64,6 +64,6 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remarks { get; set; } public string? Remarks { get; set; }
} }
} }

View File

@@ -30,17 +30,17 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 采购单号 /// 采购单号
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 需求时间 /// 需求时间
/// </summary> /// </summary>
public DateTime NeedTime { get; set; } public DateTime? NeedTime { get; set; }
/// <summary> /// <summary>
/// 采购员 /// 采购员
/// </summary> /// </summary>
public string Buyer { get; set; } public string? Buyer { get; set; }
/// <summary> /// <summary>
/// 总共金额 /// 总共金额
@@ -55,7 +55,8 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 采购状态 /// 采购状态
/// </summary> /// </summary>
public PurchaseStateEnum PurchaseState { get; set; } public PurchaseStateEnum PurchaseState { get; set; } = PurchaseStateEnum.Build;
} }
public enum PurchaseStateEnum public enum PurchaseStateEnum

View File

@@ -30,29 +30,29 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 供应商编码 /// 供应商编码
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 供应商名称 /// 供应商名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }= string.Empty;
/// <summary> /// <summary>
/// 供应商地址 /// 供应商地址
/// </summary> /// </summary>
public string Address { get; set; } public string? Address { get; set; }
/// <summary> /// <summary>
/// 电话 /// 电话
/// </summary> /// </summary>
public long Phone { get; set; } public long? Phone { get; set; }
/// <summary> /// <summary>
/// 传真 /// 传真
/// </summary> /// </summary>
public string Fax { get; set; } public string? Fax { get; set; }
/// <summary> /// <summary>
/// 邮箱 /// 邮箱
/// </summary> /// </summary>
public string Email { get; set; } public string? Email { get; set; }
} }
} }

View File

@@ -30,16 +30,16 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 单位编码 /// 单位编码
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 单位名称 /// 单位名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remarks { get; set; } public string? Remarks { get; set; }
} }
} }

View File

@@ -31,21 +31,21 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary> /// <summary>
/// 仓库编码 /// 仓库编码
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; }=string.Empty;
/// <summary> /// <summary>
/// 仓库名称 /// 仓库名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }=string.Empty ;
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remarks { get; set; } public string? Remarks { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
public StateEnum State { get; set; } public StateEnum State { get; set; } = StateEnum.Normal;
} }
} }

View File

@@ -7,8 +7,8 @@ namespace Yi.Framework.Model.RABC.Entitys
[SugarTable("Student")] [SugarTable("Student")]
public class StudentEntity : IEntity<Guid>, IMultiTenant public class StudentEntity : IEntity<Guid>, IMultiTenant
{ {
public string Name { get; set; } public string? Name { get; set; }
public string Remark { get; set; } public string? Remark { get; set; }
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public Guid Id { get; set; } public Guid Id { get; set; }

View File

@@ -146,7 +146,7 @@ namespace Yi.Framework.Model.RABC.Entitys
/// <summary> /// <summary>
/// 构建密码MD5盐值加密 /// 构建密码MD5盐值加密
/// </summary> /// </summary>
public UserEntity BuildPassword(string password = null) public UserEntity BuildPassword(string? password = null)
{ {
//如果不传值那就把自己的password当作传进来的password //如果不传值那就把自己的password当作传进来的password
if (password == null) if (password == null)

View File

@@ -29,7 +29,7 @@ namespace Yi.Framework.Model.SHOP.Entitys
/// 分类名称 /// 分类名称
///</summary> ///</summary>
[SugarColumn(ColumnName = "CategoryName")] [SugarColumn(ColumnName = "CategoryName")]
public string CategoryName { get; set; } public string? CategoryName { get; set; }
/// <summary> /// <summary>
/// 创建者 /// 创建者
///</summary> ///</summary>

View File

@@ -29,7 +29,7 @@ namespace Yi.Framework.Model.SHOP.Entitys
/// 商品规格名 /// 商品规格名
///</summary> ///</summary>
[SugarColumn(ColumnName = "SpecsName")] [SugarColumn(ColumnName = "SpecsName")]
public string SpecsName { get; set; } public string? SpecsName { get; set; }
/// <summary> /// <summary>
/// 创建者 /// 创建者
///</summary> ///</summary>

View File

@@ -29,7 +29,7 @@ namespace Yi.Framework.Model.SHOP.Entitys
/// 商品规格组名 /// 商品规格组名
///</summary> ///</summary>
[SugarColumn(ColumnName = "SpecsGroupName")] [SugarColumn(ColumnName = "SpecsGroupName")]
public string SpecsGroupName { get; set; } public string? SpecsGroupName { get; set; }
/// <summary> /// <summary>
/// 创建者 /// 创建者
///</summary> ///</summary>

View File

@@ -6,11 +6,11 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;CS8625;CS8618</NoWarn> <NoWarn>1701;1702</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;CS8625;CS8618</NoWarn> <NoWarn>1701;1702</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -14,11 +14,6 @@ namespace Yi.Framework.Service.RABC
{ {
public class StudentService : CrudAppService<StudentEntity, StudentGetOutput, StudentListOutput, Guid, StudentCreateInput, StudentUpdateInput>, IStudentService public class StudentService : CrudAppService<StudentEntity, StudentGetOutput, StudentListOutput, Guid, StudentCreateInput, StudentUpdateInput>, IStudentService
{ {
public async Task<List<StudentListOutput>> GetListAsync()
{
return await MapToGetListOutputDtosAsync(await Repository.GetListAsync());
}
public void GetError() public void GetError()
{ {
throw new ApplicationException(StudentConst.); throw new ApplicationException(StudentConst.);