using Blahblah.FlowerStory.Server.Data.Model; using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; namespace Blahblah.FlowerStory.Server.Controller; /// /// 花草参数 /// public record FlowerParameter { /// /// 类别 id /// [Required] [FromForm(Name = "categoryId")] public int CategoryId { get; init; } /// /// 花草名称 /// [Required] [FromForm(Name = "name")] public required string Name { get; init; } /// /// 购买时间 /// [Required] [FromForm(Name = "dateBuy")] public long DateBuy { get; init; } /// /// 购买花费 /// [FromForm(Name = "cost")] public decimal? Cost { get; init; } /// /// 购买渠道 /// [FromForm(Name = "purchase")] public string? Purchase { get; init; } /// /// 花草封面 /// [FromForm(Name = "cover")] public IFormFile? Cover { get; init; } } /// /// 花草修改参数 /// public record FlowerUpdateParameter : FlowerParameter { /// /// 花草唯一 id /// [Required] [FromForm(Name = "id")] public int Id { get; init; } } /// /// 花草结果对象 /// public record FlowerResult { /// /// 花草列表 /// public required FlowerItem[] Flowers { get; init; } /// /// 花草总数 /// public int Count { get; init; } }