forked from gongxuegit/tiku-backend.net
feat: add scoreline dynamic records
This commit is contained in:
@@ -287,6 +287,75 @@ public sealed class DirectMajorDto
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DirectScorelineFieldDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid? RegionId { get; set; }
|
||||
public string? LegacyId { get; set; }
|
||||
public required string FieldKey { get; set; }
|
||||
public required string FieldName { get; set; }
|
||||
public string? FieldType { get; set; }
|
||||
public string? Unit { get; set; }
|
||||
public bool? IsFilter { get; set; }
|
||||
public bool? IsRequired { get; set; }
|
||||
public bool? IsVisible { get; set; }
|
||||
public bool? IsTrend { get; set; }
|
||||
public JsonElement Options { get; set; } = JsonDefaults.Array();
|
||||
public string? Placeholder { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public int? Order { get; set; }
|
||||
|
||||
public ScorelineFieldCommand ToCommand()
|
||||
{
|
||||
return new ScorelineFieldCommand(
|
||||
Id,
|
||||
RegionId,
|
||||
LegacyId,
|
||||
FieldKey,
|
||||
FieldName,
|
||||
FieldType,
|
||||
Unit,
|
||||
IsFilter,
|
||||
IsRequired,
|
||||
IsVisible,
|
||||
IsTrend,
|
||||
Options,
|
||||
Placeholder,
|
||||
Description,
|
||||
Order);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DirectScorelineRecordDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid? RegionId { get; set; }
|
||||
public Guid? SchoolId { get; set; }
|
||||
public Guid? MajorId { get; set; }
|
||||
public string? LegacyId { get; set; }
|
||||
|
||||
[Range(1900, 3000)]
|
||||
public int Year { get; set; }
|
||||
|
||||
public string? SchoolName { get; set; }
|
||||
public string? MajorName { get; set; }
|
||||
public JsonElement FieldValues { get; set; } = JsonDefaults.Object();
|
||||
|
||||
public ScorelineRecordCommand ToCommand()
|
||||
{
|
||||
return new ScorelineRecordCommand(
|
||||
Id,
|
||||
RegionId,
|
||||
SchoolId,
|
||||
MajorId,
|
||||
LegacyId,
|
||||
Year,
|
||||
SchoolName,
|
||||
MajorName,
|
||||
FieldValues);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DirectVideoDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
46
Tiku.Api/Contracts/ScorelineDtos.cs
Normal file
46
Tiku.Api/Contracts/ScorelineDtos.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Tiku.Application.Scoreline;
|
||||
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed class ScorelineQueryDto
|
||||
{
|
||||
[StringLength(100)]
|
||||
public string? TenantCode { get; set; }
|
||||
|
||||
public Guid? RegionId { get; set; }
|
||||
public Guid? SchoolId { get; set; }
|
||||
public Guid? MajorId { get; set; }
|
||||
|
||||
[StringLength(100)]
|
||||
public string? Keyword { get; set; }
|
||||
|
||||
[Range(1900, 3000)]
|
||||
public int? Year { get; set; }
|
||||
|
||||
[Range(1, 10000)]
|
||||
public int? Page { get; set; }
|
||||
|
||||
[Range(1, 200)]
|
||||
public int? PageSize { get; set; }
|
||||
|
||||
[Range(1, 2000)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public ScorelineFilter ToFilter(
|
||||
Guid tenantId,
|
||||
IReadOnlyCollection<ScorelineDynamicFilter>? dynamicFilters = null)
|
||||
{
|
||||
return new ScorelineFilter(
|
||||
tenantId,
|
||||
RegionId,
|
||||
SchoolId,
|
||||
MajorId,
|
||||
Keyword,
|
||||
Year,
|
||||
Page,
|
||||
PageSize,
|
||||
Limit,
|
||||
dynamicFilters);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user