Revert "提交"

This reverts commit b96d895809.
This commit is contained in:
西街长安 2026-02-12 21:59:08 +08:00
parent b96d895809
commit d429560511
339 changed files with 46657 additions and 46655 deletions

View File

@ -1,28 +1,28 @@
name: "IM 缺陷报告"
description: "记录聊天消息、SignalR 或缓存相关的问题"
title: "[BUG]简要描述问题"
labels: ["bug", "high-priority"]
body:
- type: markdown
attributes:
value: "请详细填写 Bug 信息,这将有助于快速定位后端 Redis 或 SignalR 的问题。"
- type: input
id: stream_key
attributes:
label: "相关 StreamKey / 群组 ID"
placeholder: "例如group:123"
- type: textarea
id: steps
attributes:
label: "复现步骤"
value: |
1. 登录用户 A 和用户 B
2. 用户 A 向群组发送消息
3. 用户 B 界面没有反应
validations:
required: true
- type: textarea
id: logs
attributes:
label: "控制台错误日志 (Console Log)"
name: "IM 缺陷报告"
description: "记录聊天消息、SignalR 或缓存相关的问题"
title: "[BUG]简要描述问题"
labels: ["bug", "high-priority"]
body:
- type: markdown
attributes:
value: "请详细填写 Bug 信息,这将有助于快速定位后端 Redis 或 SignalR 的问题。"
- type: input
id: stream_key
attributes:
label: "相关 StreamKey / 群组 ID"
placeholder: "例如group:123"
- type: textarea
id: steps
attributes:
label: "复现步骤"
value: |
1. 登录用户 A 和用户 B
2. 用户 A 向群组发送消息
3. 用户 B 界面没有反应
validations:
required: true
- type: textarea
id: logs
attributes:
label: "控制台错误日志 (Console Log)"
placeholder: "在此粘贴浏览器或后端的报错信息..."

View File

@ -1,3 +1,3 @@
# Chat
# Chat
一个学习项目

View File

@ -1,3 +1,3 @@
bin/
obj/
bin/
obj/
.vs/

View File

@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.22" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IM_API\IM_API.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.22" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IM_API\IM_API.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
</Project>

View File

@ -1,208 +1,208 @@
using AutoMapper;
using IM_API.Dtos.Auth;
using IM_API.Dtos.User;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
public class AuthServiceTests
{
// ---------- 辅助:创建独立的 InMemory DbContext ----------
private ImContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
var context = new ImContext(options);
return context;
}
// ---------- 可用于模拟 SaveChanges 抛异常的 DbContext ----------
private class ThrowOnSaveImContext : ImContext
{
private readonly bool _throw;
public ThrowOnSaveImContext(DbContextOptions<ImContext> options, bool throwOnSave) : base(options)
{
_throw = throwOnSave;
}
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
{
if (_throw) throw new InvalidOperationException("Simulated DB save error");
return base.SaveChangesAsync(cancellationToken);
}
}
// ---------- 默认 AutoMapper简易映射配置 ----------
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<RegisterRequestDto, User>();
cfg.CreateMap<User, UserInfoDto>();
});
return config.CreateMapper();
}
// ---------- 创建 Service允许注入自定义 mapper ----------
private AuthService CreateService(ImContext context, IMapper mapper = null)
{
var loggerMock = new Mock<ILogger<AuthService>>();
var mapperToUse = mapper ?? CreateMapper();
var mockCache = new Mock<ICacheService>();
return new AuthService(context, loggerMock.Object, mapperToUse,mockCache.Object);
}
// --------------------- 测试用例 ---------------------
[Fact]
public async Task LoginAsync_ShouldReturnUser_WhenValidCredentials()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 1, Username = "Tom", Password = "123456", NickName = "测试用户" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.LoginAsync(new LoginRequestDto
{
Username = "Tom",
Password = "123456"
});
Assert.NotNull(result);
Assert.Equal(1, result.Id);
Assert.Equal("Tom", result.Username);
}
[Fact]
public async Task LoginAsync_ShouldThrowException_WhenInvalidCredentials()
{
var context = CreateDbContext();
var service = CreateService(context);
await Assert.ThrowsAsync<BaseException>(async () =>
{
await service.LoginAsync(new LoginRequestDto
{
Username = "NotExist",
Password = "wrong"
});
});
}
[Fact]
public async Task LoginAsync_IsCaseSensitive_ForUsername()
{
// 说明:当前实现是精确匹配 => 区分大小写
var context = CreateDbContext();
context.Users.Add(new User { Id = 10, Username = "Tom", Password = "p" });
await context.SaveChangesAsync();
var service = CreateService(context);
// 使用小写用户名应失败(表明当前逻辑区分大小写)
await Assert.ThrowsAsync<BaseException>(async () =>
{
await service.LoginAsync(new LoginRequestDto { Username = "tom", Password = "p" });
});
}
[Fact]
public async Task RegisterAsync_ShouldPersistUserAndReturnDto_WhenNewUser()
{
var context = CreateDbContext();
var service = CreateService(context);
var request = new RegisterRequestDto
{
Username = "Jerry",
Password = "123456"
};
var result = await service.RegisterAsync(request);
// 返回值正确
Assert.NotNull(result);
Assert.Equal("Jerry", result.Username);
Assert.True(result.Id > 0);
// DB 中确实存在该用户
var persisted = await context.Users.FirstOrDefaultAsync(u => u.Username == "Jerry");
Assert.NotNull(persisted);
Assert.Equal("Jerry", persisted.Username);
}
[Fact]
public async Task RegisterAsync_ShouldThrowException_WhenUserExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Username = "Tom", Password = "12223" });
await context.SaveChangesAsync();
var service = CreateService(context);
var request = new RegisterRequestDto { Username = "Tom", Password = "123" };
await Assert.ThrowsAsync<BaseException>(() => service.RegisterAsync(request));
}
[Fact]
public async Task RegisterAsync_ShouldThrow_WhenMapperThrows()
{
var context = CreateDbContext();
var mapperMock = new Mock<IMapper>();
mapperMock.Setup(m => m.Map<User>(It.IsAny<RegisterRequestDto>()))
.Throws(new Exception("mapper failure"));
var service = CreateService(context, mapperMock.Object);
var req = new RegisterRequestDto { Username = "A", Password = "B" };
var ex = await Assert.ThrowsAsync<Exception>(() => service.RegisterAsync(req));
Assert.Contains("mapper failure", ex.Message);
}
[Fact]
public async Task RegisterAsync_ShouldPropagateSaveException_WhenSaveFails()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
// 使用自定义上下文在 SaveChanges 时抛异常
var throwingContext = new ThrowOnSaveImContext(options, throwOnSave: true);
var service = CreateService(throwingContext);
var req = new RegisterRequestDto { Username = "X", Password = "P" };
var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => service.RegisterAsync(req));
Assert.Contains("Simulated DB save error", ex.Message);
}
[Fact]
public async Task RegisterAsync_NullDto_ThrowsNullReferenceException_CurrentBehavior()
{
// 说明:当前实现没有对 dto 为 null 做检查,会触发 NullReferenceException。
// 建议:在生产代码中改为抛 ArgumentNullException 或者进行参数校验并返回明确错误。
var context = CreateDbContext();
var service = CreateService(context);
await Assert.ThrowsAsync<NullReferenceException>(async () =>
{
await service.RegisterAsync(null);
});
}
}
using AutoMapper;
using IM_API.Dtos.Auth;
using IM_API.Dtos.User;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
public class AuthServiceTests
{
// ---------- 辅助:创建独立的 InMemory DbContext ----------
private ImContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
var context = new ImContext(options);
return context;
}
// ---------- 可用于模拟 SaveChanges 抛异常的 DbContext ----------
private class ThrowOnSaveImContext : ImContext
{
private readonly bool _throw;
public ThrowOnSaveImContext(DbContextOptions<ImContext> options, bool throwOnSave) : base(options)
{
_throw = throwOnSave;
}
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
{
if (_throw) throw new InvalidOperationException("Simulated DB save error");
return base.SaveChangesAsync(cancellationToken);
}
}
// ---------- 默认 AutoMapper简易映射配置 ----------
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<RegisterRequestDto, User>();
cfg.CreateMap<User, UserInfoDto>();
});
return config.CreateMapper();
}
// ---------- 创建 Service允许注入自定义 mapper ----------
private AuthService CreateService(ImContext context, IMapper mapper = null)
{
var loggerMock = new Mock<ILogger<AuthService>>();
var mapperToUse = mapper ?? CreateMapper();
var mockCache = new Mock<ICacheService>();
return new AuthService(context, loggerMock.Object, mapperToUse,mockCache.Object);
}
// --------------------- 测试用例 ---------------------
[Fact]
public async Task LoginAsync_ShouldReturnUser_WhenValidCredentials()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 1, Username = "Tom", Password = "123456", NickName = "测试用户" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.LoginAsync(new LoginRequestDto
{
Username = "Tom",
Password = "123456"
});
Assert.NotNull(result);
Assert.Equal(1, result.Id);
Assert.Equal("Tom", result.Username);
}
[Fact]
public async Task LoginAsync_ShouldThrowException_WhenInvalidCredentials()
{
var context = CreateDbContext();
var service = CreateService(context);
await Assert.ThrowsAsync<BaseException>(async () =>
{
await service.LoginAsync(new LoginRequestDto
{
Username = "NotExist",
Password = "wrong"
});
});
}
[Fact]
public async Task LoginAsync_IsCaseSensitive_ForUsername()
{
// 说明:当前实现是精确匹配 => 区分大小写
var context = CreateDbContext();
context.Users.Add(new User { Id = 10, Username = "Tom", Password = "p" });
await context.SaveChangesAsync();
var service = CreateService(context);
// 使用小写用户名应失败(表明当前逻辑区分大小写)
await Assert.ThrowsAsync<BaseException>(async () =>
{
await service.LoginAsync(new LoginRequestDto { Username = "tom", Password = "p" });
});
}
[Fact]
public async Task RegisterAsync_ShouldPersistUserAndReturnDto_WhenNewUser()
{
var context = CreateDbContext();
var service = CreateService(context);
var request = new RegisterRequestDto
{
Username = "Jerry",
Password = "123456"
};
var result = await service.RegisterAsync(request);
// 返回值正确
Assert.NotNull(result);
Assert.Equal("Jerry", result.Username);
Assert.True(result.Id > 0);
// DB 中确实存在该用户
var persisted = await context.Users.FirstOrDefaultAsync(u => u.Username == "Jerry");
Assert.NotNull(persisted);
Assert.Equal("Jerry", persisted.Username);
}
[Fact]
public async Task RegisterAsync_ShouldThrowException_WhenUserExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Username = "Tom", Password = "12223" });
await context.SaveChangesAsync();
var service = CreateService(context);
var request = new RegisterRequestDto { Username = "Tom", Password = "123" };
await Assert.ThrowsAsync<BaseException>(() => service.RegisterAsync(request));
}
[Fact]
public async Task RegisterAsync_ShouldThrow_WhenMapperThrows()
{
var context = CreateDbContext();
var mapperMock = new Mock<IMapper>();
mapperMock.Setup(m => m.Map<User>(It.IsAny<RegisterRequestDto>()))
.Throws(new Exception("mapper failure"));
var service = CreateService(context, mapperMock.Object);
var req = new RegisterRequestDto { Username = "A", Password = "B" };
var ex = await Assert.ThrowsAsync<Exception>(() => service.RegisterAsync(req));
Assert.Contains("mapper failure", ex.Message);
}
[Fact]
public async Task RegisterAsync_ShouldPropagateSaveException_WhenSaveFails()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
// 使用自定义上下文在 SaveChanges 时抛异常
var throwingContext = new ThrowOnSaveImContext(options, throwOnSave: true);
var service = CreateService(throwingContext);
var req = new RegisterRequestDto { Username = "X", Password = "P" };
var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => service.RegisterAsync(req));
Assert.Contains("Simulated DB save error", ex.Message);
}
[Fact]
public async Task RegisterAsync_NullDto_ThrowsNullReferenceException_CurrentBehavior()
{
// 说明:当前实现没有对 dto 为 null 做检查,会触发 NullReferenceException。
// 建议:在生产代码中改为抛 ArgumentNullException 或者进行参数校验并返回明确错误。
var context = CreateDbContext();
var service = CreateService(context);
await Assert.ThrowsAsync<NullReferenceException>(async () =>
{
await service.RegisterAsync(null);
});
}
}

View File

@ -1,149 +1,149 @@
using AutoMapper;
using IM_API.Domain.Events;
using IM_API.Dtos.Friend;
using IM_API.Exceptions;
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()) // 确保每个测试数据库隔离
.Options;
return new ImContext(options);
}
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
// 补充你业务中实际需要的映射规则
cfg.CreateMap<Friend, FriendInfoDto>();
cfg.CreateMap<FriendRequestDto, FriendRequest>();
cfg.CreateMap<FriendRequest, Friend>()
.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)
{
// 注入 Mock 对象和真实的 Mapper/Context
return new FriendService(context, _mockLogger.Object, CreateMapper(), _mockEndpoint.Object);
}
#endregion
[Fact]
public async Task SendFriendRequestAsync_Success_ShouldSaveAndPublish()
{
// Arrange
var context = CreateDbContext();
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, FromUserId = 2, Description = "Hello" , RemarkName = "测试备注" };
// Act
//var result = await service.SendFriendRequestAsync(dto);
// Assert
//Assert.True(result);
//Assert.Single(context.FriendRequests);
// 验证事件是否发布到了 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_UserNotFound_ShouldThrow()
{
// Arrange
var context = CreateDbContext();
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, Password = "123", Username = "111" });
context.FriendRequests.Add(new FriendRequest
{
RequestUser = 1,
ResponseUser = 2,
State = (sbyte)FriendRequestState.Pending,
RemarkName = "测试备注"
});
await context.SaveChangesAsync();
var service = CreateService(context);
// 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,RemarkName = "测试备注" };
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,RemarkName = "111" },
new Friend { UserId = 1, FriendId = 3, StatusEnum = FriendStatus.Blocked,RemarkName = "222" }
);
await context.SaveChangesAsync();
var service = CreateService(context);
// Act
var result = await service.GetFriendListAsync(1, 1, 10, false);
// Assert
//Assert.Single(result); // 只应该拿到 Added 状态的
}
using AutoMapper;
using IM_API.Domain.Events;
using IM_API.Dtos.Friend;
using IM_API.Exceptions;
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()) // 确保每个测试数据库隔离
.Options;
return new ImContext(options);
}
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
// 补充你业务中实际需要的映射规则
cfg.CreateMap<Friend, FriendInfoDto>();
cfg.CreateMap<FriendRequestDto, FriendRequest>();
cfg.CreateMap<FriendRequest, Friend>()
.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)
{
// 注入 Mock 对象和真实的 Mapper/Context
return new FriendService(context, _mockLogger.Object, CreateMapper(), _mockEndpoint.Object);
}
#endregion
[Fact]
public async Task SendFriendRequestAsync_Success_ShouldSaveAndPublish()
{
// Arrange
var context = CreateDbContext();
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, FromUserId = 2, Description = "Hello" , RemarkName = "测试备注" };
// Act
//var result = await service.SendFriendRequestAsync(dto);
// Assert
//Assert.True(result);
//Assert.Single(context.FriendRequests);
// 验证事件是否发布到了 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_UserNotFound_ShouldThrow()
{
// Arrange
var context = CreateDbContext();
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, Password = "123", Username = "111" });
context.FriendRequests.Add(new FriendRequest
{
RequestUser = 1,
ResponseUser = 2,
State = (sbyte)FriendRequestState.Pending,
RemarkName = "测试备注"
});
await context.SaveChangesAsync();
var service = CreateService(context);
// 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,RemarkName = "测试备注" };
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,RemarkName = "111" },
new Friend { UserId = 1, FriendId = 3, StatusEnum = FriendStatus.Blocked,RemarkName = "222" }
);
await context.SaveChangesAsync();
var service = CreateService(context);
// Act
var result = await service.GetFriendListAsync(1, 1, 10, false);
// Assert
//Assert.Single(result); // 只应该拿到 Added 状态的
}
}

View File

@ -1,94 +1,94 @@
using AutoMapper;
using IM_API.Dtos.Group;
using IM_API.Models;
using IM_API.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using Xunit;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MassTransit;
using IM_API.Configs;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace IM_API.Tests.Services
{
public class GroupServiceTests
{
private readonly ImContext _context;
private readonly IMapper _mapper;
private readonly Mock<ILogger<GroupService>> _loggerMock = new();
private readonly Mock<IPublishEndpoint> _publishMock = new();
public GroupServiceTests()
{
// 1. 配置内存数据库
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
.Options;
_context = new ImContext(options);
// 2. 配置真实的 AutoMapper (ProjectTo 必须使用真实配置,不能用 Mock)
var config = new MapperConfiguration(cfg =>
{
// 替换为你项目中真实的 Profile 类名
cfg.AddProfile<MapperConfig>();
// 如果有多个 Profile可以继续添加或者加载整个程序集
// cfg.AddMaps(typeof(GroupProfile).Assembly);
});
_mapper = config.CreateMapper();
}
[Fact]
public async Task GetGroupList_ShouldReturnPagedAndOrderedData()
{
// Arrange (准备数据)
var userId = 1;
var groups = new List<Group>
{
new Group { Id = 101, Name = "Group A", Avatar = "1111" },
new Group { Id = 102, Name = "Group B" , Avatar = "1111"},
new Group { Id = 103, Name = "Group C", Avatar = "1111" }
};
_context.Groups.AddRange(groups);
_context.GroupMembers.AddRange(new List<GroupMember>
{
new GroupMember { UserId = userId, GroupId = 101 },
new GroupMember { UserId = userId, GroupId = 102 },
new GroupMember { UserId = userId, GroupId = 103 }
});
await _context.SaveChangesAsync();
var userService = new Mock<UserService>();
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object,userService.Object);
// Act (执行测试: 第1页每页2条倒序)
var result = await service.GetGroupListAsync(userId, page: 1, limit: 2, desc: true);
// Assert (断言)
Assert.NotNull(result);
Assert.Equal(2, result.Count);
Assert.Equal(103, result[0].Id); // 倒序最大的是 103
Assert.Equal(102, result[1].Id);
}
[Fact]
public async Task GetGroupList_ShouldReturnEmpty_WhenUserHasNoGroups()
{
var userSerivce = new Mock<UserService>();
// Arrange
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object, userSerivce.Object);
// Act
var result = await service.GetGroupListAsync(userId: 999, page: 1, limit: 10, desc: false);
// Assert
Assert.Empty(result);
}
}
using AutoMapper;
using IM_API.Dtos.Group;
using IM_API.Models;
using IM_API.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using Xunit;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MassTransit;
using IM_API.Configs;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace IM_API.Tests.Services
{
public class GroupServiceTests
{
private readonly ImContext _context;
private readonly IMapper _mapper;
private readonly Mock<ILogger<GroupService>> _loggerMock = new();
private readonly Mock<IPublishEndpoint> _publishMock = new();
public GroupServiceTests()
{
// 1. 配置内存数据库
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
.Options;
_context = new ImContext(options);
// 2. 配置真实的 AutoMapper (ProjectTo 必须使用真实配置,不能用 Mock)
var config = new MapperConfiguration(cfg =>
{
// 替换为你项目中真实的 Profile 类名
cfg.AddProfile<MapperConfig>();
// 如果有多个 Profile可以继续添加或者加载整个程序集
// cfg.AddMaps(typeof(GroupProfile).Assembly);
});
_mapper = config.CreateMapper();
}
[Fact]
public async Task GetGroupList_ShouldReturnPagedAndOrderedData()
{
// Arrange (准备数据)
var userId = 1;
var groups = new List<Group>
{
new Group { Id = 101, Name = "Group A", Avatar = "1111" },
new Group { Id = 102, Name = "Group B" , Avatar = "1111"},
new Group { Id = 103, Name = "Group C", Avatar = "1111" }
};
_context.Groups.AddRange(groups);
_context.GroupMembers.AddRange(new List<GroupMember>
{
new GroupMember { UserId = userId, GroupId = 101 },
new GroupMember { UserId = userId, GroupId = 102 },
new GroupMember { UserId = userId, GroupId = 103 }
});
await _context.SaveChangesAsync();
var userService = new Mock<UserService>();
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object,userService.Object);
// Act (执行测试: 第1页每页2条倒序)
var result = await service.GetGroupListAsync(userId, page: 1, limit: 2, desc: true);
// Assert (断言)
Assert.NotNull(result);
Assert.Equal(2, result.Count);
Assert.Equal(103, result[0].Id); // 倒序最大的是 103
Assert.Equal(102, result[1].Id);
}
[Fact]
public async Task GetGroupList_ShouldReturnEmpty_WhenUserHasNoGroups()
{
var userSerivce = new Mock<UserService>();
// Arrange
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object, userSerivce.Object);
// Act
var result = await service.GetGroupListAsync(userId: 999, page: 1, limit: 10, desc: false);
// Assert
Assert.Empty(result);
}
}
}

View File

