From b4772a415377c71612020b90f4930f17fcce56ba 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: Fri, 16 Dec 2022 15:52:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E5=A2=9E=E5=8A=A0lo?= =?UTF-8?q?go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Extensions/LogoExtension.cs | 23 +++++++++++++++++++++ ZR.Admin.WebApi/Program.cs | 2 ++ ZR.Admin.WebApi/wwwroot/logo.txt | 7 +++++++ 3 files changed, 32 insertions(+) create mode 100644 ZR.Admin.WebApi/Extensions/LogoExtension.cs create mode 100644 ZR.Admin.WebApi/wwwroot/logo.txt diff --git a/ZR.Admin.WebApi/Extensions/LogoExtension.cs b/ZR.Admin.WebApi/Extensions/LogoExtension.cs new file mode 100644 index 0000000..27f2126 --- /dev/null +++ b/ZR.Admin.WebApi/Extensions/LogoExtension.cs @@ -0,0 +1,23 @@ +using JinianNet.JNTemplate; +using Microsoft.Extensions.DependencyInjection; +using System; +using ZR.Common; + +namespace ZR.Admin.WebApi.Extensions +{ + public static class LogoExtension + { + public static void AddLogo(this IServiceCollection services) + { + Console.ForegroundColor = ConsoleColor.Blue; + var contentTpl = JnHelper.ReadTemplate("", "logo.txt"); + var content = contentTpl.Render(); + + Console.WriteLine(content); + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("源码地址: https://gitee.com/izory/ZrAdminNetCore"); + Console.WriteLine("官方文档:http://www.izhaorui.cn/doc"); + Console.WriteLine("打赏作者:http://www.izhaorui.cn/doc/support.html"); + } + } +} diff --git a/ZR.Admin.WebApi/Program.cs b/ZR.Admin.WebApi/Program.cs index 30b1dab..48a295b 100644 --- a/ZR.Admin.WebApi/Program.cs +++ b/ZR.Admin.WebApi/Program.cs @@ -80,6 +80,8 @@ builder.Services.AddMvc(options => }); builder.Services.AddSwaggerConfig(); +// 显示logo +builder.Services.AddLogo(); var app = builder.Build(); InternalApp.ServiceProvider = app.Services; diff --git a/ZR.Admin.WebApi/wwwroot/logo.txt b/ZR.Admin.WebApi/wwwroot/logo.txt new file mode 100644 index 0000000..8b06c93 --- /dev/null +++ b/ZR.Admin.WebApi/wwwroot/logo.txt @@ -0,0 +1,7 @@ + ___________ _ _ _ _ ______ _______ + |___ / __ \ /\ | | (_) | \ | | ____|__ __| + / /| |__) | / \ __| |_ __ ___ _ _ __ | \| | |__ | | + / / | _ / / /\ \ / _` | '_ ` _ \| | '_ \ | . ` | __| | | + / /__| | \ \ / ____ \ (_| | | | | | | | | | |_| |\ | |____ | | + /_____|_| \_\/_/ \_\__,_|_| |_| |_|_|_| |_(_)_| \_|______| |_| + \ No newline at end of file