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

namespace Waste.Application.WasteInfo
{
    /// <summary>
    /// 垃圾分类信息接口
    /// </summary>
    public class WasteAppService : IDynamicApiController
    {
        private readonly IWasteService _wasteService;
        public WasteAppService(IWasteService wasteService)
        {
            _wasteService = wasteService;
        }
        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        [QueryParameters]
        public async Task<ResultInfo> DeleteTypeFormAsync(Guid id)
        {
            return await _wasteService.DeleteTypeFormAsync(id);
        }
        /// <summary>
        /// 分类详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<W_WasteType> DetailTypeAsync(Guid id)
        {
            return await _wasteService.DetailTypeAsync(id);
        }
        /// <summary>
        /// 获取所有分类
        /// </summary>
        /// <returns></returns>
        public async Task<List<W_WasteType>> GetAllTypeList()
        {
            return await _wasteService.GetAllTypeList();
        }
        /// <summary>
        /// 垃圾分类列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageParms<W_WasteType>> GetTypeListAsync(QueryParams param)
        {
            return await _wasteService.GetTypeListAsync(param);
        }
        /// <summary>
        /// 垃圾分类信息提交
        /// </summary>
        /// <param name="w_WasteType"></param>
        /// <returns></returns>
        public async Task<ResultInfo> SubmitTypeFormAsync(W_WasteType w_WasteType)
        {
            return await _wasteService.SubmitTypeFormAsync(w_WasteType);
        }
    }
}
