add some APIs

This commit is contained in:
2023-07-13 12:10:30 +08:00
parent 32464cb494
commit 8b759c94ec
34 changed files with 1211 additions and 1889 deletions

View File

@@ -4,17 +4,35 @@ using System.ComponentModel.DataAnnotations;
namespace Blahblah.FlowerStory.Server.Controller;
/// <summary>
/// 封面参数
/// </summary>
public record CoverParameter
{
/// <summary>
/// 封面
/// </summary>
[FromForm(Name = "cover")]
public IFormFile? Cover { get; init; }
/// <summary>
/// 封面 id
/// </summary>
[FromForm(Name = "cid")]
public int? CoverId { get; init; }
}
/// <summary>
/// 花草参数
/// </summary>
public record FlowerParameter
public record FlowerParameter : CoverParameter
{
/// <summary>
/// 类别 id
/// </summary>
[Required]
[FromForm(Name = "categoryId")]
public int CategoryId { get; init; }
public required int CategoryId { get; init; }
/// <summary>
/// 花草名称
@@ -28,7 +46,7 @@ public record FlowerParameter
/// </summary>
[Required]
[FromForm(Name = "dateBuy")]
public long DateBuy { get; init; }
public required long DateBuy { get; init; }
/// <summary>
/// 购买花费
@@ -43,10 +61,22 @@ public record FlowerParameter
public string? Purchase { get; init; }
/// <summary>
/// 花草封面
/// 备注
/// </summary>
[FromForm(Name = "cover")]
public IFormFile? Cover { get; init; }
[FromForm(Name = "memo")]
public string? Memo { get; set; }
/// <summary>
/// 纬度
/// </summary>
[FromForm(Name = "lat")]
public double? Latitude { get; set; }
/// <summary>
/// 经度
/// </summary>
[FromForm(Name = "lon")]
public double? Longitude { get; set; }
}
/// <summary>
@@ -59,7 +89,32 @@ public record FlowerUpdateParameter : FlowerParameter
/// </summary>
[Required]
[FromForm(Name = "id")]
public int Id { get; init; }
public required int Id { get; init; }
}
/// <summary>
/// 花草封面修改参数
/// </summary>
public record FlowerCoverParameter : CoverParameter
{
/// <summary>
/// 花草唯一 id
/// </summary>
[Required]
[FromForm(Name = "id")]
public required int Id { get; init; }
/// <summary>
/// 纬度
/// </summary>
[FromForm(Name = "lat")]
public double? Latitude { get; set; }
/// <summary>
/// 经度
/// </summary>
[FromForm(Name = "lon")]
public double? Longitude { get; set; }
}
/// <summary>