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

namespace YBDevice.NApi.Application.PrintInfo
{
    public class PrintAppService : IDynamicApiController
    {
        private readonly IPrintService _printService;
        public PrintAppService(IPrintService printService)
        {
            _printService = printService;
        }

        /// <summary>
        /// 生成打印编号并记录
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResultInfo> GetCodeAsync(PrintCodeC2SDto data)
        {
            return await _printService.GetCodeAsync(data);
        }
        /// <summary>
        /// 根据ID获取设备列表
        /// </summary>
        /// <param name="id">打印记录ID</param>
        /// <returns></returns>
        [QueryParameters]
        public async Task<ResultInfo> GetDevCodeListByIdAsync(Guid id)
        {
            return await _printService.GetDevCodeListByIdAsync(id);
        }
    }
}
