using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplate.Dtos;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplate.Services;
using BPA.SAAS.Manage.Core.Base;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WarehouseTemplate
{
    [ApiDescriptionSettings("开放平台", Tag = "设备仓位模板"), AllowAnonymous]
    public class WarehouseTemplateServices : IDynamicApiController, ITransient
    {
        IWarehouseTemplateService _warehouseTemplateService;
        public WarehouseTemplateServices(IWarehouseTemplateService warehouseTemplateService)
        {
            _warehouseTemplateService = warehouseTemplateService;
        }
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/ExternalPlatform/WareHouseTemplate/GetWarehouseTemplatePage")]
        public async Task<PageUtil> GetWarehouseTemplatePage(WarehouseTemplateQueryDto inputDto)
        {
            return await _warehouseTemplateService.GetWarehouseTemplatePage(inputDto);
        }
        /// <summary>
        /// 根据设备id查询设备仓位模板
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/ExternalPlatform/WareHouseTemplate/GetWarehouseTemplateList")]
        public async Task<List<WarehouseTemplateView>> GetWarehouseTemplateList(WarehouseDevideId dto)
        {
            return await _warehouseTemplateService.GetWarehouseTemplateList(dto);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/ExternalPlatform/WareHouseTemplate/AddWarehouseTemplate")]
        public async Task<bool> AddWarehouseTemplate(WarehouseTemplatInsertDto inputDto)
        {
            return await _warehouseTemplateService.AddWarehouseTemplate(inputDto);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/ExternalPlatform/WareHouseTemplate/UpdateWarehouseTemplate")]
        public async Task<bool> UpdateWarehouseTemplate(WarehouseTemplatUpdateDto inputDto)
        {
            return await _warehouseTemplateService.UpdateWarehouseTemplate(inputDto);
        }
    }
}

