添加命令数据验证和其他杂项修改
This commit is contained in:
27
QRCodeService/Controllers/RedirectController.cs
Normal file
27
QRCodeService/Controllers/RedirectController.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using QRCodeService.Application.Queries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace QRCodeService.Controllers
|
||||
{
|
||||
[Route("{shortCode}")]
|
||||
public class RedirectController:Controller
|
||||
{
|
||||
private readonly ILinkQueries queries;
|
||||
|
||||
public RedirectController(ILinkQueries queries)
|
||||
{
|
||||
this.queries = queries;
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Index(string shortCode)
|
||||
{
|
||||
var link = await queries.GetLinkAsync(shortCode);
|
||||
return View(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user