✨
This commit is contained in:
6
StopShopping.Services/Models/Req/CategoryIdParams.cs
Normal file
6
StopShopping.Services/Models/Req/CategoryIdParams.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
public record CategoryIdParams
|
||||
{
|
||||
public int CategoryId { get; set; }
|
||||
}
|
||||
24
StopShopping.Services/Models/Req/ChangePasswordParams.cs
Normal file
24
StopShopping.Services/Models/Req/ChangePasswordParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 修改密码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record ChangePasswordParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 原密码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
public string? OldPassword { get; set; }
|
||||
/// <summary>
|
||||
/// 新密码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MinLength(6)]
|
||||
public string? NewPassword { get; set; }
|
||||
}
|
||||
36
StopShopping.Services/Models/Req/CreateRequestParams.cs
Normal file
36
StopShopping.Services/Models/Req/CreateRequestParams.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 创建需求请求
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record CreateRequestParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品名
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(1000)]
|
||||
public string? Description { get; set; }
|
||||
/// <summary>
|
||||
/// 分类id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 截止日期
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[RegularExpression(@"^\d{4}\D\d{1,2}\D\d{1,2}$")]
|
||||
public string Deadline { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
public record DistrictParentIdParams
|
||||
{
|
||||
public int ParentId { get; set; }
|
||||
}
|
||||
67
StopShopping.Services/Models/Req/EditAddressParams.cs
Normal file
67
StopShopping.Services/Models/Req/EditAddressParams.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 新增/修改收货地址
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record EditAddressParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 大于0时为修改
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? Id { get; set; }
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MaxLength(20)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[Phone]
|
||||
public string Telephone { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 自定义标签
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(20)]
|
||||
public string? Tag { get; set; }
|
||||
/// <summary>
|
||||
/// 是否默认地址
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public bool Default { get; set; }
|
||||
/// <summary>
|
||||
/// 区域id,表示省/直辖市
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int DistrictLevel1Id { get; set; }
|
||||
/// <summary>
|
||||
/// 区域id,表示市/直辖市时为空
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? DistrictLevel2Id { get; set; }
|
||||
/// <summary>
|
||||
/// 区域id,表示区
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int DistrictLevel3Id { get; set; }
|
||||
/// <summary>
|
||||
/// 区域id,表示街道/镇
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int DistrictLevel4Id { get; set; }
|
||||
/// <summary>
|
||||
/// 详细地址
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(200)]
|
||||
public string? Detail { get; set; }
|
||||
}
|
||||
34
StopShopping.Services/Models/Req/EditCategoryParams.cs
Normal file
34
StopShopping.Services/Models/Req/EditCategoryParams.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 新增/修改分类
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record EditCategoryParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 大于0时修改
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? Id { get; set; }
|
||||
/// <summary>
|
||||
/// 顶级为0
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 名称j
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 空时保持不变
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(50)]
|
||||
public string? Logo { get; set; }
|
||||
}
|
||||
56
StopShopping.Services/Models/Req/EditProductParams.cs
Normal file
56
StopShopping.Services/Models/Req/EditProductParams.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 新增/修改商品
|
||||
/// </summary>
|
||||
public record EditProductParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 大于0时修改
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? Id { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string? Name { get; set; }
|
||||
/// <summary>
|
||||
/// 简介
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(200)]
|
||||
public string? Description { get; set; }
|
||||
/// <summary>
|
||||
/// 图片名,修改时传空保持不变
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MaxLength(50)]
|
||||
public string? LogoName { get; set; }
|
||||
/// <summary>
|
||||
/// 分类id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 最小销售单元
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MaxLength(20)]
|
||||
public string? MinimumUnit { get; set; }
|
||||
/// <summary>
|
||||
/// 单价
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public decimal UnitPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string? Detail { get; set; }
|
||||
}
|
||||
34
StopShopping.Services/Models/Req/EditUserParams.cs
Normal file
34
StopShopping.Services/Models/Req/EditUserParams.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户资料
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record EditUserParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Length(2, 50)]
|
||||
[Required]
|
||||
public string NickName { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 头像文件名
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string? AvatarFileName { get; set; }
|
||||
/// <summary>
|
||||
/// 默认角色
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public UserRoles DefaultRole { get; set; }
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Phone]
|
||||
public string? Telephone { get; set; }
|
||||
}
|
||||
18
StopShopping.Services/Models/Req/PagedSearch.cs
Normal file
18
StopShopping.Services/Models/Req/PagedSearch.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 分页搜索
|
||||
/// </summary>
|
||||
public record PagedSearch
|
||||
{
|
||||
/// <summary>
|
||||
/// 页码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int PageIndex { get; set; }
|
||||
/// <summary>
|
||||
/// 页大小
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
6
StopShopping.Services/Models/Req/ProductIdParams.cs
Normal file
6
StopShopping.Services/Models/Req/ProductIdParams.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
public record ProductIdParams
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
}
|
||||
32
StopShopping.Services/Models/Req/ProductOrderBys.cs
Normal file
32
StopShopping.Services/Models/Req/ProductOrderBys.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 商品搜索排序
|
||||
/// </summary>
|
||||
public enum ProductOrderBys
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加时间
|
||||
/// </summary>
|
||||
CreateTime,
|
||||
/// <summary>
|
||||
/// 添加时间倒序
|
||||
/// </summary>
|
||||
CreateTimeDesc,
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
Category,
|
||||
/// <summary>
|
||||
/// 分类倒序
|
||||
/// </summary>
|
||||
CategoryDesc,
|
||||
/// <summary>
|
||||
/// 已售数量
|
||||
/// </summary>
|
||||
SoldAmount,
|
||||
/// <summary>
|
||||
/// 已售数量倒序
|
||||
/// </summary>
|
||||
SoldAmountDesc,
|
||||
}
|
||||
29
StopShopping.Services/Models/Req/ProductSearchParams.cs
Normal file
29
StopShopping.Services/Models/Req/ProductSearchParams.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 分页搜索商品
|
||||
/// </summary>
|
||||
public record ProductSearchParms : PagedSearch
|
||||
{
|
||||
/// <summary>
|
||||
/// 搜索此分类及下级所有商品
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名、描述关键字
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string? Keyword { get; set; }
|
||||
/// <summary>
|
||||
/// 排序条件
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MinLength(1)]
|
||||
public ProductOrderBys[] OrderBys { get; set; } = [
|
||||
ProductOrderBys.CreateTimeDesc,
|
||||
ProductOrderBys.Category
|
||||
];
|
||||
}
|
||||
34
StopShopping.Services/Models/Req/ReplyParams.cs
Normal file
34
StopShopping.Services/Models/Req/ReplyParams.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 竞标参数
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record ReplyParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 需求id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int RequestId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int ProductId { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int Amount { get; set; }
|
||||
/// <summary>
|
||||
/// 价格
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public decimal Price { get; set; }
|
||||
/// <summary>
|
||||
/// 留言
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string? Memo { get; set; }
|
||||
}
|
||||
6
StopShopping.Services/Models/Req/RequestIdParams.cs
Normal file
6
StopShopping.Services/Models/Req/RequestIdParams.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
public record RequestIdParams
|
||||
{
|
||||
public int RequestId { get; set; }
|
||||
}
|
||||
32
StopShopping.Services/Models/Req/RequestOrderBys.cs
Normal file
32
StopShopping.Services/Models/Req/RequestOrderBys.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 需求排序
|
||||
/// </summary>
|
||||
public enum RequestOrderBys
|
||||
{
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
PublishTime,
|
||||
/// <summary>
|
||||
/// 发布时间倒序j
|
||||
/// </summary>
|
||||
PublishTimeDesc,
|
||||
/// <summary>
|
||||
/// 分类id
|
||||
/// </summary>
|
||||
CategoryId,
|
||||
/// <summary>
|
||||
/// 分类id倒序
|
||||
/// </summary>
|
||||
CategoryIdDesc,
|
||||
/// <summary>
|
||||
/// 竞标数量
|
||||
/// </summary>
|
||||
ReplyAmount,
|
||||
/// <summary>
|
||||
/// 竞标数量倒序
|
||||
/// </summary>
|
||||
ReplyAmountDesc,
|
||||
}
|
||||
43
StopShopping.Services/Models/Req/RequestSearchParams.cs
Normal file
43
StopShopping.Services/Models/Req/RequestSearchParams.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 需求分页检索
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record RequestSearchParams : PagedSearch
|
||||
{
|
||||
/// <summary>
|
||||
/// 分类id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int? CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 关键词,序号、名称、描述
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string? Keyword { get; set; }
|
||||
/// <summary>
|
||||
/// 排序,不要同时传同一个字段的升序和降序
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[MinLength(1)]
|
||||
[Required]
|
||||
public RequestOrderBys[] OrderBys { get; set; } = [
|
||||
RequestOrderBys.PublishTimeDesc,
|
||||
];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单搜索
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record RequestSearchWithStatusParams : RequestSearchParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public RequestStatus Status { get; set; }
|
||||
}
|
||||
15
StopShopping.Services/Models/Req/ResortCategoryParams.cs
Normal file
15
StopShopping.Services/Models/Req/ResortCategoryParams.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 调整层级内排序
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record ResortCategoryParams
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 当前层级中排序,从1开始
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public short TargetOrder { get; set; }
|
||||
}
|
||||
24
StopShopping.Services/Models/Req/SignInParams.cs
Normal file
24
StopShopping.Services/Models/Req/SignInParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 登录参数
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record SignInParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录账号
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
public string Account { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
40
StopShopping.Services/Models/Req/SignUpParams.cs
Normal file
40
StopShopping.Services/Models/Req/SignUpParams.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 注册参数
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record SignUpParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录账号
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[Length(2, 20)]
|
||||
public string Account { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[Length(2, 50)]
|
||||
public string NickName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 默认角色
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public UserRoles DefaultRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[MinLength(6)]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
24
StopShopping.Services/Models/Req/UploadParams.cs
Normal file
24
StopShopping.Services/Models/Req/UploadParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace StopShopping.Services.Models.Req;
|
||||
|
||||
/// <summary>
|
||||
/// 上传
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public record UploadParams
|
||||
{
|
||||
/// <summary>
|
||||
/// 场景
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public UploadScences Scences { get; set; }
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Required]
|
||||
[ImageFileValidation(2 * 1024 * 1024)]
|
||||
public IFormFile? File { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user