You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

2 years ago
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas;
/// <summary>
///
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}customer-address")]
public class CustomerAddressController : AbpController
{
private readonly ICustomerAddressAppService _customerAddressAppService;
/// <summary>
///
/// </summary>
/// <param name="customerAddressAppService"></param>
public CustomerAddressController(ICustomerAddressAppService customerAddressAppService)
{
_customerAddressAppService = customerAddressAppService;
}
/// <summary>
/// 按代码获取客户地址信息
/// </summary>
/// <param name="code">客户地址代码</param>
/// <returns></returns>
[HttpGet("{code}")]
public virtual async Task<CustomerAddressDTO> GetAsync(string code)
{
var result = await _customerAddressAppService.GetByCodeAsync(code).ConfigureAwait(false);
return result;
}
/// <summary>
///
/// </summary>
/// <param name="customerCode"></param>
/// <returns></returns>
[HttpGet("by-customer")]
public virtual async Task<List<CustomerAddressDTO>> GetByCustomerCodeAsync(string customerCode)
{
var entities = await _customerAddressAppService.GetByCustomerCodeAsync(customerCode).ConfigureAwait(false);
return entities;
}
}