using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsTechnology;
using BPA.SAAS.Manage.Application.DataBase.Interface;
using Microsoft.AspNetCore.Components.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace BPA.SAAS.Manage.Application.DataBase
{
    [ApiDescriptionSettings("Goods", Tag = "商品工艺")]
    public class GoodsTechnologyService: IDynamicApiController, ITransient
    {
        IGoodsTechnologyService _goodsTechnologyService;
        public GoodsTechnologyService(IGoodsTechnologyService goodsTechnologyService)
        {
            _goodsTechnologyService=goodsTechnologyService;
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodstechnology/updategoodstechnologyaction")]
        public async Task<bool> UpdateGoodsTechnologyAction(List<GoodsTechnologyActionBaseDto> inputDto)
        {
            return await _goodsTechnologyService.UpdateGoodsTechnologyAction(inputDto);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="inputDto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodstechnology/addgoodstechnologyaction")]
        public async Task<bool> AddGoodsTechnologyAction(List<GoodsTechnologyActionBaseDto> inputDto)
        {
            return await _goodsTechnologyService.AddGoodsTechnologyAction(inputDto);
        }
        /// <summary>
        /// 根据商品获取工艺
        /// </summary>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        [HttpGet("/api/goodstechnology/getGoodstechnologyaction")]
        public async Task<List<GoodsTechnologyActionListView>> GetGoodsTechnologyAction(string goodsId)
        {
            return await _goodsTechnologyService.GetGoodsTechnologyAction(goodsId);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("/api/goodstechnology/deletegoodstechnologyaction")]
        public async Task<bool> DeleteGoodsTechnologyAction(string id)
        {
            return await _goodsTechnologyService.DeleteGoodsTechnologyAction(id);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("/api/goodstechnology/deletebydevidegoodstechnologyaction")]
        public async Task<bool> DeleteGoodsTechnologyAction(GoodsTechnologDelete dto)
        {
            return await _goodsTechnologyService.DeleteGoodsTechnologyAction(dto);
        }
        /// <summary>
        /// 查询设备信息（包含设备版本对应的工艺信息
        /// </summary>
        /// <returns></returns>
        [HttpGet("/api/goodstechnology/getdevicetechnology")]
        public async Task<List<DeviceGoodsTechnologyView>> GetDeviceTechnology()
        {
            return await _goodsTechnologyService.GetDeviceTechnology();
        }
    }
}
