All checks were successful
continuous-integration/drone/push Build is passing
197 lines
6.6 KiB
C#
197 lines
6.6 KiB
C#
using System.ComponentModel.DataAnnotations;
|
||
|
||
namespace CampusErrand.Models.Dtos;
|
||
|
||
/// <summary>
|
||
/// 创建订单请求
|
||
/// </summary>
|
||
public class CreateOrderRequest
|
||
{
|
||
/// <summary>订单类型:Pickup, Delivery, Help, Purchase, Food</summary>
|
||
[Required(ErrorMessage = "订单类型不能为空")]
|
||
public string OrderType { get; set; } = string.Empty;
|
||
|
||
/// <summary>物品名称/要做的事情</summary>
|
||
[MaxLength(256)]
|
||
public string ItemName { get; set; } = string.Empty;
|
||
|
||
/// <summary>取货/代取地点</summary>
|
||
[MaxLength(256)]
|
||
public string? PickupLocation { get; set; }
|
||
|
||
/// <summary>送达地点</summary>
|
||
[Required(ErrorMessage = "送达地点不能为空")]
|
||
[MaxLength(256)]
|
||
public string DeliveryLocation { get; set; } = string.Empty;
|
||
|
||
/// <summary>备注信息</summary>
|
||
[MaxLength(512)]
|
||
public string? Remark { get; set; }
|
||
|
||
/// <summary>联系手机号</summary>
|
||
[Required(ErrorMessage = "手机号不能为空")]
|
||
[MaxLength(20)]
|
||
public string Phone { get; set; } = string.Empty;
|
||
|
||
/// <summary>跑腿佣金</summary>
|
||
public decimal Commission { get; set; }
|
||
|
||
/// <summary>商品总金额(万能帮/代购/美食街)</summary>
|
||
public decimal? GoodsAmount { get; set; }
|
||
|
||
/// <summary>美食街订单菜品列表</summary>
|
||
public List<FoodOrderItemRequest>? FoodItems { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 美食街订单菜品项请求
|
||
/// </summary>
|
||
public class FoodOrderItemRequest
|
||
{
|
||
public int ShopId { get; set; }
|
||
public int DishId { get; set; }
|
||
public int Quantity { get; set; }
|
||
public decimal UnitPrice { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单响应
|
||
/// </summary>
|
||
public class OrderResponse
|
||
{
|
||
public int Id { get; set; }
|
||
public string OrderNo { get; set; } = string.Empty;
|
||
public int OwnerId { get; set; }
|
||
public int? RunnerId { get; set; }
|
||
public string OrderType { get; set; } = string.Empty;
|
||
public string Status { get; set; } = string.Empty;
|
||
public string ItemName { get; set; } = string.Empty;
|
||
public string? PickupLocation { get; set; }
|
||
public string DeliveryLocation { get; set; } = string.Empty;
|
||
public string? Remark { get; set; }
|
||
/// <summary>手机号(未接单时对非单主隐藏)</summary>
|
||
public string? Phone { get; set; }
|
||
public decimal Commission { get; set; }
|
||
public decimal? GoodsAmount { get; set; }
|
||
public decimal TotalAmount { get; set; }
|
||
public string? CompletionProof { get; set; }
|
||
public bool IsReviewed { get; set; }
|
||
public DateTime CreatedAt { get; set; }
|
||
public DateTime? AcceptedAt { get; set; }
|
||
public DateTime? CompletedAt { get; set; }
|
||
/// <summary>跑腿昵称</summary>
|
||
public string? RunnerNickname { get; set; }
|
||
/// <summary>跑腿头像</summary>
|
||
public string? RunnerAvatar { get; set; }
|
||
/// <summary>单主头像</summary>
|
||
public string? OwnerAvatar { get; set; }
|
||
/// <summary>跑腿 UID</summary>
|
||
public int? RunnerUid { get; set; }
|
||
/// <summary>跑腿手机号(认证时填写的手机号,仅单主可见)</summary>
|
||
public string? RunnerPhone { get; set; }
|
||
/// <summary>平台抽成(订单完成后可见)</summary>
|
||
public decimal? PlatformFee { get; set; }
|
||
/// <summary>跑腿实得佣金(订单完成后可见)</summary>
|
||
public decimal? NetEarning { get; set; }
|
||
/// <summary>IM 群组 ID</summary>
|
||
public string? ImGroupId { get; set; }
|
||
public List<FoodOrderItemResponse>? FoodItems { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 美食街订单菜品项响应
|
||
/// </summary>
|
||
public class FoodOrderItemResponse
|
||
{
|
||
public int Id { get; set; }
|
||
public int ShopId { get; set; }
|
||
public string ShopName { get; set; } = string.Empty;
|
||
public int DishId { get; set; }
|
||
public string DishName { get; set; } = string.Empty;
|
||
public string? DishPhoto { get; set; }
|
||
public int Quantity { get; set; }
|
||
public decimal UnitPrice { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单大厅列表项响应
|
||
/// </summary>
|
||
public class OrderHallItemResponse
|
||
{
|
||
public int Id { get; set; }
|
||
public string OrderNo { get; set; } = string.Empty;
|
||
public string OrderType { get; set; } = string.Empty;
|
||
public string Status { get; set; } = string.Empty;
|
||
/// <summary>物品名称/要做的事情</summary>
|
||
public string? ItemName { get; set; }
|
||
/// <summary>取货/代取地点</summary>
|
||
public string? PickupLocation { get; set; }
|
||
/// <summary>送达地点</summary>
|
||
public string DeliveryLocation { get; set; } = string.Empty;
|
||
/// <summary>备注信息</summary>
|
||
public string? Remark { get; set; }
|
||
/// <summary>跑腿佣金</summary>
|
||
public decimal Commission { get; set; }
|
||
/// <summary>垫付商品金额(代购/美食街)</summary>
|
||
public decimal? GoodsAmount { get; set; }
|
||
/// <summary>涉及门店数量(美食街)</summary>
|
||
public int? ShopCount { get; set; }
|
||
/// <summary>菜品数量(美食街)</summary>
|
||
public int? DishItemCount { get; set; }
|
||
public DateTime CreatedAt { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 接单请求响应
|
||
/// </summary>
|
||
public class AcceptOrderResponse
|
||
{
|
||
public int Id { get; set; }
|
||
public string OrderNo { get; set; } = string.Empty;
|
||
public string Status { get; set; } = string.Empty;
|
||
public int RunnerId { get; set; }
|
||
public DateTime AcceptedAt { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 跑腿提交完成请求
|
||
/// </summary>
|
||
public class CompleteOrderRequest
|
||
{
|
||
/// <summary>完成凭证图片(选填)</summary>
|
||
public string? CompletionProof { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 我的订单/我的接单列表项响应
|
||
/// </summary>
|
||
public class OrderListItemResponse
|
||
{
|
||
public int Id { get; set; }
|
||
public string OrderNo { get; set; } = string.Empty;
|
||
public int OwnerId { get; set; }
|
||
public int? RunnerId { get; set; }
|
||
public string OrderType { get; set; } = string.Empty;
|
||
public string Status { get; set; } = string.Empty;
|
||
public string ItemName { get; set; } = string.Empty;
|
||
public string? PickupLocation { get; set; }
|
||
public string DeliveryLocation { get; set; } = string.Empty;
|
||
public string? Remark { get; set; }
|
||
public decimal Commission { get; set; }
|
||
public decimal? GoodsAmount { get; set; }
|
||
public decimal TotalAmount { get; set; }
|
||
public bool IsReviewed { get; set; }
|
||
public DateTime CreatedAt { get; set; }
|
||
public DateTime? AcceptedAt { get; set; }
|
||
public DateTime? CompletedAt { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 管理端取消订单请求
|
||
/// </summary>
|
||
public class AdminCancelOrderRequest
|
||
{
|
||
/// <summary>取消原因</summary>
|
||
public string Reason { get; set; } = string.Empty;
|
||
}
|