feat 获取所有地址
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.Places.Response;
|
||||
using Dlhis.Basic.Places.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
|
||||
namespace Dlhis.Basic.Places.Controllers;
|
||||
|
||||
@@ -33,6 +36,18 @@ public class BookingAddressController : ControllerBase
|
||||
return await _bookingAddresService.GetAddressPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 所有地址
|
||||
/// </summary>
|
||||
/// <param name="tenant"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("all")]
|
||||
[IgnoreTenant]
|
||||
public async Task<List<BookingAddressPageResponse>> GetAllAddressAsync([Required(ErrorMessage = "厂区不可为空")] string tenant)
|
||||
{
|
||||
return await _bookingAddresService.GetAllAddressAsync(tenant);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址保存
|
||||
/// </summary>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BookingAddressPageRequest : PageDto
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -8,5 +8,7 @@ public interface IBookingAddressService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<BookingAddressPageResponse>> GetAddressPageAsync(BookingAddressPageRequest request);
|
||||
|
||||
Task<List<BookingAddressPageResponse>> GetAllAddressAsync(string tenant);
|
||||
|
||||
Task SaveAddressAsync(BookingAddressSaveRequest request);
|
||||
}
|
||||
|
||||
@@ -42,4 +42,12 @@ public class BookingAddressService : IBookingAddressService
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<BookingAddressPageResponse>> GetAllAddressAsync(string tenant)
|
||||
{
|
||||
return await _dbContext.Queryable<BookingAddressEntity>()
|
||||
.Where(x => x.TenantId == tenant)
|
||||
.Select<BookingAddressPageResponse>()
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user