using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Waste.Domain;

namespace Waste.Application.SZPltInfo
{
    public class SZPltAppService : IDynamicApiController
    {
        private readonly ISZPltService _sZPltService;

        public SZPltAppService(ISZPltService sZPltService)
        {
            _sZPltService = sZPltService;
        }
        /// <summary>
        /// 获取地产区域列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageParms<W_SZAddress>> GetAddressListAsync(QueryParams param)
        {
            return await _sZPltService.GetAddressListAsync(param);
        }
        /// <summary>
        /// 地产区域信息提交
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<ResultInfo> SubmitAddressFormAsync(W_SZAddress data)
        {
            return await _sZPltService.SubmitAddressFormAsync(data);
        }
        /// <summary>
        /// 删除地产区域
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        [QueryParameters]
        public async Task<ResultInfo> DeleteAddressAsync(Guid id)
        {
            return await _sZPltService.DeleteAddressAsync(id);
        }

        /// <summary>
        /// 获取采集点列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageParms<SZCollectList>> GetCollectListAsync(QueryParams param)
        {
            return await _sZPltService.GetCollectListAsync(param);
        }

        /// <summary>
        /// 采集点信息提交
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<ResultInfo> SubmitCollectFormAsync(W_SZCollect data)
        {
            return await _sZPltService.SubmitCollectFormAsync(data);
        }
        /// <summary>
        /// 删除采集点
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        [QueryParameters]
        public async Task<ResultInfo> DeleteCollectAsync(Guid id)
        {
            return await _sZPltService.DeleteCollectAsync(id);
        }
    }
}
