You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB
C#

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;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public OpenPrintController(IOpenPrintService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 根据模板Id获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
[Route("GetOpenJsonPrintInfoAsync")]
public async Task<PrintDataResult> GetOpenJsonPrintInfo([FromBody] OpenJsonPrintReq req)
{
var res = await _invokeService.GetOpenJsonPrintInfo(req);
return res;
}
/// <summary>
/// 根据模板Code获取Json打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
[Route("GetOpenJsonPrintInfoByTemplateCode")]
public async Task<PrintDataResult> GetOpenJsonPrintInfoByTemplateCode([FromBody] OpenJsonPrintByCodeReq req)
{
var res = await _invokeService.GetOpenJsonPrintInfoByTemplateCode(req);
return res;
}
}
}