Parcourir la source

update sample

master
yangxiaodong il y a 7 ans
Parent
révision
287307b6bc
4 fichiers modifiés avec 14 ajouts et 6 suppressions
  1. +10
    -3
      samples/Sample.RabbitMQ.SqlServer/Controllers/ValuesController.cs
  2. +1
    -1
      samples/Sample.RabbitMQ.SqlServer/Program.cs
  3. +2
    -1
      samples/Sample.RabbitMQ.SqlServer/Services/Impl/OrderService.cs
  4. +1
    -1
      samples/Sample.RabbitMQ.SqlServer/Startup.cs

+ 10
- 3
samples/Sample.RabbitMQ.SqlServer/Controllers/ValuesController.cs Voir le fichier

@@ -35,9 +35,16 @@ namespace Sample.RabbitMQ.SqlServer.Controllers
[Route("~/publish")]
public IActionResult PublishMessage()
{
_capBus.Publish("sample.rabbitmq.mysql22222", DateTime.Now);
// _capBus.Publish("sample.rabbitmq.mysql33333", person);

_capBus.Publish("sample.rabbitmq.sqlserver.order.check", DateTime.Now);

//var person = new Person
//{
// Name = "杨晓东",
// Age = 11,
// Id = 23
//};
//_capBus.Publish("sample.rabbitmq.mysql33333", person);

return Ok();
}


+ 1
- 1
samples/Sample.RabbitMQ.SqlServer/Program.cs Voir le fichier

@@ -24,7 +24,7 @@ namespace Sample.RabbitMQ.SqlServer

//host.Run();
public static void Main(string[] args)
{
{
BuildWebHost(args).Run();
}



+ 2
- 1
samples/Sample.RabbitMQ.SqlServer/Services/Impl/OrderService.cs Voir le fichier

@@ -8,9 +8,10 @@ namespace Sample.RabbitMQ.SqlServer.Services.Impl
{
public class OrderService : IOrderService, ICapSubscribe
{
[CapSubscribe("sample.rabbitmq.sqlserver.order.check")]
public void Check()
{
throw new NotImplementedException();
Console.WriteLine("out");
}
}
}

+ 1
- 1
samples/Sample.RabbitMQ.SqlServer/Startup.cs Voir le fichier

@@ -13,7 +13,7 @@ namespace Sample.RabbitMQ.SqlServer
{
services.AddDbContext<AppDbContext>();

services.AddTransient<IOrderService, OrderService>();
services.AddScoped<IOrderService, OrderService>();
services.AddTransient<ICmsService, CmsService>();

services.AddCap(x =>


Chargement…
Annuler
Enregistrer