后端:

新增好友请求事件和好友已添加事件
This commit is contained in:
2026-02-01 13:21:21 +08:00
committed by nanxun
40 changed files with 550 additions and 194 deletions
+101 -113
View File
@@ -1,25 +1,30 @@
using Xunit;
using Microsoft.EntityFrameworkCore;
using Moq;
using AutoMapper;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using System;
using IM_API.Services;
using IM_API.Models;
using AutoMapper;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Exceptions;
using IM_API.Tools;
using IM_API.Models;
using IM_API.Services;
using MassTransit; // 必须引入
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
public class FriendServiceTests
{
private readonly Mock<IPublishEndpoint> _mockEndpoint = new();
private readonly Mock<ILogger<FriendService>> _mockLogger = new();
#region
private ImContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.UseInMemoryDatabase(Guid.NewGuid().ToString()) // 确保每个测试数据库隔离
.Options;
return new ImContext(options);
}
@@ -27,132 +32,115 @@ public class FriendServiceTests
{
var config = new MapperConfiguration(cfg =>
{
// 补充你业务中实际需要的映射规则
cfg.CreateMap<Friend, FriendInfoDto>();
cfg.CreateMap<FriendRequestDto, FriendRequest>();
cfg.CreateMap<HandleFriendRequestDto, FriendRequest>();
cfg.CreateMap<FriendRequest, Friend>()
.ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.ResponseUser))
.ForMember(dest => dest.FriendId, opt => opt.MapFrom(src => src.RequestUser))
.ForMember(dest => dest.RemarkName, opt => opt.MapFrom(src => "AutoAdded"));
.ForMember(d => d.UserId, o => o.MapFrom(s => s.ResponseUser))
.ForMember(d => d.FriendId, o => o.MapFrom(s => s.RequestUser));
});
return config.CreateMapper();
}
private FriendService CreateService(ImContext context)
{
var logger = new Mock<ILogger<FriendService>>();
return new FriendService(context, logger.Object, CreateMapper());
// 注入 Mock 对象和真实的 Mapper/Context
return new FriendService(context, _mockLogger.Object, CreateMapper(), _mockEndpoint.Object);
}
#endregion
// --------------------------- 测试 BlockFriendAsync ---------------------------
[Fact]
public async Task BlockFriendAsync_Should_Set_Status_To_Blocked()
public async Task SendFriendRequestAsync_Success_ShouldSaveAndPublish()
{
// Arrange
var context = CreateDbContext();
context.Friends.Add(new Friend
{
Id = 1,
UserId = 10,
FriendId = 20,
StatusEnum = FriendStatus.Added,
RemarkName = "test remark"
});
context.Users.AddRange(
new User { Id = 1, Username = "Sender", Password = "..." },
new User { Id = 2, Username = "Receiver", Password = "..." }
);
await context.SaveChangesAsync();
var service = CreateService(context);
var dto = new FriendRequestDto { ToUserId = 2, Description = "Hello" };
var result = await service.BlockeFriendAsync(1);
Assert.True(result);
Assert.Equal(FriendStatus.Blocked, context.Friends.Find(1).StatusEnum);
}
[Fact]
public async Task BlockFriendAsync_Should_Throw_When_NotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() => service.BlockeFriendAsync(99));
}
// --------------------------- 删除好友关系 ---------------------------
[Fact]
public async Task DeleteFriendAsync_Should_Remove_Friend()
{
var context = CreateDbContext();
context.Friends.Add(new Friend
{
Id = 2,
UserId = 1,
FriendId = 3,
RemarkName = "remark",
StatusEnum = FriendStatus.Added
});
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.DeleteFriendAsync(2);
Assert.True(result);
Assert.Empty(context.Friends);
}
// --------------------------- 获取好友列表 ---------------------------
[Fact]
public async Task GetFriendListAsync_Should_Return_Only_Added_Friends()
{
var context = CreateDbContext();
context.Friends.AddRange(new List<Friend>
{
new Friend{ UserId = 1, FriendId = 2, RemarkName ="a1", StatusEnum = FriendStatus.Added },
new Friend{ UserId = 1, FriendId = 3, RemarkName ="a2", StatusEnum = FriendStatus.Blocked }
});
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.GetFriendListAsync(1, 1, 10, false);
Assert.Single(result);
}
// --------------------------- 发起好友请求 ---------------------------
[Fact]
public async Task SendFriendRequestAsync_Should_Succeed()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 10, Username = "A", Password = "123" });
context.Users.Add(new User { Id = 20, Username = "B", Password = "123" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.SendFriendRequestAsync(new FriendRequestDto
{
FromUserId = 10,
ToUserId = 20
});
// Act
var result = await service.SendFriendRequestAsync(dto);
// Assert
Assert.True(result);
Assert.Single(context.FriendRequests);
Assert.Single(context.Friends);
// 验证事件是否发布到了 MQ
_mockEndpoint.Verify(x => x.Publish(
It.Is<RequestFriendEvent>(e => e.FromUserId == 1 && e.ToUserId == 2),
It.IsAny<CancellationToken>()),
Times.Once);
}
[Fact]
public async Task SendFriendRequestAsync_Should_Throw_When_User_NotFound()
public async Task SendFriendRequestAsync_UserNotFound_ShouldThrow()
{
// Arrange
var context = CreateDbContext();
context.Users.Add(new User { Id = 10, Username = "A", Password = "123" });
await context.SaveChangesAsync();
var service = CreateService(context);
var dto = new FriendRequestDto { ToUserId = 99 }; // 不存在的用户
// Act & Assert
await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(dto));
}
[Fact]
public async Task SendFriendRequestAsync_AlreadyExists_ShouldThrow()
{
// Arrange
var context = CreateDbContext();
context.Users.Add(new User { Id = 2 });
context.FriendRequests.Add(new FriendRequest
{
RequestUser = 1,
ResponseUser = 2,
State = (sbyte)FriendRequestState.Pending
});
await context.SaveChangesAsync();
var service = CreateService(context);
await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(new FriendRequestDto
{
FromUserId = 10,
ToUserId = 99
}));
// Act & Assert
await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(new FriendRequestDto { ToUserId = 2 }));
}
}
[Fact]
public async Task BlockFriendAsync_ValidId_ShouldUpdateStatus()
{
// Arrange
var context = CreateDbContext();
var friend = new Friend { Id = 50, UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added };
context.Friends.Add(friend);
await context.SaveChangesAsync();
var service = CreateService(context);
// Act
await service.BlockeFriendAsync(50);
// Assert
var updated = await context.Friends.FindAsync(50);
Assert.Equal(FriendStatus.Blocked, updated.StatusEnum);
}
[Fact]
public async Task GetFriendListAsync_ShouldFilterByStatus()
{
// Arrange
var context = CreateDbContext();
context.Friends.AddRange(
new Friend { UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added },
new Friend { UserId = 1, FriendId = 3, StatusEnum = FriendStatus.Blocked }
);
await context.SaveChangesAsync();
var service = CreateService(context);
// Act
var result = await service.GetFriendListAsync(1, 1, 10, false);
// Assert
Assert.Single(result); // 只应该拿到 Added 状态的
}
}
@@ -55,6 +55,42 @@
}
},
"coverlet.collector/6.0.0": {},
"MassTransit/8.5.5": {
"dependencies": {
"MassTransit.Abstractions": "8.5.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
"Microsoft.Extensions.Diagnostics.HealthChecks": "8.0.0",
"Microsoft.Extensions.Hosting.Abstractions": "8.0.1",
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
"Microsoft.Extensions.Options": "8.0.2"
},
"runtime": {
"lib/net8.0/MassTransit.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"MassTransit.Abstractions/8.5.5": {
"runtime": {
"lib/net8.0/MassTransit.Abstractions.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"MassTransit.RabbitMQ/8.5.5": {
"dependencies": {
"MassTransit": "8.5.5",
"RabbitMQ.Client": "7.1.2"
},
"runtime": {
"lib/net8.0/MassTransit.RabbitMqTransport.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"Microsoft.AspNetCore.Authentication.Abstractions/2.3.0": {
"dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "2.3.0",
@@ -326,6 +362,15 @@
}
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks/8.0.0": {
"dependencies": {
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "8.0.0",
"Microsoft.Extensions.Hosting.Abstractions": "8.0.1",
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
"Microsoft.Extensions.Options": "8.0.2"
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/8.0.0": {},
"Microsoft.Extensions.FileProviders.Abstractions/8.0.0": {
"dependencies": {
"Microsoft.Extensions.Primitives": "8.0.0"
@@ -843,6 +888,18 @@
}
}
},
"RabbitMQ.Client/7.1.2": {
"dependencies": {
"System.IO.Pipelines": "8.0.0",
"System.Threading.RateLimiting": "8.0.0"
},
"runtime": {
"lib/net8.0/RabbitMQ.Client.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.1.2.0"
}
}
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
"runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
"runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
@@ -1455,6 +1512,7 @@
}
},
"System.Threading.Channels/8.0.0": {},
"System.Threading.RateLimiting/8.0.0": {},
"System.Threading.Tasks/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
@@ -1573,6 +1631,7 @@
"dependencies": {
"AutoMapper": "12.0.1",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.0",
"MassTransit.RabbitMQ": "8.5.5",
"Microsoft.AspNetCore.Authentication.JwtBearer": "8.0.21",
"Microsoft.AspNetCore.SignalR": "1.2.0",
"Microsoft.VisualStudio.Azure.Containers.Tools.Targets": "1.22.1",
@@ -1625,6 +1684,27 @@
"path": "coverlet.collector/6.0.0",
"hashPath": "coverlet.collector.6.0.0.nupkg.sha512"
},
"MassTransit/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-bSg8k5q+rP1s+dIGXLLbctqDGdIkfDjdxwNWtCUH7xNCN9ZuM7mqSPQPIFgaYIi34e81m4FqAqo4CAHuWPkhRA==",
"path": "masstransit/8.5.5",
"hashPath": "masstransit.8.5.5.nupkg.sha512"
},
"MassTransit.Abstractions/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-0mn2Ay17dD6z5tgSLjbVRlldSbL9iowzFEfVgVfBXVG5ttz9dSWeR4TrdD6pqH93GWXp4CvSmF8i1HqxLX7DZw==",
"path": "masstransit.abstractions/8.5.5",
"hashPath": "masstransit.abstractions.8.5.5.nupkg.sha512"
},
"MassTransit.RabbitMQ/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UxWn4o90YVMF9PBkJeoskOFPneh6YtnI1fLJHtvZiSAG0eoiRrWPGa+6FQCvjkQ/ljCKfjzok2eGZc/vmNZ01A==",
"path": "masstransit.rabbitmq/8.5.5",
"hashPath": "masstransit.rabbitmq.8.5.5.nupkg.sha512"
},
"Microsoft.AspNetCore.Authentication.Abstractions/2.3.0": {
"type": "package",
"serviceable": true,
@@ -1870,6 +1950,20 @@
"path": "microsoft.extensions.diagnostics.abstractions/8.0.1",
"hashPath": "microsoft.extensions.diagnostics.abstractions.8.0.1.nupkg.sha512"
},
"Microsoft.Extensions.Diagnostics.HealthChecks/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-P9SoBuVZhJPpALZmSq72aQEb9ryP67EdquaCZGXGrrcASTNHYdrUhnpgSwIipgM5oVC+dKpRXg5zxobmF9xr5g==",
"path": "microsoft.extensions.diagnostics.healthchecks/8.0.0",
"hashPath": "microsoft.extensions.diagnostics.healthchecks.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-AT2qqos3IgI09ok36Qag9T8bb6kHJ3uT9Q5ki6CySybFsK6/9JbvQAgAHf1pVEjST0/N4JaFaCbm40R5edffwg==",
"path": "microsoft.extensions.diagnostics.healthchecks.abstractions/8.0.0",
"hashPath": "microsoft.extensions.diagnostics.healthchecks.abstractions.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.FileProviders.Abstractions/8.0.0": {
"type": "package",
"serviceable": true,
@@ -2073,6 +2167,13 @@
"path": "pomelo.entityframeworkcore.mysql/8.0.3",
"hashPath": "pomelo.entityframeworkcore.mysql.8.0.3.nupkg.sha512"
},
"RabbitMQ.Client/7.1.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-y3c6ulgULScWthHw5PLM1ShHRLhxg0vCtzX/hh61gRgNecL3ZC3WoBW2HYHoXOVRqTl99Br9E7CZEytGZEsCyQ==",
"path": "rabbitmq.client/7.1.2",
"hashPath": "rabbitmq.client.7.1.2.nupkg.sha512"
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {
"type": "package",
"serviceable": true,
@@ -2605,6 +2706,13 @@
"path": "system.threading.channels/8.0.0",
"hashPath": "system.threading.channels.8.0.0.nupkg.sha512"
},
"System.Threading.RateLimiting/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-7mu9v0QDv66ar3DpGSZHg9NuNcxDaaAcnMULuZlaTpP9+hwXhrxNGsF5GmLkSHxFdb5bBc1TzeujsRgTrPWi+Q==",
"path": "system.threading.ratelimiting/8.0.0",
"hashPath": "system.threading.ratelimiting.8.0.0.nupkg.sha512"
},
"System.Threading.Tasks/4.3.0": {
"type": "package",
"serviceable": true,
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,7 @@
"dependencies": {
"AutoMapper": "12.0.1",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.0",
"MassTransit.RabbitMQ": "8.5.5",
"Microsoft.AspNetCore.Authentication.JwtBearer": "8.0.21",
"Microsoft.AspNetCore.SignalR": "1.2.0",
"Microsoft.EntityFrameworkCore.Design": "8.0.21",
@@ -56,6 +57,42 @@
}
}
},
"MassTransit/8.5.5": {
"dependencies": {
"MassTransit.Abstractions": "8.5.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
"Microsoft.Extensions.Diagnostics.HealthChecks": "8.0.0",
"Microsoft.Extensions.Hosting.Abstractions": "8.0.1",
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
"Microsoft.Extensions.Options": "8.0.2"
},
"runtime": {
"lib/net8.0/MassTransit.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"MassTransit.Abstractions/8.5.5": {
"runtime": {
"lib/net8.0/MassTransit.Abstractions.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"MassTransit.RabbitMQ/8.5.5": {
"dependencies": {
"MassTransit": "8.5.5",
"RabbitMQ.Client": "7.1.2"
},
"runtime": {
"lib/net8.0/MassTransit.RabbitMqTransport.dll": {
"assemblyVersion": "8.5.5.0",
"fileVersion": "8.5.5.0"
}
}
},
"Microsoft.AspNetCore.Authentication.Abstractions/2.3.0": {
"dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "2.3.0",
@@ -565,6 +602,15 @@
}
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks/8.0.0": {
"dependencies": {
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "8.0.0",
"Microsoft.Extensions.Hosting.Abstractions": "8.0.1",
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
"Microsoft.Extensions.Options": "8.0.2"
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/8.0.0": {},
"Microsoft.Extensions.FileProviders.Abstractions/8.0.0": {
"dependencies": {
"Microsoft.Extensions.Primitives": "8.0.0"
@@ -764,6 +810,18 @@
}
}
},
"RabbitMQ.Client/7.1.2": {
"dependencies": {
"System.IO.Pipelines": "8.0.0",
"System.Threading.RateLimiting": "8.0.0"
},
"runtime": {
"lib/net8.0/RabbitMQ.Client.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.1.2.0"
}
}
},
"StackExchange.Redis/2.9.32": {
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
@@ -922,7 +980,8 @@
}
},
"System.Text.Encodings.Web/8.0.0": {},
"System.Threading.Channels/8.0.0": {}
"System.Threading.Channels/8.0.0": {},
"System.Threading.RateLimiting/8.0.0": {}
}
},
"libraries": {
@@ -952,6 +1011,27 @@
"path": "humanizer.core/2.14.1",
"hashPath": "humanizer.core.2.14.1.nupkg.sha512"
},
"MassTransit/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-bSg8k5q+rP1s+dIGXLLbctqDGdIkfDjdxwNWtCUH7xNCN9ZuM7mqSPQPIFgaYIi34e81m4FqAqo4CAHuWPkhRA==",
"path": "masstransit/8.5.5",
"hashPath": "masstransit.8.5.5.nupkg.sha512"
},
"MassTransit.Abstractions/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-0mn2Ay17dD6z5tgSLjbVRlldSbL9iowzFEfVgVfBXVG5ttz9dSWeR4TrdD6pqH93GWXp4CvSmF8i1HqxLX7DZw==",
"path": "masstransit.abstractions/8.5.5",
"hashPath": "masstransit.abstractions.8.5.5.nupkg.sha512"
},
"MassTransit.RabbitMQ/8.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UxWn4o90YVMF9PBkJeoskOFPneh6YtnI1fLJHtvZiSAG0eoiRrWPGa+6FQCvjkQ/ljCKfjzok2eGZc/vmNZ01A==",
"path": "masstransit.rabbitmq/8.5.5",
"hashPath": "masstransit.rabbitmq.8.5.5.nupkg.sha512"
},
"Microsoft.AspNetCore.Authentication.Abstractions/2.3.0": {
"type": "package",
"serviceable": true,
@@ -1246,6 +1326,20 @@
"path": "microsoft.extensions.diagnostics.abstractions/8.0.1",
"hashPath": "microsoft.extensions.diagnostics.abstractions.8.0.1.nupkg.sha512"
},
"Microsoft.Extensions.Diagnostics.HealthChecks/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-P9SoBuVZhJPpALZmSq72aQEb9ryP67EdquaCZGXGrrcASTNHYdrUhnpgSwIipgM5oVC+dKpRXg5zxobmF9xr5g==",
"path": "microsoft.extensions.diagnostics.healthchecks/8.0.0",
"hashPath": "microsoft.extensions.diagnostics.healthchecks.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-AT2qqos3IgI09ok36Qag9T8bb6kHJ3uT9Q5ki6CySybFsK6/9JbvQAgAHf1pVEjST0/N4JaFaCbm40R5edffwg==",
"path": "microsoft.extensions.diagnostics.healthchecks.abstractions/8.0.0",
"hashPath": "microsoft.extensions.diagnostics.healthchecks.abstractions.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.FileProviders.Abstractions/8.0.0": {
"type": "package",
"serviceable": true,
@@ -1393,6 +1487,13 @@
"path": "pomelo.entityframeworkcore.mysql/8.0.3",
"hashPath": "pomelo.entityframeworkcore.mysql.8.0.3.nupkg.sha512"
},
"RabbitMQ.Client/7.1.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-y3c6ulgULScWthHw5PLM1ShHRLhxg0vCtzX/hh61gRgNecL3ZC3WoBW2HYHoXOVRqTl99Br9E7CZEytGZEsCyQ==",
"path": "rabbitmq.client/7.1.2",
"hashPath": "rabbitmq.client.7.1.2.nupkg.sha512"
},
"StackExchange.Redis/2.9.32": {
"type": "package",
"serviceable": true,
@@ -1553,6 +1654,13 @@
"sha512": "sha512-CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==",
"path": "system.threading.channels/8.0.0",
"hashPath": "system.threading.channels.8.0.0.nupkg.sha512"
},
"System.Threading.RateLimiting/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-7mu9v0QDv66ar3DpGSZHg9NuNcxDaaAcnMULuZlaTpP9+hwXhrxNGsF5GmLkSHxFdb5bBc1TzeujsRgTrPWi+Q==",
"path": "system.threading.ratelimiting/8.0.0",
"hashPath": "system.threading.ratelimiting.8.0.0.nupkg.sha512"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,5 +16,11 @@
"ConnectionStrings": {
"DefaultConnection": "Server=frp-era.com;Port=26582;Database=IM;User=product;Password=12345678;",
"Redis": "192.168.5.100:6379"
},
"RabbitMQOptions": {
"Host": "192.168.5.100",
"Port": 5672,
"Username": "test",
"Password": "123456"
}
}
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("IMTest")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7ebf23ddd8a0d5536167313c4cf37af1552a5057")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+83be063e7fbdba82984ef3beb231bd8a0a983c2f")]
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
ca0390a4d5773daae2e747d7512c190701a7a942186c769e42327a4864733f0b
495895405696fa7fe9836aaaa2da1791d39c26be9cfe301758e0fe7d7c9164b6
@@ -1,7 +1,5 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
@@ -1,9 +1,9 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;
global using Xunit;
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::Xunit;
Binary file not shown.
@@ -1 +1 @@
b97252705aa63c43e1310042fe4fd7115206f72ef0f55d39109c2b849fe2a37e
97ad978fabe5fb8f7f258c9878659ee9a5f2492332ad5efd70b1d456ebc42a59
@@ -140,3 +140,7 @@ C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\refint\IMTest.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.pdb
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.genruntimeconfig.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\ref\IMTest.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\MassTransit.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\MassTransit.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\MassTransit.RabbitMqTransport.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\RabbitMQ.Client.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,7 +49,7 @@
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.100"
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
@@ -96,7 +96,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.102/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
},
@@ -141,7 +141,7 @@
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.100"
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
@@ -223,7 +223,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.102/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
}
@@ -7,7 +7,7 @@
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\nanxun\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\nanxun\.nuget\packages\" />
+3 -11
View File
@@ -8805,7 +8805,7 @@
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.100"
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
@@ -8852,16 +8852,8 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.102/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
},
"logs": [
{
"code": "Undefined",
"level": "Warning",
"warningLevel": 1,
"message": "读取缓存文件 C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\project.nuget.cache 时遇到问题: '<' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 2 | BytePositionInLine: 0."
}
]
}
}
+2 -12
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "j7OjEXb1ZGE=",
"dgSpecHash": "tVGTA3KwBHQ=",
"success": true,
"projectFilePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"expectedPackageFiles": [
@@ -169,15 +169,5 @@
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.extensibility.execution\\2.5.3\\xunit.extensibility.execution.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.runner.visualstudio\\2.5.3\\xunit.runner.visualstudio.2.5.3.nupkg.sha512"
],
"logs": [
{
"code": "Undefined",
"level": "Warning",
"message": "读取缓存文件 C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\project.nuget.cache 时遇到问题: '<' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 2 | BytePositionInLine: 0.",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"warningLevel": 1,
"filePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"targetGraphs": []
}
]
"logs": []
}