diff --git a/Domain/Domain.csproj b/Domain/Domain.csproj
index 27b30d8..ca8eba3 100644
--- a/Domain/Domain.csproj
+++ b/Domain/Domain.csproj
@@ -9,4 +9,9 @@
+
+
+
+
+
diff --git a/QRCodeService/Application/Commands/CreateLinkCommand.cs b/QRCodeService/Application/Commands/CreateLinkCommand.cs
index 9f7315c..4c616a9 100644
--- a/QRCodeService/Application/Commands/CreateLinkCommand.cs
+++ b/QRCodeService/Application/Commands/CreateLinkCommand.cs
@@ -9,6 +9,6 @@ namespace QRCodeService.Application.Commands
{
public class CreateLinkCommand : IRequest
{
-
+ public string SuffixUrl { get; set; }
}
}
diff --git a/QRCodeService/Application/Validations/CreateLinkCommandValidator.cs b/QRCodeService/Application/Validations/CreateLinkCommandValidator.cs
new file mode 100644
index 0000000..88e65ec
--- /dev/null
+++ b/QRCodeService/Application/Validations/CreateLinkCommandValidator.cs
@@ -0,0 +1,21 @@
+using FluentValidation;
+using Microsoft.Extensions.Logging;
+using QRCodeService.Application.Commands;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace QRCodeService.Application.Validations
+{
+ public class CreateLinkCommandValidator: AbstractValidator
+ {
+ public CreateLinkCommandValidator(ILogger logger)
+ {
+ RuleFor(link=>link.SuffixUrl).NotEmpty().WithMessage("No SuffixUrl found");
+
+ logger.LogTrace("----- INSTANCE CREATED - {ClassName}", GetType().Name);
+ }
+ }
+}
diff --git a/QRCodeService/Controllers/GoController.cs b/QRCodeService/Controllers/GoController.cs
index 4011744..f95a034 100644
--- a/QRCodeService/Controllers/GoController.cs
+++ b/QRCodeService/Controllers/GoController.cs
@@ -12,23 +12,19 @@ namespace QRCodeService.Controllers
/// 跳转url请求的地址
///
[Route("{shortCode}")]
- [ApiController]
- public class GoController: ControllerBase
+ public class GoController: Controller
{
- readonly ILinkRepository LinkRepository;
- public GoController(ILinkRepository linkRepository)
- {
- LinkRepository = linkRepository;
- }
+ //readonly ILinkRepository LinkRepository;
+ //public GoController(ILinkRepository linkRepository)
+ //{
+ // LinkRepository = linkRepository;
+ //}
[HttpGet]
- public async Task Get(string shortcode)
+ public async Task Index(string shortcode)
{
- var link = await LinkRepository.GetAsync(shortcode);
- if (link == null)
- {
- return NotFound();
- }
- return Redirect(link.FullUrl);
+ var a = new { Url = "asdasd" };
+ //var link = await LinkRepository.GetAsync(shortcode);
+ return View(a);
}
}
}
diff --git a/QRCodeService/QRCodeService.csproj b/QRCodeService/QRCodeService.csproj
index c860cfc..fe86347 100644
--- a/QRCodeService/QRCodeService.csproj
+++ b/QRCodeService/QRCodeService.csproj
@@ -6,6 +6,13 @@
..\docker-compose.dcproj
+
+
+
+
+
+
+
diff --git a/QRCodeService/Startup.cs b/QRCodeService/Startup.cs
index 62ef8cb..734409d 100644
--- a/QRCodeService/Startup.cs
+++ b/QRCodeService/Startup.cs
@@ -32,8 +32,8 @@ namespace QRCodeService
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
-
- services.AddControllers();
+ //ṩȴŻû
+ services.AddControllersWithViews();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "QRCodeService", Version = "v1" });
diff --git a/QRCodeService/Views/Go/Index.cshtml b/QRCodeService/Views/Go/Index.cshtml
new file mode 100644
index 0000000..76fcc76
--- /dev/null
+++ b/QRCodeService/Views/Go/Index.cshtml
@@ -0,0 +1,8 @@
+@*
+ For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
+*@
+@{
+
+ loading
+
+}
diff --git a/README.md b/README.md
index 1488dca..1d0e864 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-施工图审查系统二维码短链生成服务
\ No newline at end of file
+# 施工图审查系统二维码短链生成服务
\ No newline at end of file