forked from gongxuegit/tiku-backend.net
feat: add student points endpoints
This commit is contained in:
48
Tiku.Api/Contracts/PointDtos.cs
Normal file
48
Tiku.Api/Contracts/PointDtos.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Tiku.Application.Points;
|
||||
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed class PointQueryDto
|
||||
{
|
||||
[Range(1, 200)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
[StringLength(32)]
|
||||
public string? Status { get; set; }
|
||||
|
||||
public Guid? RegionId { get; set; }
|
||||
|
||||
public PointLimitQuery ToQuery()
|
||||
{
|
||||
return new PointLimitQuery(Limit, Status, RegionId);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ClaimPointTaskDto
|
||||
{
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
public string TaskKey { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(100)]
|
||||
public string? SourceType { get; set; }
|
||||
|
||||
public Guid? SourceId { get; set; }
|
||||
|
||||
public ClaimPointTaskCommand ToCommand()
|
||||
{
|
||||
return new ClaimPointTaskCommand(TaskKey, SourceType, SourceId);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CreatePointExchangeOrderDto
|
||||
{
|
||||
[Required]
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
public CreatePointExchangeOrderCommand ToCommand()
|
||||
{
|
||||
return new CreatePointExchangeOrderCommand(ItemId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user