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; set; }
}