@ -1,186 +1,186 @@
using AutoMapper;
using IM_API.Dtos.User;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using StackExchange.Redis;
using System;
using System.Threading.Tasks;
using Xunit;
public class UserServiceTests
{
private ImContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
return new ImContext(options);
}
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<User, UserInfoDto>();
cfg.CreateMap<UpdateUserDto, User>();
});
return config.CreateMapper();
}
private UserService CreateService(ImContext context)
{
var loggerMock = new Mock<ILogger<UserService>>();
var mapper = CreateMapper();
var mockCache = new Mock<ICacheService>();
var res = new Mock<IConnectionMultiplexer>();
return new UserService(context, loggerMock.Object, mapper , mockCache.Object, res.Object);
}
// ========== GetUserInfoAsync ==========
[Fact]
public async Task GetUserInfoAsync_ShouldReturnUser_WhenExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 1, Username = "Tom", Password = "123456" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.GetUserInfoAsync(1);
Assert.NotNull(result);
Assert.Equal("Tom", result.Username);
}
[Fact]
public async Task GetUserInfoAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.GetUserInfoAsync(999)
);
}
// ========== GetUserInfoByUsernameAsync ==========
[Fact]
public async Task GetUserInfoByUsernameAsync_ShouldReturn_WhenExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 2, Username = "Jerry", Password = "aaa" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.GetUserInfoByUsernameAsync("Jerry");
Assert.NotNull(result);
Assert.Equal(2, result.Id);
}
[Fact]
public async Task GetUserInfoByUsernameAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.GetUserInfoByUsernameAsync("Nobody")
);
}
// ========== ResetPasswordAsync ==========
[Fact]
public async Task ResetPasswordAsync_ShouldReset_WhenCorrectPassword()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 3, Username = "test", Password = "old" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.ResetPasswordAsync(3, "old", "new");
Assert.True(result);
Assert.Equal("new", context.Users.Find(3).Password);
}
[Fact]
public async Task ResetPasswordAsync_ShouldThrow_WhenWrongPassword()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 4, Username = "test", Password = "oldPwd" });
await context.SaveChangesAsync();
var service = CreateService(context);
await Assert.ThrowsAsync<BaseException>(() =>
service.ResetPasswordAsync(4, "wrong", "new")
);
}
[Fact]
public async Task ResetPasswordAsync_ShouldThrow_WhenUserNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.ResetPasswordAsync(123, "anything", "new")
);
}
// ========== UpdateOlineStatusAsync ==========
[Fact]
public async Task UpdateOlineStatusAsync_ShouldUpdateStatus()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 5, Username = "test", Password = "p", OnlineStatusEnum = UserOnlineStatus.Offline });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.UpdateOlineStatusAsync(5, UserOnlineStatus.Online);
Assert.True(result);
Assert.Equal(UserOnlineStatus.Online, context.Users.Find(5).OnlineStatusEnum);
}
[Fact]
public async Task UpdateOlineStatusAsync_ShouldThrow_WhenUserNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.UpdateOlineStatusAsync(999, UserOnlineStatus.Online)
);
}
// ========== UpdateUserAsync ==========
[Fact]
public async Task UpdateUserAsync_ShouldUpdateUserFields()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 6, Username = "test", Password = "p", NickName = "OldName" });
await context.SaveChangesAsync();
var service = CreateService(context);
var dto = new UpdateUserDto { NickName = "NewName" };
var result = await service.UpdateUserAsync(6, dto);
Assert.NotNull(result);
Assert.Equal("NewName", context.Users.Find(6).NickName);
}
[Fact]
public async Task UpdateUserAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.UpdateUserAsync(123, new UpdateUserDto { NickName = "Test" })
);
}
}
using AutoMapper;
using IM_API.Dtos.User;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Moq;
using StackExchange.Redis;
using System;
using System.Threading.Tasks;
using Xunit;
public class UserServiceTests
{
private ImContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
return new ImContext(options);
}
private IMapper CreateMapper()
{
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<User, UserInfoDto>();
cfg.CreateMap<UpdateUserDto, User>();
});
return config.CreateMapper();
}
private UserService CreateService(ImContext context)
{
var loggerMock = new Mock<ILogger<UserService>>();
var mapper = CreateMapper();
var mockCache = new Mock<ICacheService>();
var res = new Mock<IConnectionMultiplexer>();
return new UserService(context, loggerMock.Object, mapper , mockCache.Object, res.Object);
}
// ========== GetUserInfoAsync ==========
[Fact]
public async Task GetUserInfoAsync_ShouldReturnUser_WhenExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 1, Username = "Tom", Password = "123456" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.GetUserInfoAsync(1);
Assert.NotNull(result);
Assert.Equal("Tom", result.Username);
}
[Fact]
public async Task GetUserInfoAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.GetUserInfoAsync(999)
);
}
// ========== GetUserInfoByUsernameAsync ==========
[Fact]
public async Task GetUserInfoByUsernameAsync_ShouldReturn_WhenExists()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 2, Username = "Jerry", Password = "aaa" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.GetUserInfoByUsernameAsync("Jerry");
Assert.NotNull(result);
Assert.Equal(2, result.Id);
}
[Fact]
public async Task GetUserInfoByUsernameAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.GetUserInfoByUsernameAsync("Nobody")
);
}
// ========== ResetPasswordAsync ==========
[Fact]
public async Task ResetPasswordAsync_ShouldReset_WhenCorrectPassword()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 3, Username = "test", Password = "old" });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.ResetPasswordAsync(3, "old", "new");
Assert.True(result);
Assert.Equal("new", context.Users.Find(3).Password);
}
[Fact]
public async Task ResetPasswordAsync_ShouldThrow_WhenWrongPassword()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 4, Username = "test", Password = "oldPwd" });
await context.SaveChangesAsync();
var service = CreateService(context);
await Assert.ThrowsAsync<BaseException>(() =>
service.ResetPasswordAsync(4, "wrong", "new")
);
}
[Fact]
public async Task ResetPasswordAsync_ShouldThrow_WhenUserNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.ResetPasswordAsync(123, "anything", "new")
);
}
// ========== UpdateOlineStatusAsync ==========
[Fact]
public async Task UpdateOlineStatusAsync_ShouldUpdateStatus()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 5, Username = "test", Password = "p", OnlineStatusEnum = UserOnlineStatus.Offline });
await context.SaveChangesAsync();
var service = CreateService(context);
var result = await service.UpdateOlineStatusAsync(5, UserOnlineStatus.Online);
Assert.True(result);
Assert.Equal(UserOnlineStatus.Online, context.Users.Find(5).OnlineStatusEnum);
}
[Fact]
public async Task UpdateOlineStatusAsync_ShouldThrow_WhenUserNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.UpdateOlineStatusAsync(999, UserOnlineStatus.Online)
);
}
// ========== UpdateUserAsync ==========
[Fact]
public async Task UpdateUserAsync_ShouldUpdateUserFields()
{
var context = CreateDbContext();
context.Users.Add(new User { Id = 6, Username = "test", Password = "p", NickName = "OldName" });
await context.SaveChangesAsync();
var service = CreateService(context);
var dto = new UpdateUserDto { NickName = "NewName" };
var result = await service.UpdateUserAsync(6, dto);
Assert.NotNull(result);
Assert.Equal("NewName", context.Users.Find(6).NickName);
}
[Fact]
public async Task UpdateUserAsync_ShouldThrow_WhenNotFound()
{
var service = CreateService(CreateDbContext());
await Assert.ThrowsAsync<BaseException>(() =>
service.UpdateUserAsync(123, new UpdateUserDto { NickName = "Test" })
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,20 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

View File

@ -1,8 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -1,26 +1,26 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Jwt": {
"Key": "YourSuperSecretKey123456784124214190!",
"Issuer": "IMDemo",
"Audience": "IMClients",
"AccessTokenMinutes": 30,
"RefreshTokenDays": 30
},
"ConnectionStrings": {
"DefaultConnection": "Server=192.168.3.100;Port=3306;Database=IM;User=root;Password=13872911434Dyw@;",
"Redis": "192.168.3.100:6379"
},
"RabbitMQOptions": {
"Host": "192.168.5.100",
"Port": 5672,
"Username": "test",
"Password": "123456"
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Jwt": {
"Key": "YourSuperSecretKey123456784124214190!",
"Issuer": "IMDemo",
"Audience": "IMClients",
"AccessTokenMinutes": 30,
"RefreshTokenDays": 30
},
"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"
}
}

View File

@ -1,4 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]

View File

@ -1,23 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
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+77db20dc38eb89685ca73df4dd2758aa53aa6e0b")]
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
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+dc6ecf224df4e8714171e8b5d23afaa90b3a1f81")]
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。

View File

@ -1 +1 @@
6b62c789b9e1ecffdd986072b0521abee258fac28aa7e7d48b26a0309d21dc29
1b9e709aa84e0b4f6260cd10cf25bfc3a30c60e75a3966fc7d4cdf489eae898b

View File

@ -1,15 +1,15 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = IMTest
build_property.ProjectDir = C:\Users\nanxun\Documents\IM\backend\IMTest\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = IMTest
build_property.ProjectDir = C:\Users\nanxun\Documents\IM\backend\IMTest\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =

View File

@ -1,9 +1,9 @@
// <auto-generated/>
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;
// <auto-generated/>
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;

View File

@ -1 +1 @@
6e6df2b3d9fe8d3830882bef146134864f65ca58bc5ea4bac684eaec55cfd628
6e6df2b3d9fe8d3830882bef146134864f65ca58bc5ea4bac684eaec55cfd628

View File

@ -1,153 +1,153 @@
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\CoverletSourceRootsMapping_IMTest
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\testhost.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.deps.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.runtimeconfig.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\appsettings.Development.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\appsettings.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.staticwebassets.endpoints.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.exe
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\testhost.exe
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.reporters.netcoreapp10.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.utility.netcoreapp10.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.deps.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.runtimeconfig.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.pdb
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\AutoMapper.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\AutoMapper.Extensions.Microsoft.DependencyInjection.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Castle.Core.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.AspNetCore.Authentication.JwtBearer.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.CodeCoverage.Shim.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.InMemory.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.Relational.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.Memory.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.DependencyInjection.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Diagnostics.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Hosting.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Logging.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Logging.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.ObjectPool.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Options.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.JsonWebTokens.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Logging.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Protocols.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Tokens.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.OpenApi.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CoreUtilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.PlatformAbstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CommunicationUtilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CrossPlatEngine.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.Utilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.Common.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Moq.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\MySqlConnector.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Newtonsoft.Json.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\NuGet.Frameworks.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Pipelines.Sockets.Unofficial.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Pomelo.EntityFrameworkCore.MySql.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\StackExchange.Redis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.Swagger.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.SwaggerGen.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.SwaggerUI.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.IdentityModel.Tokens.Jwt.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.Net.WebSockets.WebSocketProtocol.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.assert.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.core.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.execution.dotnet.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.pdb
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.AssemblyReference.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.AssemblyInfoInputs.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.AssemblyInfo.cs
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.CoreCompileInputs.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.Up2Date
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.dll
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
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Bcl.AsyncInterfaces.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\RedLockNet.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\RedLockNet.SERedis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.StackExchangeRedis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Primitives.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.Diagnostics.DiagnosticSource.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\CoverletSourceRootsMapping_IMTest
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\testhost.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.deps.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.runtimeconfig.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\appsettings.Development.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\appsettings.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.staticwebassets.endpoints.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.exe
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\testhost.exe
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.reporters.netcoreapp10.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.runner.utility.netcoreapp10.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.deps.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.runtimeconfig.json
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IMTest.pdb
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\AutoMapper.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\AutoMapper.Extensions.Microsoft.DependencyInjection.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Castle.Core.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.AspNetCore.Authentication.JwtBearer.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.CodeCoverage.Shim.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.InMemory.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.EntityFrameworkCore.Relational.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.Memory.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.DependencyInjection.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Diagnostics.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Hosting.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Logging.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Logging.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.ObjectPool.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Options.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.JsonWebTokens.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Logging.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Protocols.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.IdentityModel.Tokens.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.OpenApi.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CoreUtilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.PlatformAbstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CommunicationUtilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.CrossPlatEngine.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.TestPlatform.Utilities.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.Common.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Moq.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\MySqlConnector.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Newtonsoft.Json.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\NuGet.Frameworks.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Pipelines.Sockets.Unofficial.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Pomelo.EntityFrameworkCore.MySql.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\StackExchange.Redis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.Swagger.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.SwaggerGen.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Swashbuckle.AspNetCore.SwaggerUI.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.IdentityModel.Tokens.Jwt.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.Net.WebSockets.WebSocketProtocol.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.assert.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.core.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\xunit.execution.dotnet.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.pdb
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.AssemblyReference.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.AssemblyInfoInputs.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.AssemblyInfo.cs
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.CoreCompileInputs.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.csproj.Up2Date
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\IMTest.dll
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
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Bcl.AsyncInterfaces.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\RedLockNet.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\RedLockNet.SERedis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.Abstractions.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Caching.StackExchangeRedis.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\Microsoft.Extensions.Primitives.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\System.Diagnostics.DiagnosticSource.dll

View File

@ -1 +1 @@
07435f2bd36dc0ae41e1e828c20bdeff31b846af84ec0e9fed50b185c0440047
07435f2bd36dc0ae41e1e828c20bdeff31b846af84ec0e9fed50b185c0440047

View File

