diff --git a/YD_Event.Application/Merchant/Dtos/AddMerchantInput.cs b/YD_Event.Application/Merchant/Dtos/AddMerchantInput.cs index b944a64..65b3ca8 100644 --- a/YD_Event.Application/Merchant/Dtos/AddMerchantInput.cs +++ b/YD_Event.Application/Merchant/Dtos/AddMerchantInput.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using YD_Event.Core.Enum; namespace YD_Event.Application.Merchant.Dtos; @@ -41,4 +42,14 @@ public class AddMerchantInput /// 联系电话 /// public string? ContactPhone { get; set; } + + /// + /// 地址 + /// + public string? Address { get; set; } + + /// + /// 审核状态 + /// + public AuditStatus? AuditStatus { get; set; } } diff --git a/YD_Event.Application/Merchant/Dtos/MerchantOutput.cs b/YD_Event.Application/Merchant/Dtos/MerchantOutput.cs new file mode 100644 index 0000000..4bfeeb8 --- /dev/null +++ b/YD_Event.Application/Merchant/Dtos/MerchantOutput.cs @@ -0,0 +1,74 @@ +using YD_Event.Core.Enum; + +namespace YD_Event.Application.Merchant.Dtos; + +/// +/// 商户输出DTO +/// +public class MerchantOutput +{ + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 商户名称 + /// + public string MerchantName { get; set; } + + /// + /// 统一社会信用代码 + /// + public string CreditCode { get; set; } + + /// + /// 开户行 + /// + public string BankName { get; set; } + + /// + /// 账号 + /// + public string AccountNumber { get; set; } + + /// + /// 营业执照图片URL + /// + public string BusinessLicenseUrl { get; set; } + + /// + /// 联系电话 + /// + public string? ContactPhone { get; set; } + + /// + /// 地址 + /// + public string? Address { get; set; } + + /// + /// 审核状态 + /// + public AuditStatus? AuditStatus { get; set; } + + /// + /// 审核备注 + /// + public string? AuditRemark { get; set; } + + /// + /// 可用状态 + /// + public AvailabilityStatus Status { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreatedTime { get; set; } + + /// + /// 更新时间 + /// + public DateTime? UpdatedTime { get; set; } +} \ No newline at end of file diff --git a/YD_Event.Application/Merchant/MerchantService.cs b/YD_Event.Application/Merchant/MerchantService.cs index 31e2c7e..9ce12d2 100644 --- a/YD_Event.Application/Merchant/MerchantService.cs +++ b/YD_Event.Application/Merchant/MerchantService.cs @@ -128,16 +128,34 @@ public class MerchantService : BaseService, ITr /// [DisplayName("商户分页查询")] [HttpGet("page")] - public async Task> Page([FromQuery] MerchantQueryInput input) + public async Task> Page([FromQuery] MerchantQueryInput input) { - return await _repository.AsQueryable() + var pageResult = await _repository.AsQueryable() .WhereIF(!string.IsNullOrWhiteSpace(input.MerchantName), x => x.MerchantName.Contains(input.MerchantName)) .WhereIF(!string.IsNullOrWhiteSpace(input.ContactPhone), x => x.ContactPhone.Contains(input.ContactPhone)) .WhereIF(input.AuditStatus.HasValue, x => x.AuditStatus == input.AuditStatus) .WhereIF(input.StartTime.HasValue, x => x.CreatedTime >= input.StartTime) .WhereIF(input.EndTime.HasValue, x => x.CreatedTime <= input.EndTime) .OrderByDescending(x => x.CreatedTime) + .Select(x => new MerchantOutput + { + Id = x.Id, + MerchantName = x.MerchantName, + CreditCode = x.CreditCode, + BankName = x.BankName, + AccountNumber = x.AccountNumber, + BusinessLicenseUrl = x.BusinessLicenseUrl, + ContactPhone = x.ContactPhone, + Address = x.Address, + AuditStatus = x.AuditStatus, + AuditRemark = x.AuditRemark, + Status = x.Status, + CreatedTime = x.CreatedTime, + UpdatedTime = x.UpdatedTime + }) .ToPagedListAsync(input); + + return pageResult; } /// @@ -181,11 +199,27 @@ public class MerchantService : BaseService, ITr /// [DisplayName("获取商户详情")] [HttpGet("detail")] - public async Task Detail([FromQuery] long id) + public async Task Detail([FromQuery] long id) { var entity = await _repository.GetByIdAsync(id); if (entity == null) throw Oops.Bah("商户不存在"); - return entity; + + return new MerchantOutput + { + Id = entity.Id, + MerchantName = entity.MerchantName, + CreditCode = entity.CreditCode, + BankName = entity.BankName, + AccountNumber = entity.AccountNumber, + BusinessLicenseUrl = entity.BusinessLicenseUrl, + ContactPhone = entity.ContactPhone, + Address = entity.Address, + AuditStatus = entity.AuditStatus, + AuditRemark = entity.AuditRemark, + Status = entity.Status, + CreatedTime = entity.CreatedTime, + UpdatedTime = entity.UpdatedTime + }; } /// diff --git a/YD_Event.Application/YD_Event.Application.xml b/YD_Event.Application/YD_Event.Application.xml index 51494f0..766fc98 100644 --- a/YD_Event.Application/YD_Event.Application.xml +++ b/YD_Event.Application/YD_Event.Application.xml @@ -6036,6 +6036,86 @@ 联系电话 + + + 地址 + + + + + 审核状态 + + + + + 商户输出DTO + + + + + 主键Id + + + + + 商户名称 + + + + + 统一社会信用代码 + + + + + 开户行 + + + + + 账号 + + + + + 营业执照图片URL + + + + + 联系电话 + + + + + 地址 + + + + + 审核状态 + + + + + 审核备注 + + + + + 可用状态 + + + + + 创建时间 + + + + + 更新时间 + + 商户查询输入