flower-story/Server/Controller/UserApiController.structs.cs
2023-08-08 17:15:43 +08:00

78 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
namespace Blahblah.FlowerStory.Server.Controller;
partial class UserApiController
{
}
/// <summary>
/// 登录参数
/// </summary>
public record LoginParamter
{
/// <summary>
/// 用户 id
/// </summary>
[Required]
public required string Id { get; init; }
/// <summary>
/// 密码
/// </summary>
[Required]
public required string Password { get; init; }
}
/// <summary>
/// 用户注册参数
/// </summary>
public record UserParameter : UpdateParameter
{
/// <summary>
/// 用户 id
/// </summary>
[Required]
[FromForm(Name = "id")]
public required string Id { get; init; }
/// <summary>
/// 密码
/// </summary>
[Required]
[FromForm(Name = "password")]
public required string Password { get; init; }
}
/// <summary>
/// 用户修改参数
/// </summary>
public record UpdateParameter
{
/// <summary>
/// 用户名
/// </summary>
[Required]
[FromForm(Name = "name")]
public required string UserName { get; init; }
/// <summary>
/// 邮箱
/// </summary>
[FromForm(Name = "email")]
public string? Email { get; init; }
/// <summary>
/// 联系电话
/// </summary>
[FromForm(Name = "mobile")]
public string? Mobile { get; init; }
/// <summary>
/// 用户头像
/// </summary>
[FromForm(Name = "avatar")]
public IFormFile? Avatar { get; init; }
}