@ -1,239 +1,239 @@
{
"format": 1,
"restore": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {}
},
"projects": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"projectName": "IMTest",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.EntityFrameworkCore.InMemory": {
"target": "Package",
"version": "[8.0.22, )"
},
"Microsoft.NET.Test.Sdk": {
"target": "Package",
"version": "[17.8.0, )"
},
"Moq": {
"target": "Package",
"version": "[4.20.72, )"
},
"coverlet.collector": {
"target": "Package",
"version": "[6.0.0, )"
},
"xunit": {
"target": "Package",
"version": "[2.5.3, )"
},
"xunit.runner.visualstudio": {
"target": "Package",
"version": "[2.5.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"projectName": "IM_API",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"AutoMapper": {
"target": "Package",
"version": "[12.0.1, )"
},
"AutoMapper.Extensions.Microsoft.DependencyInjection": {
"target": "Package",
"version": "[12.0.0, )"
},
"MassTransit.RabbitMQ": {
"target": "Package",
"version": "[8.5.5, )"
},
"Microsoft.AspNetCore.Authentication.JwtBearer": {
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.AspNetCore.SignalR": {
"target": "Package",
"version": "[1.2.0, )"
},
"Microsoft.EntityFrameworkCore.Design": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.EntityFrameworkCore.Tools": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.Extensions.Caching.StackExchangeRedis": {
"target": "Package",
"version": "[10.0.2, )"
},
"Microsoft.VisualStudio.Azure.Containers.Tools.Targets": {
"target": "Package",
"version": "[1.22.1, )"
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[13.0.4, )"
},
"Pomelo.EntityFrameworkCore.MySql": {
"target": "Package",
"version": "[8.0.3, )"
},
"RedLock.net": {
"target": "Package",
"version": "[2.3.2, )"
},
"StackExchange.Redis": {
"target": "Package",
"version": "[2.9.32, )"
},
"Swashbuckle.AspNetCore": {
"target": "Package",
"version": "[6.6.2, )"
},
"System.IdentityModel.Tokens.Jwt": {
"target": "Package",
"version": "[8.14.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
}
}
{
"format": 1,
"restore": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {}
},
"projects": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"projectName": "IMTest",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.EntityFrameworkCore.InMemory": {
"target": "Package",
"version": "[8.0.22, )"
},
"Microsoft.NET.Test.Sdk": {
"target": "Package",
"version": "[17.8.0, )"
},
"Moq": {
"target": "Package",
"version": "[4.20.72, )"
},
"coverlet.collector": {
"target": "Package",
"version": "[6.0.0, )"
},
"xunit": {
"target": "Package",
"version": "[2.5.3, )"
},
"xunit.runner.visualstudio": {
"target": "Package",
"version": "[2.5.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"projectName": "IM_API",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.300"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"AutoMapper": {
"target": "Package",
"version": "[12.0.1, )"
},
"AutoMapper.Extensions.Microsoft.DependencyInjection": {
"target": "Package",
"version": "[12.0.0, )"
},
"MassTransit.RabbitMQ": {
"target": "Package",
"version": "[8.5.5, )"
},
"Microsoft.AspNetCore.Authentication.JwtBearer": {
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.AspNetCore.SignalR": {
"target": "Package",
"version": "[1.2.0, )"
},
"Microsoft.EntityFrameworkCore.Design": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.EntityFrameworkCore.Tools": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[8.0.21, )"
},
"Microsoft.Extensions.Caching.StackExchangeRedis": {
"target": "Package",
"version": "[10.0.2, )"
},
"Microsoft.VisualStudio.Azure.Containers.Tools.Targets": {
"target": "Package",
"version": "[1.22.1, )"
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[13.0.4, )"
},
"Pomelo.EntityFrameworkCore.MySql": {
"target": "Package",
"version": "[8.0.3, )"
},
"RedLock.net": {
"target": "Package",
"version": "[2.3.2, )"
},
"StackExchange.Redis": {
"target": "Package",
"version": "[2.9.32, )"
},
"Swashbuckle.AspNetCore": {
"target": "Package",
"version": "[6.6.2, )"
},
"System.IdentityModel.Tokens.Jwt": {
"target": "Package",
"version": "[8.14.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -1,29 +1,29 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<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)' == '' ">6.14.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\nanxun\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.runner.visualstudio\2.5.3\build\net6.0\xunit.runner.visualstudio.props" Condition="Exists('$(NuGetPackageRoot)xunit.runner.visualstudio\2.5.3\build\net6.0\xunit.runner.visualstudio.props')" />
<Import Project="$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.props" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.22\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props" Condition="Exists('$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.22\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Pkgxunit_analyzers Condition=" '$(Pkgxunit_analyzers)' == '' ">C:\Users\nanxun\.nuget\packages\xunit.analyzers\1.4.0</Pkgxunit_analyzers>
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\nanxun\.nuget\packages\microsoft.extensions.apidescription.server\6.0.5</PkgMicrosoft_Extensions_ApiDescription_Server>
<PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets Condition=" '$(PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets)' == '' ">C:\Users\nanxun\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.22.1</PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<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)' == '' ">6.14.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\nanxun\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.runner.visualstudio\2.5.3\build\net6.0\xunit.runner.visualstudio.props" Condition="Exists('$(NuGetPackageRoot)xunit.runner.visualstudio\2.5.3\build\net6.0\xunit.runner.visualstudio.props')" />
<Import Project="$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.props" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.22\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props" Condition="Exists('$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.22\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Pkgxunit_analyzers Condition=" '$(Pkgxunit_analyzers)' == '' ">C:\Users\nanxun\.nuget\packages\xunit.analyzers\1.4.0</Pkgxunit_analyzers>
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\nanxun\.nuget\packages\microsoft.extensions.apidescription.server\6.0.5</PkgMicrosoft_Extensions_ApiDescription_Server>
<PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets Condition=" '$(PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets)' == '' ">C:\Users\nanxun\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.22.1</PkgMicrosoft_VisualStudio_Azure_Containers_Tools_Targets>
</PropertyGroup>
</Project>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.targets" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Logging.Abstractions.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.options\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Options.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.options\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Options.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets')" />
<Import Project="$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets')" />
</ImportGroup>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.targets" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.5.3\build\xunit.core.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Logging.Abstractions.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.options\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Options.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.options\10.0.2\buildTransitive\net8.0\Microsoft.Extensions.Options.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets')" />
<Import Project="$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets')" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,176 +1,176 @@
{
"version": 2,
"dgSpecHash": "ueA0djhC8vQ=",
"success": true,
"projectFilePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"expectedPackageFiles": [
"C:\\Users\\nanxun\\.nuget\\packages\\automapper\\12.0.1\\automapper.12.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\automapper.extensions.microsoft.dependencyinjection\\12.0.0\\automapper.extensions.microsoft.dependencyinjection.12.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\castle.core\\5.1.1\\castle.core.5.1.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\coverlet.collector\\6.0.0\\coverlet.collector.6.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit\\8.5.5\\masstransit.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit.abstractions\\8.5.5\\masstransit.abstractions.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit.rabbitmq\\8.5.5\\masstransit.rabbitmq.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authentication.abstractions\\2.3.0\\microsoft.aspnetcore.authentication.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\8.0.21\\microsoft.aspnetcore.authentication.jwtbearer.8.0.21.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authorization\\2.3.0\\microsoft.aspnetcore.authorization.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authorization.policy\\2.3.0\\microsoft.aspnetcore.authorization.policy.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.connections.abstractions\\2.3.0\\microsoft.aspnetcore.connections.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.hosting.abstractions\\2.3.0\\microsoft.aspnetcore.hosting.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.hosting.server.abstractions\\2.3.0\\microsoft.aspnetcore.hosting.server.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http\\2.3.0\\microsoft.aspnetcore.http.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.abstractions\\2.3.0\\microsoft.aspnetcore.http.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.connections\\1.2.0\\microsoft.aspnetcore.http.connections.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.connections.common\\1.2.0\\microsoft.aspnetcore.http.connections.common.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.extensions\\2.3.0\\microsoft.aspnetcore.http.extensions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.features\\2.3.0\\microsoft.aspnetcore.http.features.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.routing\\2.3.0\\microsoft.aspnetcore.routing.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.routing.abstractions\\2.3.0\\microsoft.aspnetcore.routing.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr\\1.2.0\\microsoft.aspnetcore.signalr.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.common\\1.2.0\\microsoft.aspnetcore.signalr.common.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.core\\1.2.0\\microsoft.aspnetcore.signalr.core.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.protocols.json\\1.2.0\\microsoft.aspnetcore.signalr.protocols.json.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.websockets\\2.3.0\\microsoft.aspnetcore.websockets.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.webutilities\\2.3.0\\microsoft.aspnetcore.webutilities.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.0\\microsoft.bcl.asyncinterfaces.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.codecoverage\\17.8.0\\microsoft.codecoverage.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore\\8.0.22\\microsoft.entityframeworkcore.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.abstractions\\8.0.22\\microsoft.entityframeworkcore.abstractions.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\8.0.22\\microsoft.entityframeworkcore.analyzers.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.inmemory\\8.0.22\\microsoft.entityframeworkcore.inmemory.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\8.0.13\\microsoft.entityframeworkcore.relational.8.0.13.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.apidescription.server\\6.0.5\\microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\10.0.2\\microsoft.extensions.caching.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.memory\\8.0.1\\microsoft.extensions.caching.memory.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.stackexchangeredis\\10.0.2\\microsoft.extensions.caching.stackexchangeredis.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.configuration.abstractions\\8.0.0\\microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\8.0.1\\microsoft.extensions.dependencyinjection.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\10.0.2\\microsoft.extensions.dependencyinjection.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.abstractions\\8.0.1\\microsoft.extensions.diagnostics.abstractions.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.healthchecks\\8.0.0\\microsoft.extensions.diagnostics.healthchecks.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.healthchecks.abstractions\\8.0.0\\microsoft.extensions.diagnostics.healthchecks.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.fileproviders.abstractions\\8.0.0\\microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.hosting.abstractions\\8.0.1\\microsoft.extensions.hosting.abstractions.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.logging\\8.0.1\\microsoft.extensions.logging.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\10.0.2\\microsoft.extensions.logging.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.objectpool\\8.0.11\\microsoft.extensions.objectpool.8.0.11.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.options\\10.0.2\\microsoft.extensions.options.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.primitives\\10.0.2\\microsoft.extensions.primitives.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.14.0\\microsoft.identitymodel.abstractions.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.14.0\\microsoft.identitymodel.jsonwebtokens.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.logging\\8.14.0\\microsoft.identitymodel.logging.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.1.2\\microsoft.identitymodel.protocols.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.1.2\\microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.14.0\\microsoft.identitymodel.tokens.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.net.http.headers\\2.3.0\\microsoft.net.http.headers.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.net.test.sdk\\17.8.0\\microsoft.net.test.sdk.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.openapi\\1.6.14\\microsoft.openapi.1.6.14.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.testplatform.objectmodel\\17.8.0\\microsoft.testplatform.objectmodel.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.testplatform.testhost\\17.8.0\\microsoft.testplatform.testhost.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.visualstudio.azure.containers.tools.targets\\1.22.1\\microsoft.visualstudio.azure.containers.tools.targets.1.22.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.win32.primitives\\4.3.0\\microsoft.win32.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\moq\\4.20.72\\moq.4.20.72.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\mysqlconnector\\2.3.5\\mysqlconnector.2.3.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\netstandard.library\\1.6.1\\netstandard.library.1.6.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\newtonsoft.json\\13.0.4\\newtonsoft.json.13.0.4.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\nuget.frameworks\\6.5.0\\nuget.frameworks.6.5.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\pipelines.sockets.unofficial\\2.2.8\\pipelines.sockets.unofficial.2.2.8.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\pomelo.entityframeworkcore.mysql\\8.0.3\\pomelo.entityframeworkcore.mysql.8.0.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\rabbitmq.client\\7.1.2\\rabbitmq.client.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\redlock.net\\2.3.2\\redlock.net.2.3.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system\\4.3.0\\runtime.native.system.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.io.compression\\4.3.0\\runtime.native.system.io.compression.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.net.http\\4.3.0\\runtime.native.system.net.http.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\stackexchange.redis\\2.9.32\\stackexchange.redis.2.9.32.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore\\6.6.2\\swashbuckle.aspnetcore.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swagger\\6.6.2\\swashbuckle.aspnetcore.swagger.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swaggergen\\6.6.2\\swashbuckle.aspnetcore.swaggergen.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swaggerui\\6.6.2\\swashbuckle.aspnetcore.swaggerui.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.appcontext\\4.3.0\\system.appcontext.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.buffers\\4.6.0\\system.buffers.4.6.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.collections.concurrent\\4.3.0\\system.collections.concurrent.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.console\\4.3.0\\system.console.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.debug\\4.3.0\\system.diagnostics.debug.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.diagnosticsource\\10.0.2\\system.diagnostics.diagnosticsource.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.eventlog\\6.0.0\\system.diagnostics.eventlog.6.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.tools\\4.3.0\\system.diagnostics.tools.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.tracing\\4.3.0\\system.diagnostics.tracing.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization.calendars\\4.3.0\\system.globalization.calendars.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization.extensions\\4.3.0\\system.globalization.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.14.0\\system.identitymodel.tokens.jwt.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.compression\\4.3.0\\system.io.compression.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.compression.zipfile\\4.3.0\\system.io.compression.zipfile.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.filesystem\\4.3.0\\system.io.filesystem.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.filesystem.primitives\\4.3.0\\system.io.filesystem.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.pipelines\\8.0.0\\system.io.pipelines.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.linq\\4.3.0\\system.linq.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.linq.expressions\\4.3.0\\system.linq.expressions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.http\\4.3.0\\system.net.http.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.primitives\\4.3.0\\system.net.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.sockets\\4.3.0\\system.net.sockets.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.websockets.websocketprotocol\\5.1.0\\system.net.websockets.websocketprotocol.5.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.objectmodel\\4.3.0\\system.objectmodel.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit\\4.7.0\\system.reflection.emit.4.7.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit.ilgeneration\\4.3.0\\system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit.lightweight\\4.3.0\\system.reflection.emit.lightweight.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.extensions\\4.3.0\\system.reflection.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.metadata\\1.6.0\\system.reflection.metadata.1.6.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.typeextensions\\4.3.0\\system.reflection.typeextensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.handles\\4.3.0\\system.runtime.handles.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.interopservices\\4.3.0\\system.runtime.interopservices.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.interopservices.runtimeinformation\\4.3.0\\system.runtime.interopservices.runtimeinformation.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.numerics\\4.3.0\\system.runtime.numerics.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.algorithms\\4.3.0\\system.security.cryptography.algorithms.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.cng\\4.3.0\\system.security.cryptography.cng.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.csp\\4.3.0\\system.security.cryptography.csp.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.encoding\\4.3.0\\system.security.cryptography.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.openssl\\4.3.0\\system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.primitives\\4.3.0\\system.security.cryptography.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.x509certificates\\4.3.0\\system.security.cryptography.x509certificates.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encoding.extensions\\4.3.0\\system.text.encoding.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encodings.web\\8.0.0\\system.text.encodings.web.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading\\4.3.0\\system.threading.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.channels\\8.0.0\\system.threading.channels.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.ratelimiting\\8.0.0\\system.threading.ratelimiting.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.tasks.extensions\\4.3.0\\system.threading.tasks.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.timer\\4.3.0\\system.threading.timer.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.xml.readerwriter\\4.3.0\\system.xml.readerwriter.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.xml.xdocument\\4.3.0\\system.xml.xdocument.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit\\2.5.3\\xunit.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.abstractions\\2.0.3\\xunit.abstractions.2.0.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.analyzers\\1.4.0\\xunit.analyzers.1.4.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.assert\\2.5.3\\xunit.assert.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.core\\2.5.3\\xunit.core.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.extensibility.core\\2.5.3\\xunit.extensibility.core.2.5.3.nupkg.sha512",
"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": []
{
"version": 2,
"dgSpecHash": "ueA0djhC8vQ=",
"success": true,
"projectFilePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"expectedPackageFiles": [
"C:\\Users\\nanxun\\.nuget\\packages\\automapper\\12.0.1\\automapper.12.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\automapper.extensions.microsoft.dependencyinjection\\12.0.0\\automapper.extensions.microsoft.dependencyinjection.12.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\castle.core\\5.1.1\\castle.core.5.1.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\coverlet.collector\\6.0.0\\coverlet.collector.6.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit\\8.5.5\\masstransit.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit.abstractions\\8.5.5\\masstransit.abstractions.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\masstransit.rabbitmq\\8.5.5\\masstransit.rabbitmq.8.5.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authentication.abstractions\\2.3.0\\microsoft.aspnetcore.authentication.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\8.0.21\\microsoft.aspnetcore.authentication.jwtbearer.8.0.21.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authorization\\2.3.0\\microsoft.aspnetcore.authorization.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.authorization.policy\\2.3.0\\microsoft.aspnetcore.authorization.policy.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.connections.abstractions\\2.3.0\\microsoft.aspnetcore.connections.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.hosting.abstractions\\2.3.0\\microsoft.aspnetcore.hosting.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.hosting.server.abstractions\\2.3.0\\microsoft.aspnetcore.hosting.server.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http\\2.3.0\\microsoft.aspnetcore.http.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.abstractions\\2.3.0\\microsoft.aspnetcore.http.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.connections\\1.2.0\\microsoft.aspnetcore.http.connections.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.connections.common\\1.2.0\\microsoft.aspnetcore.http.connections.common.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.extensions\\2.3.0\\microsoft.aspnetcore.http.extensions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.http.features\\2.3.0\\microsoft.aspnetcore.http.features.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.routing\\2.3.0\\microsoft.aspnetcore.routing.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.routing.abstractions\\2.3.0\\microsoft.aspnetcore.routing.abstractions.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr\\1.2.0\\microsoft.aspnetcore.signalr.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.common\\1.2.0\\microsoft.aspnetcore.signalr.common.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.core\\1.2.0\\microsoft.aspnetcore.signalr.core.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.signalr.protocols.json\\1.2.0\\microsoft.aspnetcore.signalr.protocols.json.1.2.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.websockets\\2.3.0\\microsoft.aspnetcore.websockets.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.aspnetcore.webutilities\\2.3.0\\microsoft.aspnetcore.webutilities.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.0\\microsoft.bcl.asyncinterfaces.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.codecoverage\\17.8.0\\microsoft.codecoverage.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore\\8.0.22\\microsoft.entityframeworkcore.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.abstractions\\8.0.22\\microsoft.entityframeworkcore.abstractions.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\8.0.22\\microsoft.entityframeworkcore.analyzers.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.inmemory\\8.0.22\\microsoft.entityframeworkcore.inmemory.8.0.22.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\8.0.13\\microsoft.entityframeworkcore.relational.8.0.13.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.apidescription.server\\6.0.5\\microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\10.0.2\\microsoft.extensions.caching.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.memory\\8.0.1\\microsoft.extensions.caching.memory.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.caching.stackexchangeredis\\10.0.2\\microsoft.extensions.caching.stackexchangeredis.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.configuration.abstractions\\8.0.0\\microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\8.0.1\\microsoft.extensions.dependencyinjection.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\10.0.2\\microsoft.extensions.dependencyinjection.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.abstractions\\8.0.1\\microsoft.extensions.diagnostics.abstractions.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.healthchecks\\8.0.0\\microsoft.extensions.diagnostics.healthchecks.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.diagnostics.healthchecks.abstractions\\8.0.0\\microsoft.extensions.diagnostics.healthchecks.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.fileproviders.abstractions\\8.0.0\\microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.hosting.abstractions\\8.0.1\\microsoft.extensions.hosting.abstractions.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.logging\\8.0.1\\microsoft.extensions.logging.8.0.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\10.0.2\\microsoft.extensions.logging.abstractions.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.objectpool\\8.0.11\\microsoft.extensions.objectpool.8.0.11.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.options\\10.0.2\\microsoft.extensions.options.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.extensions.primitives\\10.0.2\\microsoft.extensions.primitives.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.14.0\\microsoft.identitymodel.abstractions.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.14.0\\microsoft.identitymodel.jsonwebtokens.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.logging\\8.14.0\\microsoft.identitymodel.logging.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.1.2\\microsoft.identitymodel.protocols.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.1.2\\microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.14.0\\microsoft.identitymodel.tokens.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.net.http.headers\\2.3.0\\microsoft.net.http.headers.2.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.net.test.sdk\\17.8.0\\microsoft.net.test.sdk.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.openapi\\1.6.14\\microsoft.openapi.1.6.14.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.testplatform.objectmodel\\17.8.0\\microsoft.testplatform.objectmodel.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.testplatform.testhost\\17.8.0\\microsoft.testplatform.testhost.17.8.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.visualstudio.azure.containers.tools.targets\\1.22.1\\microsoft.visualstudio.azure.containers.tools.targets.1.22.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\microsoft.win32.primitives\\4.3.0\\microsoft.win32.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\moq\\4.20.72\\moq.4.20.72.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\mysqlconnector\\2.3.5\\mysqlconnector.2.3.5.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\netstandard.library\\1.6.1\\netstandard.library.1.6.1.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\newtonsoft.json\\13.0.4\\newtonsoft.json.13.0.4.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\nuget.frameworks\\6.5.0\\nuget.frameworks.6.5.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\pipelines.sockets.unofficial\\2.2.8\\pipelines.sockets.unofficial.2.2.8.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\pomelo.entityframeworkcore.mysql\\8.0.3\\pomelo.entityframeworkcore.mysql.8.0.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\rabbitmq.client\\7.1.2\\rabbitmq.client.7.1.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\redlock.net\\2.3.2\\redlock.net.2.3.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system\\4.3.0\\runtime.native.system.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.io.compression\\4.3.0\\runtime.native.system.io.compression.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.net.http\\4.3.0\\runtime.native.system.net.http.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\stackexchange.redis\\2.9.32\\stackexchange.redis.2.9.32.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore\\6.6.2\\swashbuckle.aspnetcore.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swagger\\6.6.2\\swashbuckle.aspnetcore.swagger.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swaggergen\\6.6.2\\swashbuckle.aspnetcore.swaggergen.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\swashbuckle.aspnetcore.swaggerui\\6.6.2\\swashbuckle.aspnetcore.swaggerui.6.6.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.appcontext\\4.3.0\\system.appcontext.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.buffers\\4.6.0\\system.buffers.4.6.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.collections.concurrent\\4.3.0\\system.collections.concurrent.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.console\\4.3.0\\system.console.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.debug\\4.3.0\\system.diagnostics.debug.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.diagnosticsource\\10.0.2\\system.diagnostics.diagnosticsource.10.0.2.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.eventlog\\6.0.0\\system.diagnostics.eventlog.6.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.tools\\4.3.0\\system.diagnostics.tools.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.diagnostics.tracing\\4.3.0\\system.diagnostics.tracing.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization.calendars\\4.3.0\\system.globalization.calendars.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.globalization.extensions\\4.3.0\\system.globalization.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.14.0\\system.identitymodel.tokens.jwt.8.14.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.compression\\4.3.0\\system.io.compression.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.compression.zipfile\\4.3.0\\system.io.compression.zipfile.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.filesystem\\4.3.0\\system.io.filesystem.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.filesystem.primitives\\4.3.0\\system.io.filesystem.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.io.pipelines\\8.0.0\\system.io.pipelines.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.linq\\4.3.0\\system.linq.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.linq.expressions\\4.3.0\\system.linq.expressions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.http\\4.3.0\\system.net.http.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.primitives\\4.3.0\\system.net.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.sockets\\4.3.0\\system.net.sockets.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.net.websockets.websocketprotocol\\5.1.0\\system.net.websockets.websocketprotocol.5.1.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.objectmodel\\4.3.0\\system.objectmodel.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit\\4.7.0\\system.reflection.emit.4.7.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit.ilgeneration\\4.3.0\\system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.emit.lightweight\\4.3.0\\system.reflection.emit.lightweight.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.extensions\\4.3.0\\system.reflection.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.metadata\\1.6.0\\system.reflection.metadata.1.6.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.reflection.typeextensions\\4.3.0\\system.reflection.typeextensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.handles\\4.3.0\\system.runtime.handles.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.interopservices\\4.3.0\\system.runtime.interopservices.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.interopservices.runtimeinformation\\4.3.0\\system.runtime.interopservices.runtimeinformation.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.runtime.numerics\\4.3.0\\system.runtime.numerics.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.algorithms\\4.3.0\\system.security.cryptography.algorithms.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.cng\\4.3.0\\system.security.cryptography.cng.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.csp\\4.3.0\\system.security.cryptography.csp.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.encoding\\4.3.0\\system.security.cryptography.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.openssl\\4.3.0\\system.security.cryptography.openssl.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.primitives\\4.3.0\\system.security.cryptography.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.security.cryptography.x509certificates\\4.3.0\\system.security.cryptography.x509certificates.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encoding.extensions\\4.3.0\\system.text.encoding.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.encodings.web\\8.0.0\\system.text.encodings.web.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading\\4.3.0\\system.threading.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.channels\\8.0.0\\system.threading.channels.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.ratelimiting\\8.0.0\\system.threading.ratelimiting.8.0.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.tasks.extensions\\4.3.0\\system.threading.tasks.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.threading.timer\\4.3.0\\system.threading.timer.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.xml.readerwriter\\4.3.0\\system.xml.readerwriter.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\system.xml.xdocument\\4.3.0\\system.xml.xdocument.4.3.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit\\2.5.3\\xunit.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.abstractions\\2.0.3\\xunit.abstractions.2.0.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.analyzers\\1.4.0\\xunit.analyzers.1.4.0.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.assert\\2.5.3\\xunit.assert.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.core\\2.5.3\\xunit.core.2.5.3.nupkg.sha512",
"C:\\Users\\nanxun\\.nuget\\packages\\xunit.extensibility.core\\2.5.3\\xunit.extensibility.core.2.5.3.nupkg.sha512",
"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": []
}

View File

@ -1,30 +1,30 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**

View File

@ -1,3 +1,3 @@
bin/
obj/
bin/
obj/
.vs/

View File

@ -1,20 +1,20 @@
using IM_API.Models;
namespace IM_API.Aggregate
{
public class FriendRequestAggregate
{
public Friend Friend { get; private set; }
public FriendRequest FriendRequest { get; private set; }
public FriendRequestAggregate() { }
public FriendRequestAggregate(Friend friend,FriendRequest friendRequest)
{
Friend = friend;
FriendRequest = friendRequest;
}
public void Accept(string? remarkName = null)
{
}
}
}
using IM_API.Models;
namespace IM_API.Aggregate
{
public class FriendRequestAggregate
{
public Friend Friend { get; private set; }
public FriendRequest FriendRequest { get; private set; }
public FriendRequestAggregate() { }
public FriendRequestAggregate(Friend friend,FriendRequest friendRequest)
{
Friend = friend;
FriendRequest = friendRequest;
}
public void Accept(string? remarkName = null)
{
}
}
}

View File

@ -1,23 +1,23 @@
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddConversationHandler : IConsumer<FriendAddEvent>
{
private readonly IConversationService _cService;
public FriendAddConversationHandler(IConversationService cService)
{
_cService = cService;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
await _cService.MakeConversationAsync(@event.RequestUserId, @event.ResponseUserId, Models.ChatType.PRIVATE);
await _cService.MakeConversationAsync(@event.ResponseUserId, @event.RequestUserId, Models.ChatType.PRIVATE);
}
}
}
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddConversationHandler : IConsumer<FriendAddEvent>
{
private readonly IConversationService _cService;
public FriendAddConversationHandler(IConversationService cService)
{
_cService = cService;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
await _cService.MakeConversationAsync(@event.RequestUserId, @event.ResponseUserId, Models.ChatType.PRIVATE);
await _cService.MakeConversationAsync(@event.ResponseUserId, @event.RequestUserId, Models.ChatType.PRIVATE);
}
}
}

View File

@ -1,29 +1,29 @@
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddDBHandler : IConsumer<FriendAddEvent>
{
private readonly IFriendSerivce _friendService;
private readonly ILogger<FriendAddDBHandler> _logger;
public FriendAddDBHandler(IFriendSerivce friendService, ILogger<FriendAddDBHandler> logger)
{
_friendService = friendService;
_logger = logger;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
//为请求发起人添加好友记录
await _friendService.MakeFriendshipAsync(
@event.RequestUserId, @event.ResponseUserId, @event.RequestInfo.RemarkName);
//为接收人添加好友记录
await _friendService.MakeFriendshipAsync(
@event.ResponseUserId, @event.RequestUserId, @event.requestUserRemarkname);
}
}
}
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddDBHandler : IConsumer<FriendAddEvent>
{
private readonly IFriendSerivce _friendService;
private readonly ILogger<FriendAddDBHandler> _logger;
public FriendAddDBHandler(IFriendSerivce friendService, ILogger<FriendAddDBHandler> logger)
{
_friendService = friendService;
_logger = logger;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
//为请求发起人添加好友记录
await _friendService.MakeFriendshipAsync(
@event.RequestUserId, @event.ResponseUserId, @event.RequestInfo.RemarkName);
//为接收人添加好友记录
await _friendService.MakeFriendshipAsync(
@event.ResponseUserId, @event.RequestUserId, @event.requestUserRemarkname);
}
}
}

