From 6772266b95dd9f00b70ff87499b42da7defbfab8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Mon, 29 Nov 2021 21:54:01 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Ejnt=E6=A8=A1=E6=9D=BF?=
=?UTF-8?q?=E5=BC=95=E6=93=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Admin.WebApi/Startup.cs | 9 +++
.../CodeGenTemplate/InputDtoTemplate.txt | 18 +++---
.../wwwroot/CodeGenTemplate/VueTemplate.txt | 63 +++++++++----------
ZR.CodeGenerator/CodeGeneratorTool.cs | 43 ++++++++++---
ZR.CodeGenerator/FileHelper.cs | 13 +++-
ZR.CodeGenerator/Model/ReplaceDto.cs | 1 +
ZR.CodeGenerator/ZR.CodeGenerator.csproj | 1 +
7 files changed, 95 insertions(+), 53 deletions(-)
diff --git a/ZR.Admin.WebApi/Startup.cs b/ZR.Admin.WebApi/Startup.cs
index 1d1340f..1d568c1 100644
--- a/ZR.Admin.WebApi/Startup.cs
+++ b/ZR.Admin.WebApi/Startup.cs
@@ -1,6 +1,7 @@
using Hei.Captcha;
using Infrastructure;
using Infrastructure.Extensions;
+using JinianNet.JNTemplate;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@@ -84,6 +85,14 @@ namespace ZR.Admin.WebApi
c.IncludeXmlComments("ZRAdmin.xml", true);
}
});
+
+ //jntģȫֱ
+ Engine.Configure((options) =>
+ {
+ options.Data.Set("author", Configuration["gen:author"]);
+ options.Data.Set("time", DateTime.Now.ToString("yyyy-MM-dd"));
+ //...
+ });
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/InputDtoTemplate.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/InputDtoTemplate.txt
index ded802d..e44f353 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/InputDtoTemplate.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/InputDtoTemplate.txt
@@ -1,24 +1,24 @@
using System;
using System.Collections.Generic;
-using {ModelsNamespace}.Dto;
-using {ModelsNamespace}.Models;
+using ${ModelsNamespace}.Dto;
+using ${ModelsNamespace}.Models;
-namespace {DtosNamespace}.Dto
+namespace ${DtosNamespace}.Dto
{
///