新增数据信息 完善数据信息得权限问题
This commit is contained in:
2025-05-21 21:28:18 +08:00
parent 647f2b75c9
commit aaebbb9104
14 changed files with 640 additions and 13 deletions
+10 -1
View File
@@ -7,6 +7,7 @@ namespace LMS.Repository.DB;
public class Options
{
[Key]
[Required]
public required string Key { get; set; } = string.Empty;
/// <summary>
@@ -14,9 +15,17 @@ public class Options
/// </summary>
public string? Value { get; set; } = string.Empty;
[Required]
public OptionTypeEnum Type { get; set; } = OptionTypeEnum.String;
// 写一个字段,映射Value,判断是不是json字符串,是的话就解析成对象
[Required]
public OptionCategory Category { get; set; } = OptionCategory.System;
[Required]
public List<long> RoleIds { get; set; } = [];
public DateTime CreatedTime { get; set; }
// 写一个字段,映射Value,判断是不是json字符串,是的话就解析成对象
public T? GetValueObject<T>()
{
@@ -0,0 +1,21 @@
using LMS.Common.Enums;
namespace LMS.Repository.DTO.OptionDto
{
public class OptionSimpleDto
{
public required string Key { get; set; } = string.Empty;
/// <summary>
/// Value of the option,这个值是一个json字符串
/// </summary>
public string? Value { get; set; } = string.Empty;
public OptionTypeEnum Type { get; set; } = OptionTypeEnum.String;
public OptionCategory Category { get; set; } = OptionCategory.System;
public List<string> RoleNames { get; set; } = [];
}
}
@@ -1,6 +1,6 @@
using LMS.Common.Enums;
namespace LMS.Repository.DTO;
namespace LMS.Repository.DTO.OptionDto;
public class OptionsDto
{
+26
View File
@@ -0,0 +1,26 @@
using LMS.Common.Enums;
using System.ComponentModel.DataAnnotations;
namespace LMS.Repository.Options;
public class AddOptionModel
{
[Required]
public required string Key { get; set; } = string.Empty;
/// <summary>
/// Value of the option,这个值是一个json字符串
/// </summary>
public string? Value { get; set; } = string.Empty;
[Required]
public OptionTypeEnum Type { get; set; } = OptionTypeEnum.String;
[Required]
public OptionCategory Category { get; set; } = OptionCategory.System;
[Required]
public List<string> RoleNames { get; set; }
}
@@ -0,0 +1,20 @@
using LMS.Common.Enums;
using System.ComponentModel.DataAnnotations;
namespace LMS.Repository.Options;
public class ModifyOptionByKeyModel
{
/// <summary>
/// Value of the option,这个值是一个json字符串
/// </summary>
public required string Value { get; set; } = string.Empty;
public required OptionTypeEnum Type { get; set; } = OptionTypeEnum.String;
public required OptionCategory Category { get; set; } = OptionCategory.System;
[Required]
public required List<string> RoleNames { get; set; } = [];
}