View File

@ -1,37 +1,37 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Interface.Services;
using IM_API.Models;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddSignalRHandler : IConsumer<FriendAddEvent>
{
private readonly IHubContext<ChatHub> _chathub;
public FriendAddSignalRHandler(IHubContext<ChatHub> chathub)
{
_chathub = chathub;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
var usersList = new List<string> {
@event.RequestUserId.ToString(), @event.ResponseUserId.ToString()
};
var res = new HubResponse<MessageBaseDto>("Event", new MessageBaseDto()
{
ChatType = ChatType.PRIVATE,
Content = "您有新的好友关系已添加",
//MsgId = @event.EventId.ToString(),
ReceiverId = @event.ResponseUserId,
SenderId = @event.RequestUserId,
TimeStamp = DateTime.Now
});
await _chathub.Clients.Users(usersList).SendAsync("ReceiveMessage", res);
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Interface.Services;
using IM_API.Models;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.FriendAddHandler
{
public class FriendAddSignalRHandler : IConsumer<FriendAddEvent>
{
private readonly IHubContext<ChatHub> _chathub;
public FriendAddSignalRHandler(IHubContext<ChatHub> chathub)
{
_chathub = chathub;
}
public async Task Consume(ConsumeContext<FriendAddEvent> context)
{
var @event = context.Message;
var usersList = new List<string> {
@event.RequestUserId.ToString(), @event.ResponseUserId.ToString()
};
var res = new HubResponse<MessageBaseDto>("Event", new MessageBaseDto()
{
ChatType = ChatType.PRIVATE,
Content = "您有新的好友关系已添加",
//MsgId = @event.EventId.ToString(),
ReceiverId = @event.ResponseUserId,
SenderId = @event.RequestUserId,
TimeStamp = DateTime.Now
});
await _chathub.Clients.Users(usersList).SendAsync("ReceiveMessage", res);
}
}
}

View File

@ -1,24 +1,24 @@
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
{
public class RequestDbHandler : IConsumer<GroupInviteActionUpdateEvent>
{
private readonly IGroupService _groupService;
public RequestDbHandler(IGroupService groupService)
{
_groupService = groupService;
}
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupInviteState.Passed)
{
await _groupService.MakeGroupRequestAsync(@event.UserId, @event.InviteUserId,@event.GroupId);
}
}
}
}
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
{
public class RequestDbHandler : IConsumer<GroupInviteActionUpdateEvent>
{
private readonly IGroupService _groupService;
public RequestDbHandler(IGroupService groupService)
{
_groupService = groupService;
}
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupInviteState.Passed)
{
await _groupService.MakeGroupRequestAsync(@event.UserId, @event.InviteUserId,@event.GroupId);
}
}
}
}

View File

@ -1,34 +1,34 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
{
public class SignalRHandler : IConsumer<GroupInviteActionUpdateEvent>
{
private IHubContext<ChatHub> _hub;
public SignalRHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
{
var @event = context.Message;
var msg = new HubResponse<GroupInviteActionUpdateVo>("Event", new GroupInviteActionUpdateVo
{
Action = @event.Action,
GroupId = @event.GroupId,
InvitedUserId = @event.UserId,
InviteUserId = @event.InviteUserId,
InviteId = @event.InviteId
});
await _hub.Clients.Users([@event.UserId.ToString(), @event.InviteUserId.ToString()])
.SendAsync("ReceiveMessage",msg);
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
{
public class SignalRHandler : IConsumer<GroupInviteActionUpdateEvent>
{
private IHubContext<ChatHub> _hub;
public SignalRHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
{
var @event = context.Message;
var msg = new HubResponse<GroupInviteActionUpdateVo>("Event", new GroupInviteActionUpdateVo
{
Action = @event.Action,
GroupId = @event.GroupId,
InvitedUserId = @event.UserId,
InviteUserId = @event.InviteUserId,
InviteId = @event.InviteId
});
await _hub.Clients.Users([@event.UserId.ToString(), @event.InviteUserId.ToString()])
.SendAsync("ReceiveMessage",msg);
}
}
}

View File

@ -1,26 +1,26 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupInviteHandler
{
public class GroupInviteSignalRHandler : IConsumer<GroupInviteEvent>
{
private readonly IHubContext<ChatHub> _hub;
public GroupInviteSignalRHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupInviteEvent> context)
{
var @event = context.Message;
var list = @event.Ids.Select(id => id.ToString()).ToArray();
var msg = new HubResponse<GroupInviteVo>("Event", new GroupInviteVo { GroupId = @event.GroupId, UserId = @event.UserId });
await _hub.Clients.Users(list).SendAsync("ReceiveMessage", msg);
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupInviteHandler
{
public class GroupInviteSignalRHandler : IConsumer<GroupInviteEvent>
{
private readonly IHubContext<ChatHub> _hub;
public GroupInviteSignalRHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupInviteEvent> context)
{
var @event = context.Message;
var list = @event.Ids.Select(id => id.ToString()).ToArray();
var msg = new HubResponse<GroupInviteVo>("Event", new GroupInviteVo { GroupId = @event.GroupId, UserId = @event.UserId });
await _hub.Clients.Users(list).SendAsync("ReceiveMessage", msg);
}
}
}

View File

@ -1,21 +1,21 @@
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinConversationHandler : IConsumer<GroupJoinEvent>
{
private IConversationService _conversationService;
public GroupJoinConversationHandler(IConversationService conversationService)
{
_conversationService = conversationService;
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
var @event = context.Message;
await _conversationService.MakeConversationAsync(@event.UserId, @event.GroupId, Models.ChatType.GROUP);
}
}
}
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinConversationHandler : IConsumer<GroupJoinEvent>
{
private IConversationService _conversationService;
public GroupJoinConversationHandler(IConversationService conversationService)
{
_conversationService = conversationService;
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
var @event = context.Message;
await _conversationService.MakeConversationAsync(@event.UserId, @event.GroupId, Models.ChatType.GROUP);
}
}
}

View File

@ -1,22 +1,22 @@
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinDbHandler : IConsumer<GroupJoinEvent>
{
private readonly IGroupService _groupService;
public GroupJoinDbHandler(IGroupService groupService)
{
_groupService = groupService;
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
await _groupService.MakeGroupMemberAsync(context.Message.UserId,
context.Message.GroupId, context.Message.IsCreated ?
Models.GroupMemberRole.Master : Models.GroupMemberRole.Normal);
}
}
}
using IM_API.Domain.Events;
using IM_API.Interface.Services;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinDbHandler : IConsumer<GroupJoinEvent>
{
private readonly IGroupService _groupService;
public GroupJoinDbHandler(IGroupService groupService)
{
_groupService = groupService;
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
await _groupService.MakeGroupMemberAsync(context.Message.UserId,
context.Message.GroupId, context.Message.IsCreated ?
Models.GroupMemberRole.Master : Models.GroupMemberRole.Normal);
}
}
}

View File

@ -1,45 +1,45 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Tools;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
using StackExchange.Redis;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinSignalrHandler : IConsumer<GroupJoinEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IDatabase _redis;
public GroupJoinSignalrHandler(IHubContext<ChatHub> hub, IConnectionMultiplexer connectionMultiplexer)
{
_hub = hub;
_redis = connectionMultiplexer.GetDatabase();
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
var @event = context.Message;
string stramKey = StreamKeyBuilder.Group(@event.GroupId);
//将用户加入群组通知
var list = await _redis.SetMembersAsync(RedisKeys.GetConnectionIdKey(@event.UserId.ToString()));
if(list != null && list.Length > 0)
{
var tasks = list.Select(connectionId =>
_hub.Groups.AddToGroupAsync(connectionId!, stramKey)
).ToList();
await Task.WhenAll(tasks);
}
//发送通知给群成员
var msg = new GroupJoinVo
{
GroupId = @event.GroupId,
UserId = @event.UserId
};
await _hub.Clients.Group(stramKey).SendAsync("ReceiveMessage",new HubResponse<GroupJoinVo>("Event",msg));
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Tools;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
using StackExchange.Redis;
namespace IM_API.Application.EventHandlers.GroupJoinHandler
{
public class GroupJoinSignalrHandler : IConsumer<GroupJoinEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IDatabase _redis;
public GroupJoinSignalrHandler(IHubContext<ChatHub> hub, IConnectionMultiplexer connectionMultiplexer)
{
_hub = hub;
_redis = connectionMultiplexer.GetDatabase();
}
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
{
var @event = context.Message;
string stramKey = StreamKeyBuilder.Group(@event.GroupId);
//将用户加入群组通知
var list = await _redis.SetMembersAsync(RedisKeys.GetConnectionIdKey(@event.UserId.ToString()));
if(list != null && list.Length > 0)
{
var tasks = list.Select(connectionId =>
_hub.Groups.AddToGroupAsync(connectionId!, stramKey)
).ToList();
await Task.WhenAll(tasks);
}
//发送通知给群成员
var msg = new GroupJoinVo
{
GroupId = @event.GroupId,
UserId = @event.UserId
};
await _hub.Clients.Group(stramKey).SendAsync("ReceiveMessage",new HubResponse<GroupJoinVo>("Event",msg));
}
}
}

View File

@ -1,17 +1,17 @@
using IM_API.Domain.Events;
using IM_API.Hubs;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupRequestHandler
{
public class GroupRequestSignalRHandler(IHubContext<ChatHub> hubContext) : IConsumer<GroupRequestEvent>
{
private readonly IHubContext<ChatHub> _hub = hubContext;
public async Task Consume(ConsumeContext<GroupRequestEvent> context)
{
}
}
}
using IM_API.Domain.Events;
using IM_API.Hubs;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupRequestHandler
{
public class GroupRequestSignalRHandler(IHubContext<ChatHub> hubContext) : IConsumer<GroupRequestEvent>
{
private readonly IHubContext<ChatHub> _hub = hubContext;
public async Task Consume(ConsumeContext<GroupRequestEvent> context)
{
}
}
}

View File

@ -1,31 +1,31 @@
using IM_API.Domain.Events;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupRequestHandler
{
public class NextEventHandler : IConsumer<GroupRequestEvent>
{
private readonly IPublishEndpoint _endpoint;
public NextEventHandler(IPublishEndpoint endpoint)
{
_endpoint = endpoint;
}
public async Task Consume(ConsumeContext<GroupRequestEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupRequestState.Passed)
{
await _endpoint.Publish(new GroupJoinEvent
{
AggregateId = @event.AggregateId,
OccurredAt = @event.OccurredAt,
EventId = Guid.NewGuid(),
GroupId = @event.GroupId,
OperatorId = @event.OperatorId,
UserId = @event.UserId
});
}
}
}
}
using IM_API.Domain.Events;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupRequestHandler
{
public class NextEventHandler : IConsumer<GroupRequestEvent>
{
private readonly IPublishEndpoint _endpoint;
public NextEventHandler(IPublishEndpoint endpoint)
{
_endpoint = endpoint;
}
public async Task Consume(ConsumeContext<GroupRequestEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupRequestState.Passed)
{
await _endpoint.Publish(new GroupJoinEvent
{
AggregateId = @event.AggregateId,
OccurredAt = @event.OccurredAt,
EventId = Guid.NewGuid(),
GroupId = @event.GroupId,
OperatorId = @event.OperatorId,
UserId = @event.UserId
});
}
}
}
}

View File

@ -1,31 +1,31 @@
using IM_API.Domain.Events;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupRequestUpdateHandler
{
public class NextEventHandler : IConsumer<GroupRequestUpdateEvent>
{
private readonly IPublishEndpoint _endpoint;
public NextEventHandler(IPublishEndpoint endpoint)
{
_endpoint = endpoint;
}
public async Task Consume(ConsumeContext<GroupRequestUpdateEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupRequestState.Passed)
{
await _endpoint.Publish(new GroupJoinEvent
{
AggregateId = @event.AggregateId,
OccurredAt = @event.OccurredAt,
EventId = Guid.NewGuid(),
GroupId = @event.GroupId,
OperatorId = @event.OperatorId,
UserId = @event.UserId
});
}
}
}
}
using IM_API.Domain.Events;
using MassTransit;
namespace IM_API.Application.EventHandlers.GroupRequestUpdateHandler
{
public class NextEventHandler : IConsumer<GroupRequestUpdateEvent>
{
private readonly IPublishEndpoint _endpoint;
public NextEventHandler(IPublishEndpoint endpoint)
{
_endpoint = endpoint;
}
public async Task Consume(ConsumeContext<GroupRequestUpdateEvent> context)
{
var @event = context.Message;
if(@event.Action == Models.GroupRequestState.Passed)
{
await _endpoint.Publish(new GroupJoinEvent
{
AggregateId = @event.AggregateId,
OccurredAt = @event.OccurredAt,
EventId = Guid.NewGuid(),
GroupId = @event.GroupId,
OperatorId = @event.OperatorId,
UserId = @event.UserId
});
}
}
}
}

View File

@ -1,29 +1,29 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupRequestUpdateHandler
{
public class RequestUpdateSignalrHandler : IConsumer<GroupRequestUpdateEvent>
{
private readonly IHubContext<ChatHub> _hub;
public RequestUpdateSignalrHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupRequestUpdateEvent> context)
{
var msg = new HubResponse<GroupRequestUpdateVo>("Event", new GroupRequestUpdateVo
{
GroupId = context.Message.GroupId,
RequestId = context.Message.RequestId,
UserId = context.Message.UserId
});
await _hub.Clients.User(context.Message.UserId.ToString()).SendAsync("ReceiveMessage", msg);
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.VOs.Group;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.GroupRequestUpdateHandler
{
public class RequestUpdateSignalrHandler : IConsumer<GroupRequestUpdateEvent>
{
private readonly IHubContext<ChatHub> _hub;
public RequestUpdateSignalrHandler(IHubContext<ChatHub> hub)
{
_hub = hub;
}
public async Task Consume(ConsumeContext<GroupRequestUpdateEvent> context)
{
var msg = new HubResponse<GroupRequestUpdateVo>("Event", new GroupRequestUpdateVo
{
GroupId = context.Message.GroupId,
RequestId = context.Message.RequestId,
UserId = context.Message.UserId
});
await _hub.Clients.User(context.Message.UserId.ToString()).SendAsync("ReceiveMessage", msg);
}
}
}

View File

@ -1,66 +1,66 @@
using AutoMapper;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using MassTransit;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class ConversationEventHandler : IConsumer<MessageCreatedEvent>
{
private readonly IConversationService _conversationService;
private readonly ILogger<ConversationEventHandler> _logger;
private readonly IUserService _userSerivce;
private readonly IGroupService _groupService;
public ConversationEventHandler(
IConversationService conversationService,
ILogger<ConversationEventHandler> logger,
IUserService userService,
IGroupService groupService
)
{
_conversationService = conversationService;
_logger = logger;
_userSerivce = userService;
_groupService = groupService;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
var @event = context.Message;
if (@event.ChatType == ChatType.GROUP)
{
var userinfo = await _userSerivce.GetUserInfoAsync(@event.MsgSenderId);
await _groupService.UpdateGroupConversationAsync(new Dtos.Group.GroupUpdateConversationDto
{
GroupId = @event.MsgRecipientId,
LastMessage = @event.MessageContent,
LastSenderName = userinfo.NickName,
LastUpdateTime = @event.MessageCreated,
MaxSequenceId = @event.SequenceId
});
}
else
{
await _conversationService.UpdateConversationAfterSentAsync(new Dtos.Conversation.UpdateConversationDto
{
LastMessage = @event.MessageContent,
LastSequenceId = @event.SequenceId,
ReceiptId = @event.MsgRecipientId,
SenderId = @event.MsgSenderId,
StreamKey = @event.StreamKey,
DateTime = @event.MessageCreated
});
}
}
}
}
using AutoMapper;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Exceptions;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Services;
using IM_API.Tools;
using MassTransit;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class ConversationEventHandler : IConsumer<MessageCreatedEvent>
{
private readonly IConversationService _conversationService;
private readonly ILogger<ConversationEventHandler> _logger;
private readonly IUserService _userSerivce;
private readonly IGroupService _groupService;
public ConversationEventHandler(
IConversationService conversationService,
ILogger<ConversationEventHandler> logger,
IUserService userService,
IGroupService groupService
)
{
_conversationService = conversationService;
_logger = logger;
_userSerivce = userService;
_groupService = groupService;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
var @event = context.Message;
if (@event.ChatType == ChatType.GROUP)
{
var userinfo = await _userSerivce.GetUserInfoAsync(@event.MsgSenderId);
await _groupService.UpdateGroupConversationAsync(new Dtos.Group.GroupUpdateConversationDto
{
GroupId = @event.MsgRecipientId,
LastMessage = @event.MessageContent,
LastSenderName = userinfo.NickName,
LastUpdateTime = @event.MessageCreated,
MaxSequenceId = @event.SequenceId
});
}
else
{
await _conversationService.UpdateConversationAfterSentAsync(new Dtos.Conversation.UpdateConversationDto
{
LastMessage = @event.MessageContent,
LastSequenceId = @event.SequenceId,
ReceiptId = @event.MsgRecipientId,
SenderId = @event.MsgSenderId,
StreamKey = @event.StreamKey,
DateTime = @event.MessageCreated
});
}
}
}
}

View File

@ -1,26 +1,26 @@
using IM_API.Domain.Events;
using MassTransit;
using IM_API.Interface.Services;
using AutoMapper;
using IM_API.Models;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class MessageCreatedDbHandler : IConsumer<MessageCreatedEvent>
{
private readonly IMessageSevice _messageService;
public readonly IMapper _mapper;
public MessageCreatedDbHandler(IMessageSevice messageSevice, IMapper mapper)
{
_messageService = messageSevice;
_mapper = mapper;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
var @event = context.Message;
var msg = _mapper.Map<Message>(@event);
await _messageService.MakeMessageAsync(msg);
}
}
}
using IM_API.Domain.Events;
using MassTransit;
using IM_API.Interface.Services;
using AutoMapper;
using IM_API.Models;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class MessageCreatedDbHandler : IConsumer<MessageCreatedEvent>
{
private readonly IMessageSevice _messageService;
public readonly IMapper _mapper;
public MessageCreatedDbHandler(IMessageSevice messageSevice, IMapper mapper)
{
_messageService = messageSevice;
_mapper = mapper;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
var @event = context.Message;
var msg = _mapper.Map<Message>(@event);
await _messageService.MakeMessageAsync(msg);
}
}
}

View File

@ -1,48 +1,48 @@
using AutoMapper;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Tools;
using IM_API.VOs.Message;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class SignalREventHandler : IConsumer<MessageCreatedEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IMapper _mapper;
private readonly IUserService _userService;
public SignalREventHandler(IHubContext<ChatHub> hub, IMapper mapper,IUserService userService)
{
_hub = hub;
_mapper = mapper;
_userService = userService;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
Console.ForegroundColor = ConsoleColor.Red;
var @event = context.Message;
try
{
var entity = _mapper.Map<Message>(@event);
var messageBaseVo = _mapper.Map<MessageBaseVo>(entity);
var senderinfo = await _userService.GetUserInfoAsync(@event.MsgSenderId);
messageBaseVo.SenderName = senderinfo.NickName;
messageBaseVo.SenderAvatar = senderinfo.Avatar ?? "";
await _hub.Clients.Group(@event.StreamKey).SendAsync("ReceiveMessage", new HubResponse<MessageBaseVo>("Event", messageBaseVo));
}
catch (Exception ex)
{
Console.WriteLine($"[SignalR] 发送失败: {ex.Message}");
Console.ResetColor();
throw;
}
}
}
}
using AutoMapper;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Hubs;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.Tools;
using IM_API.VOs.Message;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.MessageCreatedHandler
{
public class SignalREventHandler : IConsumer<MessageCreatedEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IMapper _mapper;
private readonly IUserService _userService;
public SignalREventHandler(IHubContext<ChatHub> hub, IMapper mapper,IUserService userService)
{
_hub = hub;
_mapper = mapper;
_userService = userService;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
{
Console.ForegroundColor = ConsoleColor.Red;
var @event = context.Message;
try
{
var entity = _mapper.Map<Message>(@event);
var messageBaseVo = _mapper.Map<MessageBaseVo>(entity);
var senderinfo = await _userService.GetUserInfoAsync(@event.MsgSenderId);
messageBaseVo.SenderName = senderinfo.NickName;
messageBaseVo.SenderAvatar = senderinfo.Avatar ?? "";
await _hub.Clients.Group(@event.StreamKey).SendAsync("ReceiveMessage", new HubResponse<MessageBaseVo>("Event", messageBaseVo));
}
catch (Exception ex)
{
Console.WriteLine($"[SignalR] 发送失败: {ex.Message}");
Console.ResetColor();
throw;
}
}
}
}

