瀏覽代碼

update sample

master
yangxiaodong 7 年之前
父節點
當前提交
287307b6bc
共有 4 個文件被更改,包括 14 次插入6 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 =>


Loading…
取消
儲存