using DS.WMS.PrintApi.Model; using DS.WMS.PrintApi.Service; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace DS.WMS.PrintApi.Controllers { [Route("printApi/[controller]")] [ApiController] public class OpenPrintController : Controller { private readonly IOpenPrintService _invokeService; /// /// 构造函数 /// /// public OpenPrintController(IOpenPrintService invokeService) { _invokeService = invokeService; } /// /// 根据模板Id获取Json打印信息 /// /// /// [HttpPost] [AllowAnonymous] [Route("GetOpenJsonPrintInfoAsync")] public async Task GetOpenJsonPrintInfo([FromBody] OpenJsonPrintReq req) { var res = await _invokeService.GetOpenJsonPrintInfo(req); return res; } /// /// 根据模板Code获取Json打印信息 /// /// /// [HttpPost] [AllowAnonymous] [Route("GetOpenJsonPrintInfoByTemplateCode")] public async Task GetOpenJsonPrintInfoByTemplateCode([FromBody] OpenJsonPrintByCodeReq req) { var res = await _invokeService.GetOpenJsonPrintInfoByTemplateCode(req); return res; } /// /// sql数据源打印 /// /// /// [HttpPost] [AllowAnonymous] [Route("GetOpenSqlPrintInfo")] public async Task GetOpenSqlPrintInfo([FromBody] OpenSqlPrintReq req) { var res = await _invokeService.GetOpenSqlPrintInfo(req); return res; } } }