View File

@ -1,37 +1,37 @@
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Friend;
using IM_API.Hubs;
using IM_API.Interface.Services;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.RequestFriendHandler
{
public class RequestFriendSignalRHandler:IConsumer<RequestFriendEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IUserService _userService;
public RequestFriendSignalRHandler(IHubContext<ChatHub> hubContext, IUserService userService)
{
_hub = hubContext;
_userService = userService;
}
public async Task Consume(ConsumeContext<RequestFriendEvent> context)
{
var @event = context.Message;
var userInfo = await _userService.GetUserInfoAsync(@event.FromUserId);
var res = new HubResponse<FriendRequestResDto>("Event", new FriendRequestResDto()
{
RequestUser = @event.FromUserId,
ResponseUser = @event.ToUserId,
Created = DateTime.UtcNow,
Description = @event.Description,
Avatar = userInfo.Avatar,
NickName = userInfo.NickName
});
await _hub.Clients.User(@event.ToUserId.ToString()).SendAsync("ReceiveMessage", res);
}
}
}
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Friend;
using IM_API.Hubs;
using IM_API.Interface.Services;
using MassTransit;
using Microsoft.AspNetCore.SignalR;
namespace IM_API.Application.EventHandlers.RequestFriendHandler
{
public class RequestFriendSignalRHandler:IConsumer<RequestFriendEvent>
{
private readonly IHubContext<ChatHub> _hub;
private readonly IUserService _userService;
public RequestFriendSignalRHandler(IHubContext<ChatHub> hubContext, IUserService userService)
{
_hub = hubContext;
_userService = userService;
}
public async Task Consume(ConsumeContext<RequestFriendEvent> context)
{
var @event = context.Message;
var userInfo = await _userService.GetUserInfoAsync(@event.FromUserId);
var res = new HubResponse<FriendRequestResDto>("Event", new FriendRequestResDto()
{
RequestUser = @event.FromUserId,
ResponseUser = @event.ToUserId,
Created = DateTime.UtcNow,
Description = @event.Description,
Avatar = userInfo.Avatar,
NickName = userInfo.NickName
});
await _hub.Clients.User(@event.ToUserId.ToString()).SendAsync("ReceiveMessage", res);
}
}
}

View File

@ -1,9 +1,9 @@
using IM_API.Domain.Interfaces;
namespace IM_API.Application.Interfaces
{
public interface IEventBus
{
Task PublishAsync<TEvent>(TEvent @event) where TEvent : IEvent;
}
}
using IM_API.Domain.Interfaces;
namespace IM_API.Application.Interfaces
{
public interface IEventBus
{
Task PublishAsync<TEvent>(TEvent @event) where TEvent : IEvent;
}
}

View File

@ -1,9 +1,9 @@
using IM_API.Domain.Interfaces;
namespace IM_API.Application.Interfaces
{
public interface IEventHandler<in TEvent> where TEvent : IEvent
{
Task Handle(TEvent @event);
}
}
using IM_API.Domain.Interfaces;
namespace IM_API.Application.Interfaces
{
public interface IEventHandler<in TEvent> where TEvent : IEvent
{
Task Handle(TEvent @event);
}
}

View File

@ -1,65 +1,65 @@
using AutoMapper;
using IM_API.Application.EventHandlers.FriendAddHandler;
using IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler;
using IM_API.Application.EventHandlers.GroupInviteHandler;
using IM_API.Application.EventHandlers.GroupJoinHandler;
using IM_API.Application.EventHandlers.GroupRequestHandler;
using IM_API.Application.EventHandlers.GroupRequestUpdateHandler;
using IM_API.Application.EventHandlers.MessageCreatedHandler;
using IM_API.Application.EventHandlers.RequestFriendHandler;
using IM_API.Configs.Options;
using IM_API.Domain.Events;
using MassTransit;
using MySqlConnector;
namespace IM_API.Configs
{
public static class MQConfig
{
public static IServiceCollection AddRabbitMQ(this IServiceCollection services, RabbitMQOptions options)
{
services.AddMassTransit(x =>
{
x.AddConsumer<ConversationEventHandler>();
x.AddConsumer<SignalREventHandler>();
x.AddConsumer<FriendAddDBHandler>();
x.AddConsumer<FriendAddSignalRHandler>();
x.AddConsumer<RequestFriendSignalRHandler>();
x.AddConsumer<FriendAddConversationHandler>();
x.AddConsumer<MessageCreatedDbHandler>();
x.AddConsumer<GroupJoinConversationHandler>();
x.AddConsumer<GroupJoinDbHandler>();
x.AddConsumer<GroupJoinSignalrHandler>();
x.AddConsumer<GroupRequestSignalRHandler>();
x.AddConsumer<Application.EventHandlers.GroupRequestHandler.NextEventHandler>();
x.AddConsumer<Application.EventHandlers.GroupRequestUpdateHandler.NextEventHandler>();
x.AddConsumer<GroupInviteSignalRHandler>();
x.AddConsumer<RequestDbHandler>();
x.AddConsumer<SignalRHandler>();
x.AddConsumer<RequestUpdateSignalrHandler>();
x.UsingRabbitMq((ctx,cfg) =>
{
cfg.Host(options.Host, "/", h =>
{
h.Username(options.Username);
h.Password(options.Password);
});
cfg.ConfigureEndpoints(ctx);
cfg.UseMessageRetry(r =>
{
r.Handle<IOException>();
r.Handle<MySqlException>();
r.Ignore<AutoMapperMappingException>();
r.Exponential(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(2));
});
cfg.ConfigureEndpoints(ctx);
});
});
return services;
}
}
}
using AutoMapper;
using IM_API.Application.EventHandlers.FriendAddHandler;
using IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler;
using IM_API.Application.EventHandlers.GroupInviteHandler;
using IM_API.Application.EventHandlers.GroupJoinHandler;
using IM_API.Application.EventHandlers.GroupRequestHandler;
using IM_API.Application.EventHandlers.GroupRequestUpdateHandler;
using IM_API.Application.EventHandlers.MessageCreatedHandler;
using IM_API.Application.EventHandlers.RequestFriendHandler;
using IM_API.Configs.Options;
using IM_API.Domain.Events;
using MassTransit;
using MySqlConnector;
namespace IM_API.Configs
{
public static class MQConfig
{
public static IServiceCollection AddRabbitMQ(this IServiceCollection services, RabbitMQOptions options)
{
services.AddMassTransit(x =>
{
x.AddConsumer<ConversationEventHandler>();
x.AddConsumer<SignalREventHandler>();
x.AddConsumer<FriendAddDBHandler>();
x.AddConsumer<FriendAddSignalRHandler>();
x.AddConsumer<RequestFriendSignalRHandler>();
x.AddConsumer<FriendAddConversationHandler>();
x.AddConsumer<MessageCreatedDbHandler>();
x.AddConsumer<GroupJoinConversationHandler>();
x.AddConsumer<GroupJoinDbHandler>();
x.AddConsumer<GroupJoinSignalrHandler>();
x.AddConsumer<GroupRequestSignalRHandler>();
x.AddConsumer<Application.EventHandlers.GroupRequestHandler.NextEventHandler>();
x.AddConsumer<Application.EventHandlers.GroupRequestUpdateHandler.NextEventHandler>();
x.AddConsumer<GroupInviteSignalRHandler>();
x.AddConsumer<RequestDbHandler>();
x.AddConsumer<SignalRHandler>();
x.AddConsumer<RequestUpdateSignalrHandler>();
x.UsingRabbitMq((ctx,cfg) =>
{
cfg.Host(options.Host, "/", h =>
{
h.Username(options.Username);
h.Password(options.Password);
});
cfg.ConfigureEndpoints(ctx);
cfg.UseMessageRetry(r =>
{
r.Handle<IOException>();
r.Handle<MySqlException>();
r.Ignore<AutoMapperMappingException>();
r.Exponential(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(2));
});
cfg.ConfigureEndpoints(ctx);
});
});
return services;
}
}
}

View File

@ -1,176 +1,176 @@
using AutoMapper;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Auth;
using IM_API.Dtos.Friend;
using IM_API.Dtos.Group;
using IM_API.Dtos.User;
using IM_API.Models;
using IM_API.Tools;
using IM_API.VOs.Conversation;
using IM_API.VOs.Message;
namespace IM_API.Configs
{
public class MapperConfig:Profile
{
public MapperConfig()
{
CreateMap<User, UserInfoDto>();
//用户信息更新模型转换
CreateMap<UpdateUserDto, User>()
.ForMember(dest => dest.Updated,opt => opt.MapFrom(src => DateTime.Now))
.ForAllMembers(opts => opts.Condition((src,dest,srcMember) => srcMember != null));
//用户注册模型转换
CreateMap<RegisterRequestDto, User>()
.ForMember(dest => dest.Username,opt => opt.MapFrom(src => src.Username))
.ForMember(dest => dest.Password,opt => opt.MapFrom(src => src.Password))
.ForMember(dest => dest.Avatar,opt => opt.MapFrom(src => "https://ts1.tc.mm.bing.net/th/id/OIP-C.dl0WpkTP6E2J4FnhDC_jHwAAAA?rs=1&pid=ImgDetMain&o=7&rm=3"))
.ForMember(dest => dest.StatusEnum,opt => opt.MapFrom(src => UserStatus.Normal))
.ForMember(dest => dest.OnlineStatusEnum,opt => opt.MapFrom(src => UserOnlineStatus.Offline))
.ForMember(dest => dest.NickName,opt => opt.MapFrom(src => src.NickName??"默认用户"))
.ForMember(dest => dest.Created,opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.IsDeleted,opt => opt.MapFrom(src => 0))
;
//好友信息模型转换
CreateMap<Friend, FriendInfoDto>()
.ForMember(dest => dest.UserInfo, opt => opt.MapFrom(src => src.FriendNavigation))
.ForMember(dest => dest.Avatar, opt => opt.MapFrom(src => src.FriendNavigation.Avatar))
;
//好友请求通过后新增好友关系
CreateMap<FriendRequestDto, Friend>()
.ForMember(dest => dest.UserId , opt => opt.MapFrom(src => src.FromUserId))
.ForMember(dest => dest.FriendId , opt => opt.MapFrom(src => src.ToUserId))
.ForMember(dest => dest.StatusEnum , opt =>opt.MapFrom(src => FriendStatus.Pending))
.ForMember(dest => dest.RemarkName , opt => opt.MapFrom(src => src.RemarkName))
.ForMember(dest => dest.Created , opt => opt.MapFrom(src => DateTime.Now))
;
//发起好友请求转换请求对象
CreateMap<FriendRequestDto, FriendRequest>()
.ForMember(dest => dest.RequestUser , opt => opt.MapFrom(src => src.FromUserId))
.ForMember(dest => dest.ResponseUser , opt => opt.MapFrom(src => src.ToUserId))
.ForMember(dest => dest.Created , opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.StateEnum , opt => opt.MapFrom(src => FriendRequestState.Pending))
.ForMember(dest => dest.Description , opt => opt.MapFrom(src => src.Description))
;
CreateMap<FriendRequest, FriendRequestDto>()
.ForMember(dest => dest.ToUserId, opt => opt.MapFrom(src => src.ResponseUser))
.ForMember(dest => dest.FromUserId, opt => opt.MapFrom(src => src.RequestUser))
.ForMember(dest => dest.RemarkName, opt => opt.MapFrom(src => src.RemarkName))
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description))
;
//消息模型转换
CreateMap<Message, MessageBaseVo>()
.ForMember(dest => dest.Type , opt => opt.MapFrom(src => src.MsgTypeEnum))
.ForMember(dest => dest.MsgId , opt => opt.MapFrom(src => src.ClientMsgId))
.ForMember(dest => dest.SenderId , opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.ChatType , opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.ReceiverId, opt => opt.MapFrom(src => src.Recipient))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.TimeStamp, opt => opt.MapFrom(src => src.Created))
.ForMember(dest => dest.SequenceId, opt => opt.MapFrom(src => src.SequenceId))
;
CreateMap<MessageBaseDto, Message>()
.ForMember(dest => dest.Sender, opt => opt.MapFrom(src => src.SenderId))
.ForMember(dest => dest.ChatTypeEnum,opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.MsgTypeEnum, opt => opt.MapFrom(src => src.Type))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => src.TimeStamp))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.Recipient, opt => opt.MapFrom(src => src.ReceiverId))
.ForMember(dest => dest.StreamKey, opt => opt.Ignore() )
.ForMember(dest => dest.StateEnum, opt => opt.MapFrom(src => MessageState.Sent))
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.MsgType, opt => opt.Ignore())
.ForMember(dest => dest.ClientMsgId, opt => opt.MapFrom(src => src.MsgId))
;
//会话对象深拷贝
CreateMap<Conversation, Conversation>()
.ForMember(dest => dest.Id, opt => opt.Ignore())
.ForMember(dest => dest.UserId, opt => opt.Ignore())
.ForMember(dest => dest.TargetId, opt => opt.Ignore())
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.StreamKey, opt => opt.Ignore())
;
//消息对象转消息创建事件对象
CreateMap<Message, MessageCreatedEvent>()
.ForMember(dest => dest.MessageMsgType, opt => opt.MapFrom(src => src.MsgTypeEnum))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.MessageContent, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.State, opt => opt.MapFrom(src => src.StateEnum))
.ForMember(dest => dest.MessageCreated, opt => opt.MapFrom(src => src.Created))
.ForMember(dest => dest.MsgRecipientId, opt => opt.MapFrom(src => src.Recipient))
.ForMember(dest => dest.MsgSenderId, opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.EventId, opt => opt.MapFrom(src => Guid.NewGuid()))
.ForMember(dest => dest.AggregateId, opt => opt.MapFrom(src => src.Sender.ToString()))
.ForMember(dest => dest.OccurredAt , opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.OperatorId, opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
;
CreateMap<MessageCreatedEvent, Message>()
.ForMember(dest => dest.SequenceId, opt => opt.MapFrom(src => src.SequenceId))
.ForMember(dest => dest.ClientMsgId, opt => opt.MapFrom(src => src.ClientMsgId))
.ForMember(dest => dest.StateEnum, opt => opt.MapFrom(src => src.State))
.ForMember(dest => dest.ChatTypeEnum, opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.MessageContent))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => src.MessageCreated))
.ForMember(dest => dest.MsgTypeEnum, opt => opt.MapFrom(src => src.MessageMsgType))
.ForMember(dest => dest.Recipient, opt => opt.MapFrom(src => src.MsgRecipientId))
.ForMember(dest => dest.Sender, opt => opt.MapFrom(src => src.MsgSenderId))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.State, opt => opt.Ignore())
.ForMember(dest => dest.MsgType, opt => opt.Ignore());
//消息发送事件转换会话对象
CreateMap<MessageCreatedEvent, Conversation>()
//.ForMember(dest => dest.LastReadMessageId, opt => opt.MapFrom(src => src.MessageId))
.ForMember(dest => dest.LastMessage, opt => opt.MapFrom(src => src.MessageContent))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.MsgSenderId))
.ForMember(dest => dest.TargetId, opt => opt.MapFrom(src => src.MsgRecipientId))
.ForMember(dest => dest.UnreadCount, opt => opt.MapFrom(src => 0))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
.ForMember(dest => dest.LastMessageTime, opt => opt.MapFrom(src => DateTime.Now))
;
//创建会话对象
CreateMap<Conversation, ConversationVo>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.LastMessage, opt => opt.MapFrom(src => src.LastMessage))
.ForMember(dest => dest.LastSequenceId, opt => opt.MapFrom(src => src.LastReadSequenceId))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.DateTime, opt => opt.MapFrom(src => src.LastMessageTime))
.ForMember(dest => dest.TargetId, opt => opt.MapFrom(src => src.TargetId))
.ForMember(dest => dest.UnreadCount, opt => opt.MapFrom(src => src.UnreadCount))
.ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.UserId));
CreateMap<Friend, ConversationVo>()
.ForMember(dest => dest.TargetAvatar, opt => opt.MapFrom(src => src.FriendNavigation.Avatar))
.ForMember(dest => dest.TargetName, opt => opt.MapFrom(src => src.RemarkName));
CreateMap<Group, ConversationVo>()
.ForMember(dest => dest.TargetAvatar, opt => opt.MapFrom(src => src.Avatar))
.ForMember(dest => dest.TargetName, opt => opt.MapFrom(src => src.Name));
//群模型转换
CreateMap<Group, GroupInfoDto>()
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusEnum))
.ForMember(dest => dest.AllMembersBanned, opt => opt.MapFrom(src => src.AllMembersBannedEnum))
.ForMember(dest => dest.Auhority, opt => opt.MapFrom(src => src.AuhorityEnum));
CreateMap<GroupCreateDto, Group>()
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.Avatar, opt => opt.MapFrom(src => src.Avatar))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.AllMembersBannedEnum, opt => opt.MapFrom(src => GroupAllMembersBanned.ALLOWED))
.ForMember(dest => dest.AuhorityEnum, opt => opt.MapFrom(src => GroupAuhority.REQUIRE_CONSENT))
.ForMember(dest => dest.StatusEnum, opt => opt.MapFrom(src => GroupStatus.Normal))
;
}
}
}
using AutoMapper;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Auth;
using IM_API.Dtos.Friend;
using IM_API.Dtos.Group;
using IM_API.Dtos.User;
using IM_API.Models;
using IM_API.Tools;
using IM_API.VOs.Conversation;
using IM_API.VOs.Message;
namespace IM_API.Configs
{
public class MapperConfig:Profile
{
public MapperConfig()
{
CreateMap<User, UserInfoDto>();
//用户信息更新模型转换
CreateMap<UpdateUserDto, User>()
.ForMember(dest => dest.Updated,opt => opt.MapFrom(src => DateTime.Now))
.ForAllMembers(opts => opts.Condition((src,dest,srcMember) => srcMember != null));
//用户注册模型转换
CreateMap<RegisterRequestDto, User>()
.ForMember(dest => dest.Username,opt => opt.MapFrom(src => src.Username))
.ForMember(dest => dest.Password,opt => opt.MapFrom(src => src.Password))
.ForMember(dest => dest.Avatar,opt => opt.MapFrom(src => "https://ts1.tc.mm.bing.net/th/id/OIP-C.dl0WpkTP6E2J4FnhDC_jHwAAAA?rs=1&pid=ImgDetMain&o=7&rm=3"))
.ForMember(dest => dest.StatusEnum,opt => opt.MapFrom(src => UserStatus.Normal))
.ForMember(dest => dest.OnlineStatusEnum,opt => opt.MapFrom(src => UserOnlineStatus.Offline))
.ForMember(dest => dest.NickName,opt => opt.MapFrom(src => src.NickName??"默认用户"))
.ForMember(dest => dest.Created,opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.IsDeleted,opt => opt.MapFrom(src => 0))
;
//好友信息模型转换
CreateMap<Friend, FriendInfoDto>()
.ForMember(dest => dest.UserInfo, opt => opt.MapFrom(src => src.FriendNavigation))
.ForMember(dest => dest.Avatar, opt => opt.MapFrom(src => src.FriendNavigation.Avatar))
;
//好友请求通过后新增好友关系
CreateMap<FriendRequestDto, Friend>()
.ForMember(dest => dest.UserId , opt => opt.MapFrom(src => src.FromUserId))
.ForMember(dest => dest.FriendId , opt => opt.MapFrom(src => src.ToUserId))
.ForMember(dest => dest.StatusEnum , opt =>opt.MapFrom(src => FriendStatus.Pending))
.ForMember(dest => dest.RemarkName , opt => opt.MapFrom(src => src.RemarkName))
.ForMember(dest => dest.Created , opt => opt.MapFrom(src => DateTime.Now))
;
//发起好友请求转换请求对象
CreateMap<FriendRequestDto, FriendRequest>()
.ForMember(dest => dest.RequestUser , opt => opt.MapFrom(src => src.FromUserId))
.ForMember(dest => dest.ResponseUser , opt => opt.MapFrom(src => src.ToUserId))
.ForMember(dest => dest.Created , opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.StateEnum , opt => opt.MapFrom(src => FriendRequestState.Pending))
.ForMember(dest => dest.Description , opt => opt.MapFrom(src => src.Description))
;
CreateMap<FriendRequest, FriendRequestDto>()
.ForMember(dest => dest.ToUserId, opt => opt.MapFrom(src => src.ResponseUser))
.ForMember(dest => dest.FromUserId, opt => opt.MapFrom(src => src.RequestUser))
.ForMember(dest => dest.RemarkName, opt => opt.MapFrom(src => src.RemarkName))
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description))
;
//消息模型转换
CreateMap<Message, MessageBaseVo>()
.ForMember(dest => dest.Type , opt => opt.MapFrom(src => src.MsgTypeEnum))
.ForMember(dest => dest.MsgId , opt => opt.MapFrom(src => src.ClientMsgId))
.ForMember(dest => dest.SenderId , opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.ChatType , opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.ReceiverId, opt => opt.MapFrom(src => src.Recipient))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.TimeStamp, opt => opt.MapFrom(src => src.Created))
.ForMember(dest => dest.SequenceId, opt => opt.MapFrom(src => src.SequenceId))
;
CreateMap<MessageBaseDto, Message>()
.ForMember(dest => dest.Sender, opt => opt.MapFrom(src => src.SenderId))
.ForMember(dest => dest.ChatTypeEnum,opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.MsgTypeEnum, opt => opt.MapFrom(src => src.Type))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => src.TimeStamp))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.Recipient, opt => opt.MapFrom(src => src.ReceiverId))
.ForMember(dest => dest.StreamKey, opt => opt.Ignore() )
.ForMember(dest => dest.StateEnum, opt => opt.MapFrom(src => MessageState.Sent))
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.MsgType, opt => opt.Ignore())
.ForMember(dest => dest.ClientMsgId, opt => opt.MapFrom(src => src.MsgId))
;
//会话对象深拷贝
CreateMap<Conversation, Conversation>()
.ForMember(dest => dest.Id, opt => opt.Ignore())
.ForMember(dest => dest.UserId, opt => opt.Ignore())
.ForMember(dest => dest.TargetId, opt => opt.Ignore())
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.StreamKey, opt => opt.Ignore())
;
//消息对象转消息创建事件对象
CreateMap<Message, MessageCreatedEvent>()
.ForMember(dest => dest.MessageMsgType, opt => opt.MapFrom(src => src.MsgTypeEnum))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.MessageContent, opt => opt.MapFrom(src => src.Content))
.ForMember(dest => dest.State, opt => opt.MapFrom(src => src.StateEnum))
.ForMember(dest => dest.MessageCreated, opt => opt.MapFrom(src => src.Created))
.ForMember(dest => dest.MsgRecipientId, opt => opt.MapFrom(src => src.Recipient))
.ForMember(dest => dest.MsgSenderId, opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.EventId, opt => opt.MapFrom(src => Guid.NewGuid()))
.ForMember(dest => dest.AggregateId, opt => opt.MapFrom(src => src.Sender.ToString()))
.ForMember(dest => dest.OccurredAt , opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.OperatorId, opt => opt.MapFrom(src => src.Sender))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
;
CreateMap<MessageCreatedEvent, Message>()
.ForMember(dest => dest.SequenceId, opt => opt.MapFrom(src => src.SequenceId))
.ForMember(dest => dest.ClientMsgId, opt => opt.MapFrom(src => src.ClientMsgId))
.ForMember(dest => dest.StateEnum, opt => opt.MapFrom(src => src.State))
.ForMember(dest => dest.ChatTypeEnum, opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.MessageContent))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => src.MessageCreated))
.ForMember(dest => dest.MsgTypeEnum, opt => opt.MapFrom(src => src.MessageMsgType))
.ForMember(dest => dest.Recipient, opt => opt.MapFrom(src => src.MsgRecipientId))
.ForMember(dest => dest.Sender, opt => opt.MapFrom(src => src.MsgSenderId))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
.ForMember(dest => dest.ChatType, opt => opt.Ignore())
.ForMember(dest => dest.State, opt => opt.Ignore())
.ForMember(dest => dest.MsgType, opt => opt.Ignore());
//消息发送事件转换会话对象
CreateMap<MessageCreatedEvent, Conversation>()
//.ForMember(dest => dest.LastReadMessageId, opt => opt.MapFrom(src => src.MessageId))
.ForMember(dest => dest.LastMessage, opt => opt.MapFrom(src => src.MessageContent))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatType))
.ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.MsgSenderId))
.ForMember(dest => dest.TargetId, opt => opt.MapFrom(src => src.MsgRecipientId))
.ForMember(dest => dest.UnreadCount, opt => opt.MapFrom(src => 0))
.ForMember(dest => dest.StreamKey, opt => opt.MapFrom(src => src.StreamKey))
.ForMember(dest => dest.LastMessageTime, opt => opt.MapFrom(src => DateTime.Now))
;
//创建会话对象
CreateMap<Conversation, ConversationVo>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.LastMessage, opt => opt.MapFrom(src => src.LastMessage))
.ForMember(dest => dest.LastSequenceId, opt => opt.MapFrom(src => src.LastReadSequenceId))
.ForMember(dest => dest.ChatType, opt => opt.MapFrom(src => src.ChatTypeEnum))
.ForMember(dest => dest.DateTime, opt => opt.MapFrom(src => src.LastMessageTime))
.ForMember(dest => dest.TargetId, opt => opt.MapFrom(src => src.TargetId))
.ForMember(dest => dest.UnreadCount, opt => opt.MapFrom(src => src.UnreadCount))
.ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.UserId));
CreateMap<Friend, ConversationVo>()
.ForMember(dest => dest.TargetAvatar, opt => opt.MapFrom(src => src.FriendNavigation.Avatar))
.ForMember(dest => dest.TargetName, opt => opt.MapFrom(src => src.RemarkName));
CreateMap<Group, ConversationVo>()
.ForMember(dest => dest.TargetAvatar, opt => opt.MapFrom(src => src.Avatar))
.ForMember(dest => dest.TargetName, opt => opt.MapFrom(src => src.Name));
//群模型转换
CreateMap<Group, GroupInfoDto>()
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusEnum))
.ForMember(dest => dest.AllMembersBanned, opt => opt.MapFrom(src => src.AllMembersBannedEnum))
.ForMember(dest => dest.Auhority, opt => opt.MapFrom(src => src.AuhorityEnum));
CreateMap<GroupCreateDto, Group>()
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.Avatar, opt => opt.MapFrom(src => src.Avatar))
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => DateTime.Now))
.ForMember(dest => dest.AllMembersBannedEnum, opt => opt.MapFrom(src => GroupAllMembersBanned.ALLOWED))
.ForMember(dest => dest.AuhorityEnum, opt => opt.MapFrom(src => GroupAuhority.REQUIRE_CONSENT))
.ForMember(dest => dest.StatusEnum, opt => opt.MapFrom(src => GroupStatus.Normal))
;
}
}
}

