using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsEnergyConfig;
using BPA.SAAS.Manage.Application.DataBase.Interface;
using BPA.SAAS.Manage.Core.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.DataBase
{
    [ApiDescriptionSettings("GoodsEnergyConfig", Tag = "商品能量配置")]
    public class GoodsEnergyConfigServices: IDynamicApiController, ITransient
    {
        IGoodsEnergyConfigService _energyConfigService;
        public GoodsEnergyConfigServices(IGoodsEnergyConfigService energyConfigService)
        {
            _energyConfigService=energyConfigService;
        }
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodsenergyconfig/getgoodsenergyconfigpage")]
        public async Task<PageUtil> GetGoodsEnergyConfigPage(GoodsEnergyConfigQueryDto dto)
        {
            return await _energyConfigService.GetGoodsEnergyConfigPage(dto);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodsenergyconfig/addGoodsenergyconfig")]
        public async Task<bool> AddGoodsEnergyConfig(GoodsEnergyConfigDto dto)
        {
            return await _energyConfigService.AddGoodsEnergyConfig(dto);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodsenergyconfig/updategoodsenergyconfig")]
        public async Task<bool> UpdateGoodsEnergyConfig(GoodsEnergyConfigDto dto)
        {
            return await _energyConfigService.UpdateGoodsEnergyConfig(dto);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        [HttpGet("/api/goodsenergyconfig/delgoodsenergyconfig")]
        public async Task<bool> DelGoodsEnergyConfig(string Id)
        {
            return await _energyConfigService.DelGoodsEnergyConfig(Id);
        }
   
        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="goodsenergyconfigId"></param>
        /// <returns></returns>
        [HttpGet("/api/goodsenergyconfig/getgoodsenergyconfigdetailslist")]
        public async Task<List<GoodsEnergyConfigDetailsViewDto>> GetGoodsEnergyConfigDetailsList(string goodsenergyconfigId)
        {
            return await _energyConfigService.GetGoodsEnergyConfigDetailsList(goodsenergyconfigId);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodsenergyconfig/addgoodsenergyconfigdetails")]
        public async Task<bool> AddGoodsEnergyConfigDetails(GoodsEnergyConfigDetailsDto dto)
        {
            return await _energyConfigService.AddGoodsEnergyConfigDetails(dto);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodsenergyconfig/updategoodsenergyconfigdetails")]
        public async Task<bool> UpdateGoodsEnergyConfigDetails(GoodsEnergyConfigDetailsDto dto)
        {
            return await _energyConfigService.UpdateGoodsEnergyConfigDetails(dto);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        [HttpGet("/api/goodsenergyconfig/delgoodsenergyconfigdetails")]
        public async Task<bool> DelGoodsEnergyConfigDetails(string Id)
        {
            return await _energyConfigService.DelGoodsEnergyConfigDetails(Id);
        }
    }
}
