using BPA.SAAS.Manage.Application.Device.Dtos.WarehouseTemplate;
using BPA.SAAS.Manage.Application.Device.Interface;
using BPA.SAAS.Manage.Core.Base;
using Microsoft.AspNetCore.Components.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.Device
{
    [ApiDescriptionSettings("Device", Tag = "设备仓位模板")]
    public class WarehouseTemplateServices : IDynamicApiController, ITransient
    {
        IWarehouseTemplateService _warehouseTemplateService;
        public WarehouseTemplateServices(IWarehouseTemplateService warehouseTemplateService) 
        {
            _warehouseTemplateService=warehouseTemplateService;
        }
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/warehousetemplate/page")]
        public async Task<PageUtil> GetWarehouseTemplatePage(WarehouseTemplateQueryInputDto inputDto)
        {
            return await _warehouseTemplateService.GetWarehouseTemplatePage(inputDto);
        }
        [HttpGet("/api/warehousetemplate/list")]
        public async Task<List<WarehouseTemplateView>> GetWarehouseTemplateList(string deviceId)
        {
            return await _warehouseTemplateService.GetWarehouseTemplateList(deviceId);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/warehousetemplate/add")]
        public async Task<bool> AddWarehouseTemplate(WarehouseTemplatDto inputDto)
        {
            return await _warehouseTemplateService.AddWarehouseTemplate(inputDto);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="inputList"></param>
        /// <returns></returns>
        [HttpPost("/api/warehousetemplate/del")]
        public async Task<bool> DeWarehouseTemplate(List<string> inputList)
        {
            return await _warehouseTemplateService.DeWarehouseTemplate(inputList);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/warehousetemplate/update")]
        public async Task<bool> UpdateWarehouseTemplate(WarehouseTemplatDto inputDto)
        {
            return await _warehouseTemplateService.UpdateWarehouseTemplate(inputDto);
        }
    }
}