View File

@ -1,8 +1,8 @@
namespace IM_API.Configs.Options
{
public class ConnectionOptions
{
public string DefaultConnection { get; set; }
public string Redis { get; set; }
}
}
namespace IM_API.Configs.Options
{
public class ConnectionOptions
{
public string DefaultConnection { get; set; }
public string Redis { get; set; }
}
}

View File

@ -1,10 +1,10 @@
namespace IM_API.Configs.Options
{
public class RabbitMQOptions
{
public string Host { get; set; }
public int Port { get; set; }
public string Username { get; set; }
public string Password { get; set; }
}
}
namespace IM_API.Configs.Options
{
public class RabbitMQOptions
{
public string Host { get; set; }
public int Port { get; set; }
public string Username { get; set; }
public string Password { get; set; }
}
}

View File

@ -1,64 +1,64 @@
using IM_API.Application.EventHandlers;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Infrastructure.EventBus;
using IM_API.Interface.Services;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
using RedLockNet;
using RedLockNet.SERedis;
using RedLockNet.SERedis.Configuration;
using StackExchange.Redis;
namespace IM_API.Configs
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddAllService(this IServiceCollection services, IConfiguration configuration)
{
services.AddAutoMapper(typeof(MapperConfig));
services.AddScoped<IAuthService, AuthService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IFriendSerivce, FriendService>();
services.AddScoped<IMessageSevice, MessageService>();
services.AddScoped<IConversationService, ConversationService>();
services.AddScoped<IGroupService, GroupService>();
services.AddScoped<ISequenceIdService, SequenceIdService>();
services.AddScoped<ICacheService, RedisCacheService>();
services.AddScoped<IEventBus, InMemoryEventBus>();
services.AddSingleton<IJWTService, JWTService>();
services.AddSingleton<IRefreshTokenService, RedisRefreshTokenService>();
services.AddSingleton<IDistributedLockFactory>(sp =>
{
var connection = sp.GetRequiredService<IConnectionMultiplexer>();
// 这里可以配置多个 Redis 节点提高安全性,单机运行传一个即可
return RedLockFactory.Create(new List<RedLockMultiplexer> { new RedLockMultiplexer(connection) });
});
return services;
}
public static IServiceCollection AddModelValidation(this IServiceCollection services, IConfiguration configuration)
{
services.Configure<ApiBehaviorOptions>(options =>
{
options.InvalidModelStateResponseFactory = context =>
{
var errors = context.ModelState
.Where(e => e.Value.Errors.Count > 0)
.Select(e => new
{
Field = e.Key,
Message = e.Value.Errors.First().ErrorMessage
});
Console.WriteLine(errors);
return new BadRequestObjectResult(new BaseResponse<object?>(CodeDefine.PARAMETER_ERROR.Code, errors.First().Message));
};
});
return services;
}
}
}
using IM_API.Application.EventHandlers;
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Infrastructure.EventBus;
using IM_API.Interface.Services;
using IM_API.Services;
using IM_API.Tools;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
using RedLockNet;
using RedLockNet.SERedis;
using RedLockNet.SERedis.Configuration;
using StackExchange.Redis;
namespace IM_API.Configs
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddAllService(this IServiceCollection services, IConfiguration configuration)
{
services.AddAutoMapper(typeof(MapperConfig));
services.AddScoped<IAuthService, AuthService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IFriendSerivce, FriendService>();
services.AddScoped<IMessageSevice, MessageService>();
services.AddScoped<IConversationService, ConversationService>();
services.AddScoped<IGroupService, GroupService>();
services.AddScoped<ISequenceIdService, SequenceIdService>();
services.AddScoped<ICacheService, RedisCacheService>();
services.AddScoped<IEventBus, InMemoryEventBus>();
services.AddSingleton<IJWTService, JWTService>();
services.AddSingleton<IRefreshTokenService, RedisRefreshTokenService>();
services.AddSingleton<IDistributedLockFactory>(sp =>
{
var connection = sp.GetRequiredService<IConnectionMultiplexer>();
// 这里可以配置多个 Redis 节点提高安全性,单机运行传一个即可
return RedLockFactory.Create(new List<RedLockMultiplexer> { new RedLockMultiplexer(connection) });
});
return services;
}
public static IServiceCollection AddModelValidation(this IServiceCollection services, IConfiguration configuration)
{
services.Configure<ApiBehaviorOptions>(options =>
{
options.InvalidModelStateResponseFactory = context =>
{
var errors = context.ModelState
.Where(e => e.Value.Errors.Count > 0)
.Select(e => new
{
Field = e.Key,
Message = e.Value.Errors.First().ErrorMessage
});
Console.WriteLine(errors);
return new BadRequestObjectResult(new BaseResponse<object?>(CodeDefine.PARAMETER_ERROR.Code, errors.First().Message));
};
});
return services;
}
}
}

View File

@ -1,82 +1,82 @@
using AutoMapper;
using IM_API.Dtos;
using IM_API.Dtos.Auth;
using IM_API.Dtos.User;
using IM_API.Interface.Services;
using IM_API.Tools;
using IM_API.VOs.Auth;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace IM_API.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class AuthController : ControllerBase
{
private readonly ILogger<AuthController> _logger;
private readonly IAuthService _authService;
private readonly IUserService _userService;
private readonly IJWTService _jwtService;
private readonly IRefreshTokenService _refreshTokenService;
private readonly IConfiguration _configuration;
private IMapper _mapper;
public AuthController(ILogger<AuthController> logger, IAuthService authService,
IJWTService jwtService, IRefreshTokenService refreshTokenService,
IConfiguration configuration,IUserService userService,
IMapper mapper
)
{
_logger = logger;
_authService = authService;
_jwtService = jwtService;
_refreshTokenService = refreshTokenService;
_configuration = configuration;
_userService = userService;
_mapper = mapper;
}
[HttpPost]
public async Task<IActionResult> Login(LoginRequestDto dto)
{
Stopwatch sw = Stopwatch.StartNew();
var user = await _authService.LoginAsync(dto);
_logger.LogInformation("服务耗时: {ms}ms", sw.ElapsedMilliseconds);
var userInfo = _mapper.Map<UserInfoDto>(user);
_logger.LogInformation("序列化耗时: {ms}ms", sw.ElapsedMilliseconds);
//生成凭证
(string token,DateTime expiresAt) = _jwtService.CreateAccessTokenForUser(user.Id,user.Username,"user");
_logger.LogInformation("Token生成耗时: {ms}ms", sw.ElapsedMilliseconds);
//生成刷新凭证
string refreshToken = await _refreshTokenService.CreateRefreshTokenAsync(user.Id);
_logger.LogInformation("RefreshToken生成耗时: {ms}ms", sw.ElapsedMilliseconds);
var res = new BaseResponse<LoginVo>(new LoginVo(userInfo,token,refreshToken, expiresAt));
_logger.LogInformation("总耗时: {ms}ms", sw.ElapsedMilliseconds);
return Ok(res);
}
[HttpPost]
public async Task<IActionResult> Register(RegisterRequestDto dto)
{
var userInfo = await _authService.RegisterAsync(dto);
var res = new BaseResponse<UserInfoDto>(userInfo);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<LoginVo>),StatusCodes.Status200OK)]
public async Task<IActionResult> Refresh(RefreshDto dto)
{
(bool ok,int userId) = await _refreshTokenService.ValidateRefreshTokenAsync(dto.refreshToken);
if (!ok)
{
var err = new BaseResponse<LoginVo>(CodeDefine.AUTH_FAILED);
return Unauthorized(err);
}
var userinfo = await _userService.GetUserInfoAsync(userId);
(string token,DateTime expiresAt) = _jwtService.CreateAccessTokenForUser(userinfo.Id,userinfo.Username,"user");
var res = new BaseResponse<LoginVo>(new LoginVo(userinfo,token, dto.refreshToken, expiresAt));
return Ok(res);
}
}
}
using AutoMapper;
using IM_API.Dtos;
using IM_API.Dtos.Auth;
using IM_API.Dtos.User;
using IM_API.Interface.Services;
using IM_API.Tools;
using IM_API.VOs.Auth;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace IM_API.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class AuthController : ControllerBase
{
private readonly ILogger<AuthController> _logger;
private readonly IAuthService _authService;
private readonly IUserService _userService;
private readonly IJWTService _jwtService;
private readonly IRefreshTokenService _refreshTokenService;
private readonly IConfiguration _configuration;
private IMapper _mapper;
public AuthController(ILogger<AuthController> logger, IAuthService authService,
IJWTService jwtService, IRefreshTokenService refreshTokenService,
IConfiguration configuration,IUserService userService,
IMapper mapper
)
{
_logger = logger;
_authService = authService;
_jwtService = jwtService;
_refreshTokenService = refreshTokenService;
_configuration = configuration;
_userService = userService;
_mapper = mapper;
}
[HttpPost]
public async Task<IActionResult> Login(LoginRequestDto dto)
{
Stopwatch sw = Stopwatch.StartNew();
var user = await _authService.LoginAsync(dto);
_logger.LogInformation("服务耗时: {ms}ms", sw.ElapsedMilliseconds);
var userInfo = _mapper.Map<UserInfoDto>(user);
_logger.LogInformation("序列化耗时: {ms}ms", sw.ElapsedMilliseconds);
//生成凭证
(string token,DateTime expiresAt) = _jwtService.CreateAccessTokenForUser(user.Id,user.Username,"user");
_logger.LogInformation("Token生成耗时: {ms}ms", sw.ElapsedMilliseconds);
//生成刷新凭证
string refreshToken = await _refreshTokenService.CreateRefreshTokenAsync(user.Id);
_logger.LogInformation("RefreshToken生成耗时: {ms}ms", sw.ElapsedMilliseconds);
var res = new BaseResponse<LoginVo>(new LoginVo(userInfo,token,refreshToken, expiresAt));
_logger.LogInformation("总耗时: {ms}ms", sw.ElapsedMilliseconds);
return Ok(res);
}
[HttpPost]
public async Task<IActionResult> Register(RegisterRequestDto dto)
{
var userInfo = await _authService.RegisterAsync(dto);
var res = new BaseResponse<UserInfoDto>(userInfo);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<LoginVo>),StatusCodes.Status200OK)]
public async Task<IActionResult> Refresh(RefreshDto dto)
{
(bool ok,int userId) = await _refreshTokenService.ValidateRefreshTokenAsync(dto.refreshToken);
if (!ok)
{
var err = new BaseResponse<LoginVo>(CodeDefine.AUTH_FAILED);
return Unauthorized(err);
}
var userinfo = await _userService.GetUserInfoAsync(userId);
(string token,DateTime expiresAt) = _jwtService.CreateAccessTokenForUser(userinfo.Id,userinfo.Username,"user");
var res = new BaseResponse<LoginVo>(new LoginVo(userinfo,token, dto.refreshToken, expiresAt));
return Ok(res);
}
}
}

View File

@ -1,56 +1,56 @@
using IM_API.Dtos;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.VOs.Conversation;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Route("api/[controller]/[action]")]
[Authorize]
[ApiController]
public class ConversationController : ControllerBase
{
private readonly IConversationService _conversationSerivice;
private readonly ILogger<ConversationController> _logger;
public ConversationController(IConversationService conversationSerivice, ILogger<ConversationController> logger)
{
_conversationSerivice = conversationSerivice;
_logger = logger;
}
[HttpGet]
public async Task<IActionResult> List()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var list = await _conversationSerivice.GetConversationsAsync(int.Parse(userIdStr));
var res = new BaseResponse<List<ConversationVo>>(list);
return Ok(res);
}
[HttpGet]
public async Task<IActionResult> Get([FromQuery]int conversationId)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var conversation = await _conversationSerivice.GetConversationByIdAsync(int.Parse(userIdStr), conversationId);
var res = new BaseResponse<ConversationVo>(conversation);
return Ok(res);
}
[HttpPost]
public async Task<IActionResult> Clear()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _conversationSerivice.ClearConversationsAsync(int.Parse(userIdStr));
return Ok(new BaseResponse<object?>());
}
[HttpPost]
public async Task<IActionResult> Delete(int cid)
{
await _conversationSerivice.DeleteConversationAsync(cid);
return Ok(new BaseResponse<object?>());
}
}
}
using IM_API.Dtos;
using IM_API.Interface.Services;
using IM_API.Models;
using IM_API.VOs.Conversation;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Route("api/[controller]/[action]")]
[Authorize]
[ApiController]
public class ConversationController : ControllerBase
{
private readonly IConversationService _conversationSerivice;
private readonly ILogger<ConversationController> _logger;
public ConversationController(IConversationService conversationSerivice, ILogger<ConversationController> logger)
{
_conversationSerivice = conversationSerivice;
_logger = logger;
}
[HttpGet]
public async Task<IActionResult> List()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var list = await _conversationSerivice.GetConversationsAsync(int.Parse(userIdStr));
var res = new BaseResponse<List<ConversationVo>>(list);
return Ok(res);
}
[HttpGet]
public async Task<IActionResult> Get([FromQuery]int conversationId)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var conversation = await _conversationSerivice.GetConversationByIdAsync(int.Parse(userIdStr), conversationId);
var res = new BaseResponse<ConversationVo>(conversation);
return Ok(res);
}
[HttpPost]
public async Task<IActionResult> Clear()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _conversationSerivice.ClearConversationsAsync(int.Parse(userIdStr));
return Ok(new BaseResponse<object?>());
}
[HttpPost]
public async Task<IActionResult> Delete(int cid)
{
await _conversationSerivice.DeleteConversationAsync(cid);
return Ok(new BaseResponse<object?>());
}
}
}

View File

