| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Business.Core.Utilities;
- using Microsoft.AspNetCore.Mvc;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Volo.Abp.AspNetCore.Mvc;
- using Volo.Abp;
- namespace Business.Controllers
- {
- /// <summary>
- /// 二维码生成接口
- /// </summary>
- [RemoteService]
- [Area("Business")]
- [Route("api/business/code")]
- public class QRcodeController : AbpController
- {
- /// <summary>
- /// 生成二维码
- /// </summary>
- /// <param name="filePath">文件路径</param>
- /// <param name="context">二维码内容</param>
- /// <param name="x">x轴偏移量</param>
- /// <param name="y">y轴偏移量</param>
- [HttpGet]
- [Route("qrcode")]
- public void GenerateQrCode(string filePath, string context, int x, int y)
- {
- //二维码帮助类
- QRcodeHelper qRcode = new QRcodeHelper();
- //生成二维码
- qRcode.GenerateQrCode(filePath, context, x, y);
- }
- /// <summary>
- /// 生成条形码
- /// </summary>
- /// <param name="filePath">文件路径</param>
- /// <param name="context">挑衅码内容</param>
- /// <param name="x">x轴偏移量</param>
- /// <param name="y">y轴偏移量</param>
- [HttpGet]
- [Route("barcode")]
- public void GenerateBarcode(string filePath, string context, int x, int y)
- {
- QRcodeHelper qRcode = new QRcodeHelper();
- qRcode.GenerateBarcode(filePath, context, x, y);
- }
- }
- }
|