📝 feat(修改): 修改中间件启动在控制台中输出
This commit is contained in:
parent
a08916057a
commit
2165c49419
|
@ -9,11 +9,6 @@ public static class MinioContext
|
|||
public static readonly string BucketName = AppSettings.GetConfig("Minio:BucketName");
|
||||
|
||||
public static void AddMinioContext(this WebApplicationBuilder builder)
|
||||
{
|
||||
Task.Run(Connect);
|
||||
}
|
||||
|
||||
private static void Connect()
|
||||
{
|
||||
var endpoint = AppSettings.GetConfig("Minio:Url");
|
||||
var accessKey = AppSettings.GetConfig("Minio:AccessKey");
|
||||
|
@ -23,6 +18,6 @@ public static class MinioContext
|
|||
// .WithSSL() // 使用HTTPS
|
||||
.Build();
|
||||
|
||||
Console.WriteLine($"Minio 已连接...\n初始化桶:{BucketName}");
|
||||
Console.WriteLine($"Minio 初始化...\n初始化桶:{BucketName}");
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ public static class RedisContext
|
|||
// 创建连接对象
|
||||
RedisDatabase = connect.GetDatabase();
|
||||
|
||||
Console.WriteLine("Redis 连接成功...");
|
||||
Console.WriteLine("Redis 初始化...");
|
||||
});
|
||||
}
|
||||
}
|
|
@ -42,7 +42,7 @@ public class MinioService : IMinioService
|
|||
/// <returns>桶列表</returns>
|
||||
public ListAllMyBucketsResult GetAllMyBuckets()
|
||||
{
|
||||
return _minioContext!.ListBucketsAsync().Result;
|
||||
return _minioContext.ListBucketsAsync().Result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -25,9 +25,9 @@ public static class CronJobService
|
|||
.ForJob(jobDetail)
|
||||
.UsingJobData("trigger", "trigger值")
|
||||
.UsingJobData("triggerCount", 1)
|
||||
.WithIdentity("testTrigger", "测试发出器")
|
||||
.WithIdentity("cronTrigger", "测试发出器")
|
||||
.StartNow()
|
||||
.WithCronSchedule("0/6 * * * * ?")
|
||||
.WithCronSchedule("0/1 * * * * ?")
|
||||
.Build();
|
||||
|
||||
scheduler.ScheduleJob(trigger).GetAwaiter().GetResult();
|
||||
|
|
|
@ -17,7 +17,7 @@ public static class SimpleJobService
|
|||
.WithIdentity("simpleJob", "简单的JOB")
|
||||
.Build();
|
||||
var trigger = TriggerBuilder.Create()
|
||||
.WithIdentity("testTrigger", "测试发出器")
|
||||
.WithIdentity("simpleTrigger", "测试发出器")
|
||||
.StartNow()
|
||||
// 每隔5秒执行一次,一共重复10次
|
||||
.WithSimpleSchedule(x => x.WithIntervalInSeconds(1).WithRepeatCount(10))
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
using System.Net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Bunny.Test.Until.Test;
|
||||
|
||||
public class Animal
|
||||
{
|
||||
}
|
||||
|
||||
public class Dog : Animal
|
||||
{
|
||||
}
|
||||
|
||||
public class Test1
|
||||
{
|
||||
public int age;
|
||||
|
||||
[Test]
|
||||
public void Start()
|
||||
{
|
||||
Animal dog = new Dog();
|
||||
|
||||
// 使用委托方式写
|
||||
Calculate add = (x, y) => x + y;
|
||||
var result = add(1, 3);
|
||||
Console.WriteLine(result);
|
||||
|
||||
// 使用委托执行函数
|
||||
MyDelegate myDelegate = Method1;
|
||||
myDelegate += Method2;
|
||||
myDelegate += Method3;
|
||||
myDelegate(); // 调用委托,将依次执行 Method1、Method2 和 Method3
|
||||
|
||||
// 多参数传入
|
||||
TestFun1(1, 2, 3, 4);
|
||||
|
||||
var httpClient = new HttpClient();
|
||||
}
|
||||
|
||||
public static implicit operator int(Test1 test1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static implicit operator string(Test1 test1)
|
||||
{
|
||||
return "Dog";
|
||||
}
|
||||
|
||||
private static void TestFun1(int x, params int[] arg)
|
||||
{
|
||||
foreach (var i in arg) Console.WriteLine(i);
|
||||
}
|
||||
|
||||
private static void Method1()
|
||||
{
|
||||
Console.WriteLine("Method1");
|
||||
}
|
||||
|
||||
private static void Method2()
|
||||
{
|
||||
Console.WriteLine("Method2");
|
||||
}
|
||||
|
||||
private static void Method3()
|
||||
{
|
||||
Console.WriteLine("Method3");
|
||||
}
|
||||
|
||||
private delegate void MyDelegate();
|
||||
|
||||
private delegate int Calculate(int x, int y);
|
||||
}
|
|
@ -19,12 +19,14 @@
|
|||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.JobTest.JobTest1.TestJob</TestId>
|
||||
</TestAncestor>
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=83126680_002Dc767_002D40a2_002Dadfd_002Daa4542ab8b4b/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="TestJob #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=83126680_002Dc767_002D40a2_002Dadfd_002Daa4542ab8b4b/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="TestJob #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<TestAncestor>
|
||||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.JobTest.JobTest1.TestJob</TestId>
|
||||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.Test.Test1.Start</TestId>
|
||||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.Test.Test1</TestId>
|
||||
</TestAncestor>
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=eb9da086_002D824a_002D4ac4_002Db755_002D94438e510122/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="Test1" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=eb9da086_002D824a_002D4ac4_002Db755_002D94438e510122/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Test1" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Or>
|
||||
<And>
|
||||
<TestAncestor>
|
||||
|
@ -43,6 +45,7 @@
|
|||
</And>
|
||||
<TestAncestor>
|
||||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.JobTest.JobTest1.TestJob</TestId>
|
||||
<TestId>NUnit3x::945BE294-8057-40EE-9A98-5598D1A728B9::net8.0::Bunny.Test.Until.Test.Test1.Start</TestId>
|
||||
</TestAncestor>
|
||||
</Or>
|
||||
</SessionState></s:String>
|
||||
|
|
Loading…
Reference in New Issue