@ -1,117 +1,117 @@
using IM_API.Dtos;
using IM_API.Dtos.Friend;
using IM_API.Interface.Services;
using IM_API.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class FriendController : ControllerBase
{
private readonly IFriendSerivce _friendService;
private readonly ILogger<FriendController> _logger;
public FriendController(IFriendSerivce friendService, ILogger<FriendController> logger)
{
_friendService = friendService;
_logger = logger;
}
/// <summary>
/// 发起好友请求
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Request(FriendRequestDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
dto.FromUserId = userId;
await _friendService.SendFriendRequestAsync(dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
/// <summary>
/// 获取好友请求列表
/// </summary>
/// <param name="isReceived"></param>
/// <param name="page"></param>
/// <param name="limit"></param>
/// <param name="desc"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Requests(int page,int limit,bool desc)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var list = await _friendService.GetFriendRequestListAsync(userId,page,limit,desc);
var res = new BaseResponse<List<FriendRequestResDto>>(list);
return Ok(res);
}
/// <summary>
/// 处理好友请求
/// </summary>
/// <param name="id"></param>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> HandleRequest(
[FromQuery]int id, [FromBody]FriendRequestHandleDto dto
)
{
await _friendService.HandleFriendRequestAsync(new HandleFriendRequestDto()
{
RequestId = id,
RemarkName = dto.RemarkName,
Action = dto.Action
});
var res = new BaseResponse<object?>();
return Ok(res);
}
/// <summary>
/// 获取好友列表
/// </summary>
/// <param name="page"></param>
/// <param name="limit"></param>
/// <param name="desc"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> List(int page,int limit,bool desc)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var list = await _friendService.GetFriendListAsync(userId,page,limit,desc);
var res = new BaseResponse<List<FriendInfoDto>>(list);
return Ok(res);
}
/// <summary>
/// 删除好友
/// </summary>
/// <param name="friendId"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Delete([FromRoute] int friendId)
{
//TODO: 这里存在安全问题当用户传入的id与用户无关时也可以删除成功待修复。
await _friendService.DeleteFriendAsync(friendId);
return Ok(new BaseResponse<object?>());
}
/// <summary>
/// 拉黑好友
/// </summary>
/// <param name="friendId"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Block([FromRoute] int friendId)
{
//TODO: 这里存在安全问题当用户传入的id与用户无关时也可以拉黑成功待修复。
await _friendService.BlockeFriendAsync(friendId);
return Ok(new BaseResponse<object?>());
}
}
}
using IM_API.Dtos;
using IM_API.Dtos.Friend;
using IM_API.Interface.Services;
using IM_API.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class FriendController : ControllerBase
{
private readonly IFriendSerivce _friendService;
private readonly ILogger<FriendController> _logger;
public FriendController(IFriendSerivce friendService, ILogger<FriendController> logger)
{
_friendService = friendService;
_logger = logger;
}
/// <summary>
/// 发起好友请求
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Request(FriendRequestDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
dto.FromUserId = userId;
await _friendService.SendFriendRequestAsync(dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
/// <summary>
/// 获取好友请求列表
/// </summary>
/// <param name="isReceived"></param>
/// <param name="page"></param>
/// <param name="limit"></param>
/// <param name="desc"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Requests(int page,int limit,bool desc)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var list = await _friendService.GetFriendRequestListAsync(userId,page,limit,desc);
var res = new BaseResponse<List<FriendRequestResDto>>(list);
return Ok(res);
}
/// <summary>
/// 处理好友请求
/// </summary>
/// <param name="id"></param>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> HandleRequest(
[FromQuery]int id, [FromBody]FriendRequestHandleDto dto
)
{
await _friendService.HandleFriendRequestAsync(new HandleFriendRequestDto()
{
RequestId = id,
RemarkName = dto.RemarkName,
Action = dto.Action
});
var res = new BaseResponse<object?>();
return Ok(res);
}
/// <summary>
/// 获取好友列表
/// </summary>
/// <param name="page"></param>
/// <param name="limit"></param>
/// <param name="desc"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> List(int page,int limit,bool desc)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var list = await _friendService.GetFriendListAsync(userId,page,limit,desc);
var res = new BaseResponse<List<FriendInfoDto>>(list);
return Ok(res);
}
/// <summary>
/// 删除好友
/// </summary>
/// <param name="friendId"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Delete([FromRoute] int friendId)
{
//TODO: 这里存在安全问题当用户传入的id与用户无关时也可以删除成功待修复。
await _friendService.DeleteFriendAsync(friendId);
return Ok(new BaseResponse<object?>());
}
/// <summary>
/// 拉黑好友
/// </summary>
/// <param name="friendId"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Block([FromRoute] int friendId)
{
//TODO: 这里存在安全问题当用户传入的id与用户无关时也可以拉黑成功待修复。
await _friendService.BlockeFriendAsync(friendId);
return Ok(new BaseResponse<object?>());
}
}
}

View File

@ -1,71 +1,71 @@
using IM_API.Dtos;
using IM_API.Dtos.Group;
using IM_API.Interface.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class GroupController : ControllerBase
{
private readonly IGroupService _groupService;
private readonly ILogger<GroupController> _logger;
public GroupController(IGroupService groupService, ILogger<GroupController> logger)
{
_groupService = groupService;
_logger = logger;
}
[HttpGet]
[ProducesResponseType(typeof(BaseResponse<List<GroupInfoDto>>) ,StatusCodes.Status200OK)]
public async Task<IActionResult> GetGroups(int page = 1, int limit = 100, bool desc = false)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var list = await _groupService.GetGroupListAsync(int.Parse(userIdStr), page, limit, desc);
var res = new BaseResponse<List<GroupInfoDto>>(list);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<GroupInfoDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> CreateGroup([FromBody]GroupCreateDto groupCreateDto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var groupInfo = await _groupService.CreateGroupAsync(int.Parse(userIdStr), groupCreateDto);
var res = new BaseResponse<GroupInfoDto>(groupInfo);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> HandleGroupInvite([FromBody]HandleGroupInviteDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier)!;
await _groupService.HandleGroupInviteAsync(int.Parse(userIdStr), dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> HandleGroupRequest([FromBody]HandleGroupRequestDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _groupService.HandleGroupRequestAsync(int.Parse(userIdStr),dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> InviteUser([FromBody]GroupInviteUserDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _groupService.InviteUsersAsync(int.Parse(userIdStr), dto.GroupId, dto.Ids);
var res = new BaseResponse<object?>();
return Ok(res);
}
}
}
using IM_API.Dtos;
using IM_API.Dtos.Group;
using IM_API.Interface.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class GroupController : ControllerBase
{
private readonly IGroupService _groupService;
private readonly ILogger<GroupController> _logger;
public GroupController(IGroupService groupService, ILogger<GroupController> logger)
{
_groupService = groupService;
_logger = logger;
}
[HttpGet]
[ProducesResponseType(typeof(BaseResponse<List<GroupInfoDto>>) ,StatusCodes.Status200OK)]
public async Task<IActionResult> GetGroups(int page = 1, int limit = 100, bool desc = false)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var list = await _groupService.GetGroupListAsync(int.Parse(userIdStr), page, limit, desc);
var res = new BaseResponse<List<GroupInfoDto>>(list);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<GroupInfoDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> CreateGroup([FromBody]GroupCreateDto groupCreateDto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var groupInfo = await _groupService.CreateGroupAsync(int.Parse(userIdStr), groupCreateDto);
var res = new BaseResponse<GroupInfoDto>(groupInfo);
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> HandleGroupInvite([FromBody]HandleGroupInviteDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier)!;
await _groupService.HandleGroupInviteAsync(int.Parse(userIdStr), dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> HandleGroupRequest([FromBody]HandleGroupRequestDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _groupService.HandleGroupRequestAsync(int.Parse(userIdStr),dto);
var res = new BaseResponse<object?>();
return Ok(res);
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<object?>), StatusCodes.Status200OK)]
public async Task<IActionResult> InviteUser([FromBody]GroupInviteUserDto dto)
{
string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _groupService.InviteUsersAsync(int.Parse(userIdStr), dto.GroupId, dto.Ids);
var res = new BaseResponse<object?>();
return Ok(res);
}
}
}

View File

@ -1,55 +1,55 @@
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Message;
using IM_API.Interface.Services;
using IM_API.VOs.Message;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class MessageController : ControllerBase
{
private readonly IMessageSevice _messageService;
private readonly ILogger<MessageController> _logger;
private readonly IEventBus _eventBus;
public MessageController(IMessageSevice messageService, ILogger<MessageController> logger, IEventBus eventBus)
{
_messageService = messageService;
_logger = logger;
_eventBus = eventBus;
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<MessageBaseVo>), StatusCodes.Status200OK)]
public async Task<IActionResult> SendMessage(MessageBaseDto dto)
{
var userIdstr = User.FindFirstValue(ClaimTypes.NameIdentifier);
MessageBaseVo messageBaseVo = new MessageBaseVo();
if(dto.ChatType == Models.ChatType.PRIVATE)
{
messageBaseVo = await _messageService.SendPrivateMessageAsync(int.Parse(userIdstr), dto.ReceiverId, dto);
}
else
{
messageBaseVo = await _messageService.SendGroupMessageAsync(int.Parse(userIdstr), dto.ReceiverId, dto);
}
return Ok(new BaseResponse<MessageBaseVo>(messageBaseVo));
}
[HttpGet]
[ProducesResponseType(typeof(BaseResponse<List<MessageBaseVo>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetMessageList([FromQuery]MessageQueryDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var msgList = await _messageService.GetMessagesAsync(int.Parse(userIdStr),dto);
var res = new BaseResponse<List<MessageBaseVo>>(msgList);
return Ok(res);
}
}
}
using IM_API.Application.Interfaces;
using IM_API.Domain.Events;
using IM_API.Dtos;
using IM_API.Dtos.Message;
using IM_API.Interface.Services;
using IM_API.VOs.Message;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class MessageController : ControllerBase
{
private readonly IMessageSevice _messageService;
private readonly ILogger<MessageController> _logger;
private readonly IEventBus _eventBus;
public MessageController(IMessageSevice messageService, ILogger<MessageController> logger, IEventBus eventBus)
{
_messageService = messageService;
_logger = logger;
_eventBus = eventBus;
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<MessageBaseVo>), StatusCodes.Status200OK)]
public async Task<IActionResult> SendMessage(MessageBaseDto dto)
{
var userIdstr = User.FindFirstValue(ClaimTypes.NameIdentifier);
MessageBaseVo messageBaseVo = new MessageBaseVo();
if(dto.ChatType == Models.ChatType.PRIVATE)
{
messageBaseVo = await _messageService.SendPrivateMessageAsync(int.Parse(userIdstr), dto.ReceiverId, dto);
}
else
{
messageBaseVo = await _messageService.SendGroupMessageAsync(int.Parse(userIdstr), dto.ReceiverId, dto);
}
return Ok(new BaseResponse<MessageBaseVo>(messageBaseVo));
}
[HttpGet]
[ProducesResponseType(typeof(BaseResponse<List<MessageBaseVo>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetMessageList([FromQuery]MessageQueryDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
var msgList = await _messageService.GetMessagesAsync(int.Parse(userIdStr),dto);
var res = new BaseResponse<List<MessageBaseVo>>(msgList);
return Ok(res);
}
}
}

View File

@ -1,114 +1,114 @@
using IM_API.Dtos;
using IM_API.Dtos.User;
using IM_API.Interface.Services;
using IM_API.Tools;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class UserController : ControllerBase
{
private readonly IUserService _userService;
private readonly ILogger<UserController> _logger;
public UserController(IUserService userService, ILogger<UserController> logger)
{
_userService = userService;
_logger = logger;
}
/// <summary>
/// 获取当前用户信息
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Me()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var userinfo = await _userService.GetUserInfoAsync(userId);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 修改用户资料
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Profile(UpdateUserDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var userinfo = await _userService.UpdateUserAsync(userId, dto);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// ID查询用户
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Find(int userId)
{
var userinfo = await _userService.GetUserInfoAsync(userId);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 用户名查询用户
/// </summary>
/// <param name="username"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> FindByUsername(string username)
{
var userinfo = await _userService.GetUserInfoByUsernameAsync(username);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 重置用户密码
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> ResetPassword(PasswordResetDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
await _userService.ResetPasswordAsync(userId, dto.OldPassword, dto.Password);
return Ok(new BaseResponse<object?>());
}
/// <summary>
/// 设置在线状态
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> SetOnlineStatus(OnlineStatusSetDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
await _userService.UpdateOlineStatusAsync(userId, dto.OnlineStatus);
return Ok(new BaseResponse<object?>());
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<List<UserInfoDto>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetUserList([FromBody][Required]List<int> ids)
{
var users = await _userService.GetUserInfoListAsync(ids);
var res = new BaseResponse<List<UserInfoDto>>(users);
return Ok(res);
}
}
}
using IM_API.Dtos;
using IM_API.Dtos.User;
using IM_API.Interface.Services;
using IM_API.Tools;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
namespace IM_API.Controllers
{
[Authorize]
[Route("api/[controller]/[action]")]
[ApiController]
public class UserController : ControllerBase
{
private readonly IUserService _userService;
private readonly ILogger<UserController> _logger;
public UserController(IUserService userService, ILogger<UserController> logger)
{
_userService = userService;
_logger = logger;
}
/// <summary>
/// 获取当前用户信息
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Me()
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var userinfo = await _userService.GetUserInfoAsync(userId);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 修改用户资料
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Profile(UpdateUserDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
var userinfo = await _userService.UpdateUserAsync(userId, dto);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// ID查询用户
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> Find(int userId)
{
var userinfo = await _userService.GetUserInfoAsync(userId);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 用户名查询用户
/// </summary>
/// <param name="username"></param>
/// <returns></returns>
[HttpGet]
public async Task<IActionResult> FindByUsername(string username)
{
var userinfo = await _userService.GetUserInfoByUsernameAsync(username);
var res = new BaseResponse<UserInfoDto>(userinfo);
return Ok(res);
}
/// <summary>
/// 重置用户密码
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> ResetPassword(PasswordResetDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
await _userService.ResetPasswordAsync(userId, dto.OldPassword, dto.Password);
return Ok(new BaseResponse<object?>());
}
/// <summary>
/// 设置在线状态
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> SetOnlineStatus(OnlineStatusSetDto dto)
{
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
int userId = int.Parse(userIdStr);
await _userService.UpdateOlineStatusAsync(userId, dto.OnlineStatus);
return Ok(new BaseResponse<object?>());
}
[HttpPost]
[ProducesResponseType(typeof(BaseResponse<List<UserInfoDto>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetUserList([FromBody][Required]List<int> ids)
{
var users = await _userService.GetUserInfoListAsync(ids);
var res = new BaseResponse<List<UserInfoDto>>(users);
return Ok(res);
}
}
}

View File

@ -1,30 +1,30 @@
# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# 此阶段用于生成服务项目
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["IM_API.csproj", "."]
RUN dotnet restore "./IM_API.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "./IM_API.csproj" -c $BUILD_CONFIGURATION -o /app/build
# 此阶段用于发布要复制到最终阶段的服务项目
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./IM_API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# 此阶段用于生成服务项目
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["IM_API.csproj", "."]
RUN dotnet restore "./IM_API.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "./IM_API.csproj" -c $BUILD_CONFIGURATION -o /app/build
# 此阶段用于发布要复制到最终阶段的服务项目
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./IM_API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "IM_API.dll"]

View File

@ -1,13 +1,13 @@
using IM_API.Domain.Interfaces;
namespace IM_API.Domain.Events
{
public abstract record DomainEvent: IEvent
{
public Guid EventId { get; init; } = Guid.NewGuid();
public DateTimeOffset OccurredAt { get; init; } = DateTime.Now;
public long OperatorId { get; init; }
public string AggregateId { get; init; } = "";
public abstract string EventType { get; }
}
}
using IM_API.Domain.Interfaces;
namespace IM_API.Domain.Events
{
public abstract record DomainEvent: IEvent
{
public Guid EventId { get; init; } = Guid.NewGuid();
public DateTimeOffset OccurredAt { get; init; } = DateTime.Now;
public long OperatorId { get; init; }
public string AggregateId { get; init; } = "";
public abstract string EventType { get; }
}
}

View File

@ -1,25 +1,25 @@
using IM_API.Dtos.Friend;
namespace IM_API.Domain.Events
{
public record FriendAddEvent:DomainEvent
{
public override string EventType => "IM.FRIENDS_FRIEND_ADD";
/// <summary>
/// 发起请求用户
/// </summary>
public int RequestUserId { get; init; }
public string? requestUserRemarkname { get; init; }
/// <summary>
/// 接受请求用户
/// </summary>
public int ResponseUserId { get; init; }
public FriendRequestDto RequestInfo { get; init; }
/// <summary>
/// 好友关系创建时间
/// </summary>
public DateTimeOffset Created { get; init; }
}
}
using IM_API.Dtos.Friend;
namespace IM_API.Domain.Events
{
public record FriendAddEvent:DomainEvent
{
public override string EventType => "IM.FRIENDS_FRIEND_ADD";
/// <summary>
/// 发起请求用户
/// </summary>
public int RequestUserId { get; init; }
public string? requestUserRemarkname { get; init; }
/// <summary>
/// 接受请求用户
/// </summary>
public int ResponseUserId { get; init; }
public FriendRequestDto RequestInfo { get; init; }
/// <summary>
/// 好友关系创建时间
/// </summary>
public DateTimeOffset Created { get; init; }
}
}

View File

@ -1,14 +1,14 @@
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupInviteActionUpdateEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_INVITE_UPDATE";
public int UserId { get; set; }
public int InviteUserId { get; set; }
public int InviteId { get; set; }
public int GroupId { get; set; }
public GroupInviteState Action { get; set; }
}
}
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupInviteActionUpdateEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_INVITE_UPDATE";
public int UserId { get; set; }
public int InviteUserId { get; set; }
public int InviteId { get; set; }
public int GroupId { get; set; }
public GroupInviteState Action { get; set; }
}
}

View File

@ -1,10 +1,10 @@
namespace IM_API.Domain.Events
{
public record GroupInviteEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_INVITE_ADD";
public required List<int> Ids { get; init; }
public int GroupId { get; init; }
public int UserId { get; init; }
}
}
namespace IM_API.Domain.Events
{
public record GroupInviteEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_INVITE_ADD";
public required List<int> Ids { get; init; }
public int GroupId { get; init; }
public int UserId { get; init; }
}
}

View File

@ -1,10 +1,10 @@
namespace IM_API.Domain.Events
{
public record GroupJoinEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_MEMBER_ADD";
public int UserId { get; set; }
public int GroupId { get; set; }
public bool IsCreated { get; set; } = false;
}
}
namespace IM_API.Domain.Events
{
public record GroupJoinEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_MEMBER_ADD";
public int UserId { get; set; }
public int GroupId { get; set; }
public bool IsCreated { get; set; } = false;
}
}

View File

@ -1,15 +1,15 @@
using IM_API.Dtos.Group;
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupRequestEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_GROUP_REQUEST";
public int GroupId { get; init; }
public int UserId { get; set; }
public string Description { get; set; }
public GroupRequestState Action { get; set; }
}
}
using IM_API.Dtos.Group;
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupRequestEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_GROUP_REQUEST";
public int GroupId { get; init; }
public int UserId { get; set; }
public string Description { get; set; }
public GroupRequestState Action { get; set; }
}
}

View File

@ -1,14 +1,14 @@
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupRequestUpdateEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_REQUEST_UPDATE";
public int UserId { get; set; }
public int GroupId { get; set; }
public int AdminUserId { get; set; }
public int RequestId { get; set; }
public GroupRequestState Action { get; set; }
}
}
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record GroupRequestUpdateEvent : DomainEvent
{
public override string EventType => "IM.GROUPS_REQUEST_UPDATE";
public int UserId { get; set; }
public int GroupId { get; set; }
public int AdminUserId { get; set; }
public int RequestId { get; set; }
public GroupRequestState Action { get; set; }
}
}

View File

@ -1,23 +1,23 @@
using IM_API.Dtos;
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record MessageCreatedEvent : DomainEvent
{
public override string EventType => "IM.MESSAGE.MESSAGE_CREATED";
public ChatType ChatType { get; set; }
public MessageMsgType MessageMsgType { get; set; }
public long SequenceId { get; set; }
public string MessageContent { get; set; }
public int MsgSenderId { get; set; }
public int MsgRecipientId { get; set; }
public MessageState State { get; set; }
public DateTimeOffset MessageCreated { get; set; }
public string StreamKey { get; set; }
public Guid ClientMsgId { get; set; }
}
}
using IM_API.Dtos;
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record MessageCreatedEvent : DomainEvent
{
public override string EventType => "IM.MESSAGE.MESSAGE_CREATED";
public ChatType ChatType { get; set; }
public MessageMsgType MessageMsgType { get; set; }
public long SequenceId { get; set; }
public string MessageContent { get; set; }
public int MsgSenderId { get; set; }
public int MsgRecipientId { get; set; }
public MessageState State { get; set; }
public DateTimeOffset MessageCreated { get; set; }
public string StreamKey { get; set; }
public Guid ClientMsgId { get; set; }
}
}

View File

@ -1,10 +1,10 @@
namespace IM_API.Domain.Events
{
public record RequestFriendEvent : DomainEvent
{
public override string EventType => "IM.FRIENDS_FRIEND_REQUEST";
public int FromUserId { get; init; }
public int ToUserId { get; init; }
public string Description { get; init; }
}
}
namespace IM_API.Domain.Events
{
public record RequestFriendEvent : DomainEvent
{
public override string EventType => "IM.FRIENDS_FRIEND_REQUEST";
public int FromUserId { get; init; }
public int ToUserId { get; init; }
public string Description { get; init; }
}
}

View File

@ -1,6 +1,6 @@
namespace IM_API.Domain.Interfaces
{
public interface IEvent
{
}
}
namespace IM_API.Domain.Interfaces
{
public interface IEvent
{
}
}

View File

@ -1,4 +1,4 @@
namespace IM_API.Dtos.Auth
{
public record RefreshDto(string refreshToken);
}
namespace IM_API.Dtos.Auth
{
public record RefreshDto(string refreshToken);
}

View File

