update:docker compose 更新
queries构造函数修改 配置json更新
This commit is contained in:
@@ -8,6 +8,7 @@ using QRCoder;
|
||||
using System.IO;
|
||||
using QRCodeService.Application.Queries;
|
||||
using QRCodeService.Models;
|
||||
using QRCodeService.Options;
|
||||
|
||||
namespace QRCodeService.Controllers
|
||||
{
|
||||
@@ -17,11 +18,12 @@ namespace QRCodeService.Controllers
|
||||
{
|
||||
readonly ILinkQueries linkQueries;
|
||||
readonly IAppQueries appQueries;
|
||||
|
||||
public ImageController(ILinkQueries linkQueries, IAppQueries appQueries)
|
||||
readonly ServiceOption option;
|
||||
public ImageController(ILinkQueries linkQueries, IAppQueries appQueries,ServiceOption option)
|
||||
{
|
||||
this.linkQueries = linkQueries;
|
||||
this.appQueries = appQueries;
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
[Route("qrcode")]
|
||||
@@ -43,7 +45,7 @@ namespace QRCodeService.Controllers
|
||||
return BadRequest();
|
||||
}
|
||||
var qrCodeGenerator = new QRCodeGenerator();
|
||||
var data = qrCodeGenerator.CreateQrCode($"http://localhost:5000/{link.ShortCode}", QRCodeGenerator.ECCLevel.Q);
|
||||
var data = qrCodeGenerator.CreateQrCode($"{option.BaseUrl}r/{link.ShortCode}", QRCodeGenerator.ECCLevel.Q);
|
||||
var qrCode = new QRCode(data);
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace QRCodeService.Controllers
|
||||
{
|
||||
[Route("{shortCode}")]
|
||||
[Route("r/{shortCode}")]
|
||||
public class RedirectController:Controller
|
||||
{
|
||||
private readonly ILinkQueries queries;
|
||||
|
||||
Reference in New Issue
Block a user