更改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 List<long> UserIds { get; set; }
public List<long> RoleIds { get; set; }
public List<long>? UserIds { get; set; }
public List<long>? RoleIds { get; set; }
}
}

View File

@@ -8,11 +8,11 @@ namespace Yi.Framework.DtoModel.Base.Dto
{
public class LoginDto
{
public string UserName { get; set; }
public string Password { get; set; }
public string UserName { get; set; }=string.Empty;
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 string UserName { get; set; }
public string Password { get; set; }
public string UserName { get; set; } = string.Empty;
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 UserEntity User { get; set; }
public List<long> RoleIds { get; set; }
public List<long> PostIds { get; set; }
public UserEntity? User { get; set; }
public List<long>? RoleIds { get; set; }
public List<long>? PostIds { 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 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; }
@@ -30,10 +30,10 @@ namespace Yi.Framework.DtoModel.Base.Vo
public int? OrderNum { get; set; }
public string Remark { get; set; }
public List<string> Images { get; set; }
public string? Remark { get; set; }
public List<string>? Images { 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>
public string Content { get; set; }
public string Content { get; set; }=string.Empty;
/// <summary>
/// 点赞数
///</summary>
@@ -41,7 +41,7 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// 描述
///</summary>
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 子评论数
///</summary>
@@ -51,11 +51,11 @@ namespace Yi.Framework.DtoModel.Base.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

@@ -11,15 +11,15 @@ namespace Yi.Framework.DtoModel.Base.Vo
/// </summary>
public class UserVo
{
public string Name { get; set; }
public string? Name { 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; }
@@ -30,7 +30,7 @@ namespace Yi.Framework.DtoModel.Base.Vo
//public string Phone { get; set; }
public string Introduction { get; set; }
public string? Introduction { 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>
{
void GetError();
Task<List<StudentListOutput>> GetListAsync();
}
}

View File

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

View File

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

View File

@@ -13,6 +13,6 @@ namespace Yi.Framework.Model.Base
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 string Key { get; set; }
public string Value { get; set; }
public string? Key { get; set; }
public string? Value { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public ConditionalType Type { get; set; } = ConditionalType.Like;
}

View File

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

View File

@@ -20,7 +20,7 @@ namespace Yi.Framework.Model.ERP.Entitys
/// </summary>
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public long Id { get; set; }
/// <summary>
/// 租户id
@@ -35,28 +35,28 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary>
/// 物料id
/// </summary>
public long MaterialId { get; set; }
public long MaterialId { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string MaterialName { get; set; }
public string MaterialName { get; set; }=string.Empty;
/// <summary>
/// 物料单位
/// </summary>
public string MaterialUnit { get; set; }
public string MaterialUnit { get; set; }=string.Empty ;
/// <summary>
/// 单价
/// </summary>
public float UnitPrice { get; set; }
public float UnitPrice { get; set; }
/// <summary>
/// 总数量
/// </summary>
public long TotalNumber { get; set; }
public long TotalNumber { get; set; }
/// <summary>
/// 已完成数量
/// </summary>
@@ -64,6 +64,6 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary>
/// 备注
/// </summary>
public string Remarks { get; set; }
public string? Remarks { get; set; }
}
}

View File

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

View File

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

View File

@@ -20,7 +20,7 @@ namespace Yi.Framework.Model.ERP.Entitys
/// </summary>
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public long Id { get; set; }
/// <summary>
/// 租户id
@@ -30,16 +30,16 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary>
/// 单位编码
/// </summary>
public string Code { get; set; }
public string Code { get; set; }=string.Empty;
/// <summary>
/// 单位名称
/// </summary>
public string Name { get; set; }
public string Name { get; set; }=string.Empty;
/// <summary>
/// 备注
/// </summary>
public string Remarks { get; set; }
public string? Remarks { get; set; }
}
}

View File

@@ -21,7 +21,7 @@ namespace Yi.Framework.Model.ERP.Entitys
/// </summary>
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public long Id { get; set; }
/// <summary>
/// 租户id
@@ -31,21 +31,21 @@ namespace Yi.Framework.Model.ERP.Entitys
/// <summary>
/// 仓库编码
/// </summary>
public string Code { get; set; }
public string Code { get; set; }=string.Empty;
/// <summary>
/// 仓库名称
/// </summary>
public string Name { get; set; }
public string Name { get; set; }=string.Empty ;
/// <summary>
/// 备注
/// </summary>
public string Remarks { get; set; }
public string? Remarks { get; set; }
/// <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")]
public class StudentEntity : IEntity<Guid>, IMultiTenant
{
public string Name { get; set; }
public string Remark { get; set; }
public string? Name { get; set; }
public string? Remark { get; set; }
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public Guid Id { get; set; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,11 +14,6 @@ namespace Yi.Framework.Service.RABC
{
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()
{
throw new ApplicationException(StudentConst.);