@ -1,17 +1,17 @@
using IM_API.Tools;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Auth
{
public class LoginRequestDto
{
[Required(ErrorMessage = "用户名不能为空")]
[StringLength(20, ErrorMessage = "用户名不能超过20字符")]
[RegularExpression(@"^[A-Za-z0-9]+$",ErrorMessage = "")]
public string Username { get; set; }
[Required(ErrorMessage = "密码不能为空")]
[StringLength(50, ErrorMessage = "密码不能超过50字符")]
public string Password { get; set; }
}
}
using IM_API.Tools;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Auth
{
public class LoginRequestDto
{
[Required(ErrorMessage = "用户名不能为空")]
[StringLength(20, ErrorMessage = "用户名不能超过20字符")]
[RegularExpression(@"^[A-Za-z0-9]+$",ErrorMessage = "")]
public string Username { get; set; }
[Required(ErrorMessage = "密码不能为空")]
[StringLength(50, ErrorMessage = "密码不能超过50字符")]
public string Password { get; set; }
}
}

View File

@ -1,19 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Auth
{
public class RegisterRequestDto
{
[Required(ErrorMessage = "用户名不能为空")]
[MaxLength(20, ErrorMessage = "用户名不能超过20字符")]
[RegularExpression(@"^[A-Za-z0-9]+$", ErrorMessage = "")]
public string Username { get; set; }
[Required(ErrorMessage = "密码不能为空")]
[MaxLength(50, ErrorMessage = "密码不能超过50字符")]
public string Password { get; set; }
[Required(ErrorMessage = "昵称不能为空")]
[MaxLength(20, ErrorMessage = "昵称不能超过20字符")]
public string? NickName { get; set; }
}
}
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Auth
{
public class RegisterRequestDto
{
[Required(ErrorMessage = "用户名不能为空")]
[MaxLength(20, ErrorMessage = "用户名不能超过20字符")]
[RegularExpression(@"^[A-Za-z0-9]+$", ErrorMessage = "")]
public string Username { get; set; }
[Required(ErrorMessage = "密码不能为空")]
[MaxLength(50, ErrorMessage = "密码不能超过50字符")]
public string Password { get; set; }
[Required(ErrorMessage = "昵称不能为空")]
[MaxLength(20, ErrorMessage = "昵称不能超过20字符")]
public string? NickName { get; set; }
}
}

View File

@ -1,82 +1,82 @@
using IM_API.Tools;
namespace IM_API.Dtos
{
public class BaseResponse<T>
{
//响应状态码
public int Code { get; set; }
//响应消息
public string Message { get; set; }
//响应数据
public T? Data { get; set; }
/// <summary>
/// 默认成功响应返回
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
public BaseResponse(string msg,T data)
{
this.Code = 0;
this.Message = msg;
this.Data = data;
}
/// <summary>
/// 默认成功响应返回仅数据
/// </summary>
/// <param name="data"></param>
public BaseResponse(T data)
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = CodeDefine.SUCCESS.Message;
this.Data = data;
}
/// <summary>
/// 默认成功响应返回,不带数据
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
public BaseResponse(string msg)
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = msg;
}
/// <summary>
/// 非成功响应且带数据
/// </summary>
/// <param name="code"></param>
/// <param name="message"></param>
/// <param name="data"></param>
public BaseResponse(int code, string message, T? data)
{
Code = code;
Message = message;
Data = data;
}
/// <summary>
/// 非成功响应且不带数据
/// </summary>
/// <param name="code"></param>
/// <param name="message"></param>
/// <param name="data"></param>
public BaseResponse(int code, string message)
{
Code = code;
Message = message;
}
/// <summary>
/// 接受codedefine对象
/// </summary>
/// <param name="codeDefine"></param>
public BaseResponse(CodeDefine codeDefine)
{
this.Code = codeDefine.Code;
this.Message = codeDefine.Message;
}
public BaseResponse()
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = CodeDefine.SUCCESS.Message;
}
}
}
using IM_API.Tools;
namespace IM_API.Dtos
{
public class BaseResponse<T>
{
//响应状态码
public int Code { get; set; }
//响应消息
public string Message { get; set; }
//响应数据
public T? Data { get; set; }
/// <summary>
/// 默认成功响应返回
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
public BaseResponse(string msg,T data)
{
this.Code = 0;
this.Message = msg;
this.Data = data;
}
/// <summary>
/// 默认成功响应返回仅数据
/// </summary>
/// <param name="data"></param>
public BaseResponse(T data)
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = CodeDefine.SUCCESS.Message;
this.Data = data;
}
/// <summary>
/// 默认成功响应返回,不带数据
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
public BaseResponse(string msg)
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = msg;
}
/// <summary>
/// 非成功响应且带数据
/// </summary>
/// <param name="code"></param>
/// <param name="message"></param>
/// <param name="data"></param>
public BaseResponse(int code, string message, T? data)
{
Code = code;
Message = message;
Data = data;
}
/// <summary>
/// 非成功响应且不带数据
/// </summary>
/// <param name="code"></param>
/// <param name="message"></param>
/// <param name="data"></param>
public BaseResponse(int code, string message)
{
Code = code;
Message = message;
}
/// <summary>
/// 接受codedefine对象
/// </summary>
/// <param name="codeDefine"></param>
public BaseResponse(CodeDefine codeDefine)
{
this.Code = codeDefine.Code;
this.Message = codeDefine.Message;
}
public BaseResponse()
{
this.Code = CodeDefine.SUCCESS.Code;
this.Message = CodeDefine.SUCCESS.Message;
}
}
}

View File

@ -1,26 +1,26 @@
namespace IM_API.Dtos.Conversation
{
public class ClearConversationsDto
{
public int UserId { get; set; }
/// <summary>
/// 聊天类型
/// </summary>
public MsgChatType ChatType { get; set; }
/// <summary>
/// 目标ID聊天类型为群则为群id私聊为用户id
/// </summary>
public int TargetId { get; set; }
}
public enum MsgChatType
{
/// <summary>
/// 私聊
/// </summary>
single = 0,
/// <summary>
/// 私聊
/// </summary>
group = 1
}
}
namespace IM_API.Dtos.Conversation
{
public class ClearConversationsDto
{
public int UserId { get; set; }
/// <summary>
/// 聊天类型
/// </summary>
public MsgChatType ChatType { get; set; }
/// <summary>
/// 目标ID聊天类型为群则为群id私聊为用户id
/// </summary>
public int TargetId { get; set; }
}
public enum MsgChatType
{
/// <summary>
/// 私聊
/// </summary>
single = 0,
/// <summary>
/// 私聊
/// </summary>
group = 1
}
}

View File

@ -1,12 +1,12 @@
namespace IM_API.Dtos.Conversation
{
public class UpdateConversationDto
{
public string StreamKey { get; set; }
public int SenderId { get; set; }
public int ReceiptId { get; set; }
public string LastMessage { get; set; }
public long LastSequenceId { get; set; }
public DateTimeOffset DateTime { get; set; }
}
}
namespace IM_API.Dtos.Conversation
{
public class UpdateConversationDto
{
public string StreamKey { get; set; }
public int SenderId { get; set; }
public int ReceiptId { get; set; }
public string LastMessage { get; set; }
public long LastSequenceId { get; set; }
public DateTimeOffset DateTime { get; set; }
}
}

View File

@ -1,33 +1,33 @@
using IM_API.Dtos.User;
using IM_API.Models;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Friend
{
public record FriendInfoDto
{
public int Id { get; init; }
public int UserId { get; init; }
public int FriendId { get; init; }
public FriendStatus StatusEnum { get; init; }
public DateTimeOffset Created { get; init; }
public string RemarkName { get; init; } = string.Empty;
public string? Avatar { get; init; }
public UserInfoDto UserInfo { get; init; }
}
public record FriendRequestHandleDto
{
[Required(ErrorMessage = "操作必填")]
public HandleFriendRequestAction Action { get; init; }
[StringLength(20, ErrorMessage = "备注名最大20个字符")]
public string? RemarkName { get; init; }
}
}
using IM_API.Dtos.User;
using IM_API.Models;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Friend
{
public record FriendInfoDto
{
public int Id { get; init; }
public int UserId { get; init; }
public int FriendId { get; init; }
public FriendStatus StatusEnum { get; init; }
public DateTimeOffset Created { get; init; }
public string RemarkName { get; init; } = string.Empty;
public string? Avatar { get; init; }
public UserInfoDto UserInfo { get; init; }
}
public record FriendRequestHandleDto
{
[Required(ErrorMessage = "操作必填")]
public HandleFriendRequestAction Action { get; init; }
[StringLength(20, ErrorMessage = "备注名最大20个字符")]
public string? RemarkName { get; init; }
}
}

View File

@ -1,15 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Friend
{
public class FriendRequestDto
{
public int? FromUserId { get; set; }
public int ToUserId { get; set; }
[Required(ErrorMessage = "备注名必填")]
[StringLength(20, ErrorMessage = "备注名不能超过20位字符")]
public string? RemarkName { get; set; }
[StringLength(50, ErrorMessage = "描述不能超过50字符")]
public string? Description { get; set; }
}
}
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Friend
{
public class FriendRequestDto
{
public int? FromUserId { get; set; }
public int ToUserId { get; set; }
[Required(ErrorMessage = "备注名必填")]
[StringLength(20, ErrorMessage = "备注名不能超过20位字符")]
public string? RemarkName { get; set; }
[StringLength(50, ErrorMessage = "描述不能超过50字符")]
public string? Description { get; set; }
}
}

View File

@ -1,36 +1,36 @@
using IM_API.Models;
namespace IM_API.Dtos.Friend
{
public class FriendRequestResDto
{
public int Id { get; set; }
/// <summary>
/// 申请人
/// </summary>
public int RequestUser { get; set; }
/// <summary>
/// 被申请人
/// </summary>
public int ResponseUser { get; set; }
public string Avatar { get; set; }
public string NickName { get; set; }
/// <summary>
/// 申请时间
/// </summary>
public DateTimeOffset Created { get; set; }
/// <summary>
/// 申请附言
/// </summary>
public string? Description { get; set; }
/// <summary>
/// 申请状态0待通过,1:拒绝,2:同意,3拉黑
/// </summary>
public FriendRequestState State { get; set; }
}
}
using IM_API.Models;
namespace IM_API.Dtos.Friend
{
public class FriendRequestResDto
{
public int Id { get; set; }
/// <summary>
/// 申请人
/// </summary>
public int RequestUser { get; set; }
/// <summary>
/// 被申请人
/// </summary>
public int ResponseUser { get; set; }
public string Avatar { get; set; }
public string NickName { get; set; }
/// <summary>
/// 申请时间
/// </summary>
public DateTimeOffset Created { get; set; }
/// <summary>
/// 申请附言
/// </summary>
public string? Description { get; set; }
/// <summary>
/// 申请状态0待通过,1:拒绝,2:同意,3拉黑
/// </summary>
public FriendRequestState State { get; set; }
}
}

View File

@ -1,29 +1,29 @@
namespace IM_API.Dtos.Friend
{
public class HandleFriendRequestDto
{
/// <summary>
/// 好友请求Id
/// </summary>
public int RequestId { get; set; }
/// <summary>
/// 处理操作
/// </summary>
public HandleFriendRequestAction Action { get; set; }
/// <summary>
/// 好友备注名
/// </summary>
public string? RemarkName { get; set; }
}
public enum HandleFriendRequestAction
{
/// <summary>
/// 同意
/// </summary>
Accept = 0,
/// <summary>
/// 拒绝
/// </summary>
Reject = 1
}
}
namespace IM_API.Dtos.Friend
{
public class HandleFriendRequestDto
{
/// <summary>
/// 好友请求Id
/// </summary>
public int RequestId { get; set; }
/// <summary>
/// 处理操作
/// </summary>
public HandleFriendRequestAction Action { get; set; }
/// <summary>
/// 好友备注名
/// </summary>
public string? RemarkName { get; set; }
}
public enum HandleFriendRequestAction
{
/// <summary>
/// 同意
/// </summary>
Accept = 0,
/// <summary>
/// 拒绝
/// </summary>
Reject = 1
}
}

View File

@ -1,22 +1,22 @@
using IM_API.Models;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Group
{
public class GroupCreateDto
{
/// <summary>
/// 群聊名称
/// </summary>
[Required(ErrorMessage = "群名称必填")]
[MaxLength(20, ErrorMessage = "群名称不能大于20字符")]
public string Name { get; set; } = null!;
/// <summary>
/// 群头像
/// </summary>
[Required(ErrorMessage = "群头像必填")]
public string Avatar { get; set; } = null!;
public List<int>? UserIDs { get; set; }
}
}
using IM_API.Models;
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Group
{
public class GroupCreateDto
{
/// <summary>
/// 群聊名称
/// </summary>
[Required(ErrorMessage = "群名称必填")]
[MaxLength(20, ErrorMessage = "群名称不能大于20字符")]
public string Name { get; set; } = null!;
/// <summary>
/// 群头像
/// </summary>
[Required(ErrorMessage = "群头像必填")]
public string Avatar { get; set; } = null!;
public List<int>? UserIDs { get; set; }
}
}

View File

@ -1,51 +1,51 @@
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class GroupInfoDto
{
public int Id { get; set; }
/// <summary>
/// 群聊名称
/// </summary>
public string Name { get; set; } = null!;
/// <summary>
/// 群主
/// </summary>
public int GroupMaster { get; set; }
/// <summary>
/// 群权限
/// 0需管理员同意,1任意人可加群,2不允许任何人加入
/// </summary>
public GroupAuhority Auhority { get; set; }
/// <summary>
/// 全员禁言0允许发言2全员禁言
/// </summary>
public GroupAllMembersBanned AllMembersBanned { get; set; }
/// <summary>
/// 群聊状态
/// (1正常,2封禁)
/// </summary>
public GroupStatus Status { get; set; }
/// <summary>
/// 群公告
/// </summary>
public string? Announcement { get; set; }
/// <summary>
/// 群聊创建时间
/// </summary>
public DateTimeOffset Created { get; set; }
/// <summary>
/// 群头像
/// </summary>
public string Avatar { get; set; } = null!;
}
}
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class GroupInfoDto
{
public int Id { get; set; }
/// <summary>
/// 群聊名称
/// </summary>
public string Name { get; set; } = null!;
/// <summary>
/// 群主
/// </summary>
public int GroupMaster { get; set; }
/// <summary>
/// 群权限
/// 0需管理员同意,1任意人可加群,2不允许任何人加入
/// </summary>
public GroupAuhority Auhority { get; set; }
/// <summary>
/// 全员禁言0允许发言2全员禁言
/// </summary>
public GroupAllMembersBanned AllMembersBanned { get; set; }
/// <summary>
/// 群聊状态
/// (1正常,2封禁)
/// </summary>
public GroupStatus Status { get; set; }
/// <summary>
/// 群公告
/// </summary>
public string? Announcement { get; set; }
/// <summary>
/// 群聊创建时间
/// </summary>
public DateTimeOffset Created { get; set; }
/// <summary>
/// 群头像
/// </summary>
public string Avatar { get; set; } = null!;
}
}

View File

@ -1,8 +1,8 @@
namespace IM_API.Dtos.Group
{
public class GroupInviteUserDto
{
public int GroupId { get; set; }
public List<int> Ids { get; set; }
}
}
namespace IM_API.Dtos.Group
{
public class GroupInviteUserDto
{
public int GroupId { get; set; }
public List<int> Ids { get; set; }
}
}

View File

@ -1,11 +1,11 @@
namespace IM_API.Dtos.Group
{
public class GroupUpdateConversationDto
{
public int GroupId { get; set; }
public long MaxSequenceId { get; set; }
public string LastMessage { get; set; }
public string LastSenderName { get; set; }
public DateTimeOffset LastUpdateTime { get; set; }
}
}
namespace IM_API.Dtos.Group
{
public class GroupUpdateConversationDto
{
public int GroupId { get; set; }
public long MaxSequenceId { get; set; }
public string LastMessage { get; set; }
public string LastSenderName { get; set; }
public DateTimeOffset LastUpdateTime { get; set; }
}
}

View File

@ -1,10 +1,10 @@
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class HandleGroupInviteDto
{
public int InviteId { get; set; }
public GroupInviteState Action { get; set; }
}
}
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class HandleGroupInviteDto
{
public int InviteId { get; set; }
public GroupInviteState Action { get; set; }
}
}

View File

@ -1,10 +1,10 @@
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class HandleGroupRequestDto
{
public int RequestId { get; set; }
public GroupRequestState Action { get; set; }
}
}
using IM_API.Models;
namespace IM_API.Dtos.Group
{
public class HandleGroupRequestDto
{
public int RequestId { get; set; }
public GroupRequestState Action { get; set; }
}
}

View File

@ -1,49 +1,49 @@
using IM_API.Tools;
namespace IM_API.Dtos
{
public class HubResponse<T>
{
public int Code { get; init; }
public string Method { get; init; }
public HubResponseType Type { get; init; }
public string Message { get; init; }
public T? Data { get; init; }
public HubResponse(string method)
{
Code = CodeDefine.SUCCESS.Code;
Message = CodeDefine.SUCCESS.Message;
Type = HubResponseType.ActionStatus;
Method = method;
}
public HubResponse(string method,T data)
{
Code = CodeDefine.SUCCESS.Code;
Message = CodeDefine.SUCCESS.Message;
Type = HubResponseType.ActionStatus;
Data = data;
Method = method;
}
public HubResponse(CodeDefine codedefine,string method)
{
Code = codedefine.Code;
Method = method;
Message = codedefine.Message;
Type = HubResponseType.ActionStatus;
}
public HubResponse(CodeDefine codeDefine, string method, HubResponseType type, T? data)
{
Code = codeDefine.Code;
Method = method;
Type = type;
Message = codeDefine.Message;
Data = data;
}
}
public enum HubResponseType
{
ChatMsg = 1, // 聊天内容
SystemNotice = 2, // 系统通知(如:申请好友成功)
ActionStatus = 3 // 状态变更(如:对方正在输入、已读回执)
}
}
using IM_API.Tools;
namespace IM_API.Dtos
{
public class HubResponse<T>
{
public int Code { get; init; }
public string Method { get; init; }
public HubResponseType Type { get; init; }
public string Message { get; init; }
public T? Data { get; init; }
public HubResponse(string method)
{
Code = CodeDefine.SUCCESS.Code;
Message = CodeDefine.SUCCESS.Message;
Type = HubResponseType.ActionStatus;
Method = method;
}
public HubResponse(string method,T data)
{
Code = CodeDefine.SUCCESS.Code;
Message = CodeDefine.SUCCESS.Message;
Type = HubResponseType.ActionStatus;
Data = data;
Method = method;
}
public HubResponse(CodeDefine codedefine,string method)
{
Code = codedefine.Code;
Method = method;
Message = codedefine.Message;
Type = HubResponseType.ActionStatus;
}
public HubResponse(CodeDefine codeDefine, string method, HubResponseType type, T? data)
{
Code = codeDefine.Code;
Method = method;
Type = type;
Message = codeDefine.Message;
Data = data;
}
}
public enum HubResponseType
{
ChatMsg = 1, // 聊天内容
SystemNotice = 2, // 系统通知(如:申请好友成功)
ActionStatus = 3 // 状态变更(如:对方正在输入、已读回执)
}
}

View File

@ -1,18 +1,18 @@
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Message
{
public class MessageQueryDto
{
[Required(ErrorMessage = "会话ID必填")]
public int ConversationId { get; set; }
// 锚点序号(如果为空,说明是第一次进聊天框,拉最新的)
public long? Cursor { get; set; }
// 查询方向0 - 查旧(Before), 1 - 查新(After)
public int Direction { get; set; } = 0;
public int Limit { get; set; } = 20;
}
}
using System.ComponentModel.DataAnnotations;
namespace IM_API.Dtos.Message
{
public class MessageQueryDto
{
[Required(ErrorMessage = "会话ID必填")]
public int ConversationId { get; set; }
// 锚点序号(如果为空,说明是第一次进聊天框,拉最新的)
public long? Cursor { get; set; }
// 查询方向0 - 查旧(Before), 1 - 查新(After)
public int Direction { get; set; } = 0;
public int Limit { get; set; } = 20;
}
}

View File

@ -1,17 +1,17 @@
using IM_API.Models;
namespace IM_API.Dtos
{
public record MessageBaseDto
{
// 使用 { get; init; } 确保对象创建后不可修改,且支持无参构造
public MessageMsgType Type { get; init; } = default!;
public ChatType ChatType { get; init; } = default!;
public Guid MsgId { get; init; }
public int SenderId { get; init; }
public int ReceiverId { get; init; }
public string Content { get; init; } = default!;
public DateTimeOffset TimeStamp { get; init; }
public MessageBaseDto() { }
}
}
using IM_API.Models;
namespace IM_API.Dtos
{
public record MessageBaseDto
{
// 使用 { get; init; } 确保对象创建后不可修改,且支持无参构造
public MessageMsgType Type { get; init; } = default!;
public ChatType ChatType { get; init; } = default!;
public Guid MsgId { get; init; }
public int SenderId { get; init; }
public int ReceiverId { get; init; }
public string Content { get; init; } = default!;
public DateTimeOffset TimeStamp { get; init; }
public MessageBaseDto() { }
}
}

Some files were not shown because too many files have changed in this diff Show More