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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,149 +1,149 @@
using AutoMapper; using AutoMapper;
using IM_API.Domain.Events; using IM_API.Domain.Events;
using IM_API.Dtos.Friend; using IM_API.Dtos.Friend;
using IM_API.Exceptions; using IM_API.Exceptions;
using IM_API.Models; using IM_API.Models;
using IM_API.Services; using IM_API.Services;
using MassTransit; // 必须引入 using MassTransit; // 必须引入
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Moq; using Moq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;
public class FriendServiceTests public class FriendServiceTests
{ {
private readonly Mock<IPublishEndpoint> _mockEndpoint = new(); private readonly Mock<IPublishEndpoint> _mockEndpoint = new();
private readonly Mock<ILogger<FriendService>> _mockLogger = new(); private readonly Mock<ILogger<FriendService>> _mockLogger = new();
#region #region
private ImContext CreateDbContext() private ImContext CreateDbContext()
{ {
var options = new DbContextOptionsBuilder<ImContext>() var options = new DbContextOptionsBuilder<ImContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString()) // 确保每个测试数据库隔离 .UseInMemoryDatabase(Guid.NewGuid().ToString()) // 确保每个测试数据库隔离
.Options; .Options;
return new ImContext(options); return new ImContext(options);
} }
private IMapper CreateMapper() private IMapper CreateMapper()
{ {
var config = new MapperConfiguration(cfg => var config = new MapperConfiguration(cfg =>
{ {
// 补充你业务中实际需要的映射规则 // 补充你业务中实际需要的映射规则
cfg.CreateMap<Friend, FriendInfoDto>(); cfg.CreateMap<Friend, FriendInfoDto>();
cfg.CreateMap<FriendRequestDto, FriendRequest>(); cfg.CreateMap<FriendRequestDto, FriendRequest>();
cfg.CreateMap<FriendRequest, Friend>() cfg.CreateMap<FriendRequest, Friend>()
.ForMember(d => d.UserId, o => o.MapFrom(s => s.ResponseUser)) .ForMember(d => d.UserId, o => o.MapFrom(s => s.ResponseUser))
.ForMember(d => d.FriendId, o => o.MapFrom(s => s.RequestUser)); .ForMember(d => d.FriendId, o => o.MapFrom(s => s.RequestUser));
}); });
return config.CreateMapper(); return config.CreateMapper();
} }
private FriendService CreateService(ImContext context) private FriendService CreateService(ImContext context)
{ {
// 注入 Mock 对象和真实的 Mapper/Context // 注入 Mock 对象和真实的 Mapper/Context
return new FriendService(context, _mockLogger.Object, CreateMapper(), _mockEndpoint.Object); return new FriendService(context, _mockLogger.Object, CreateMapper(), _mockEndpoint.Object);
} }
#endregion #endregion
[Fact] [Fact]
public async Task SendFriendRequestAsync_Success_ShouldSaveAndPublish() public async Task SendFriendRequestAsync_Success_ShouldSaveAndPublish()
{ {
// Arrange // Arrange
var context = CreateDbContext(); var context = CreateDbContext();
context.Users.AddRange( context.Users.AddRange(
new User { Id = 1, Username = "Sender", Password = "..." }, new User { Id = 1, Username = "Sender", Password = "..." },
new User { Id = 2, Username = "Receiver", Password = "..." } new User { Id = 2, Username = "Receiver", Password = "..." }
); );
await context.SaveChangesAsync(); await context.SaveChangesAsync();
var service = CreateService(context); var service = CreateService(context);
var dto = new FriendRequestDto { ToUserId = 2, FromUserId = 2, Description = "Hello" , RemarkName = "测试备注" }; var dto = new FriendRequestDto { ToUserId = 2, FromUserId = 2, Description = "Hello" , RemarkName = "测试备注" };
// Act // Act
//var result = await service.SendFriendRequestAsync(dto); //var result = await service.SendFriendRequestAsync(dto);
// Assert // Assert
//Assert.True(result); //Assert.True(result);
//Assert.Single(context.FriendRequests); //Assert.Single(context.FriendRequests);
// 验证事件是否发布到了 MQ // 验证事件是否发布到了 MQ
/* /*
_mockEndpoint.Verify(x => x.Publish( _mockEndpoint.Verify(x => x.Publish(
It.Is<RequestFriendEvent>(e => e.FromUserId == 1 && e.ToUserId == 2), It.Is<RequestFriendEvent>(e => e.FromUserId == 1 && e.ToUserId == 2),
It.IsAny<CancellationToken>()), It.IsAny<CancellationToken>()),
Times.Once); Times.Once);
*/ */
} }
[Fact] [Fact]
public async Task SendFriendRequestAsync_UserNotFound_ShouldThrow() public async Task SendFriendRequestAsync_UserNotFound_ShouldThrow()
{ {
// Arrange // Arrange
var context = CreateDbContext(); var context = CreateDbContext();
var service = CreateService(context); var service = CreateService(context);
var dto = new FriendRequestDto { ToUserId = 99 }; // 不存在的用户 var dto = new FriendRequestDto { ToUserId = 99 }; // 不存在的用户
// Act & Assert // Act & Assert
await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(dto)); await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(dto));
} }
[Fact] [Fact]
public async Task SendFriendRequestAsync_AlreadyExists_ShouldThrow() public async Task SendFriendRequestAsync_AlreadyExists_ShouldThrow()
{ {
// Arrange // Arrange
var context = CreateDbContext(); var context = CreateDbContext();
context.Users.Add(new User { Id = 2, Password = "123", Username = "111" }); context.Users.Add(new User { Id = 2, Password = "123", Username = "111" });
context.FriendRequests.Add(new FriendRequest context.FriendRequests.Add(new FriendRequest
{ {
RequestUser = 1, RequestUser = 1,
ResponseUser = 2, ResponseUser = 2,
State = (sbyte)FriendRequestState.Pending, State = (sbyte)FriendRequestState.Pending,
RemarkName = "测试备注" RemarkName = "测试备注"
}); });
await context.SaveChangesAsync(); await context.SaveChangesAsync();
var service = CreateService(context); var service = CreateService(context);
// Act & Assert // Act & Assert
await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(new FriendRequestDto { ToUserId = 2 })); await Assert.ThrowsAsync<BaseException>(() => service.SendFriendRequestAsync(new FriendRequestDto { ToUserId = 2 }));
} }
[Fact] [Fact]
public async Task BlockFriendAsync_ValidId_ShouldUpdateStatus() public async Task BlockFriendAsync_ValidId_ShouldUpdateStatus()
{ {
// Arrange // Arrange
var context = CreateDbContext(); var context = CreateDbContext();
var friend = new Friend { Id = 50, UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added,RemarkName = "测试备注" }; var friend = new Friend { Id = 50, UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added,RemarkName = "测试备注" };
context.Friends.Add(friend); context.Friends.Add(friend);
await context.SaveChangesAsync(); await context.SaveChangesAsync();
var service = CreateService(context); var service = CreateService(context);
// Act // Act
await service.BlockeFriendAsync(50); await service.BlockeFriendAsync(50);
// Assert // Assert
var updated = await context.Friends.FindAsync(50); var updated = await context.Friends.FindAsync(50);
Assert.Equal(FriendStatus.Blocked, updated.StatusEnum); Assert.Equal(FriendStatus.Blocked, updated.StatusEnum);
} }
[Fact] [Fact]
public async Task GetFriendListAsync_ShouldFilterByStatus() public async Task GetFriendListAsync_ShouldFilterByStatus()
{ {
// Arrange // Arrange
var context = CreateDbContext(); var context = CreateDbContext();
context.Friends.AddRange( context.Friends.AddRange(
new Friend { UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added,RemarkName = "111" }, new Friend { UserId = 1, FriendId = 2, StatusEnum = FriendStatus.Added,RemarkName = "111" },
new Friend { UserId = 1, FriendId = 3, StatusEnum = FriendStatus.Blocked,RemarkName = "222" } new Friend { UserId = 1, FriendId = 3, StatusEnum = FriendStatus.Blocked,RemarkName = "222" }
); );
await context.SaveChangesAsync(); await context.SaveChangesAsync();
var service = CreateService(context); var service = CreateService(context);
// Act // Act
var result = await service.GetFriendListAsync(1, 1, 10, false); var result = await service.GetFriendListAsync(1, 1, 10, false);
// Assert // Assert
//Assert.Single(result); // 只应该拿到 Added 状态的 //Assert.Single(result); // 只应该拿到 Added 状态的
} }
} }

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1 +1 @@
6b62c789b9e1ecffdd986072b0521abee258fac28aa7e7d48b26a0309d21dc29 1b9e709aa84e0b4f6260cd10cf25bfc3a30c60e75a3966fc7d4cdf489eae898b

View File

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

View File

@ -1,9 +1,9 @@
// <auto-generated/> // <auto-generated/>
global using global::System; global using global::System;
global using global::System.Collections.Generic; global using global::System.Collections.Generic;
global using global::System.IO; global using global::System.IO;
global using global::System.Linq; global using global::System.Linq;
global using global::System.Net.Http; global using global::System.Net.Http;
global using global::System.Threading; global using global::System.Threading;
global using global::System.Threading.Tasks; global using global::System.Threading.Tasks;
global using global::Xunit; 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\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\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.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\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.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\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.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\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\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.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.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\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.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.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.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\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.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\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\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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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\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\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\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\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\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\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\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\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.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.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\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.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\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.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.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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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\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.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-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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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\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.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.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-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.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.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\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.dll
C:\Users\nanxun\Documents\IM\backend\IMTest\bin\Debug\net8.0\IM_API.pdb 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.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.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.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.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.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.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\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\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.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\IMTest.genruntimeconfig.cache
C:\Users\nanxun\Documents\IM\backend\IMTest\obj\Debug\net8.0\ref\IMTest.dll 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.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.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\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\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\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.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\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.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.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\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\System.Diagnostics.DiagnosticSource.dll

View File

@ -1 +1 @@
07435f2bd36dc0ae41e1e828c20bdeff31b846af84ec0e9fed50b185c0440047 07435f2bd36dc0ae41e1e828c20bdeff31b846af84ec0e9fed50b185c0440047

View File

@ -1,239 +1,239 @@
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {} "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {}
}, },
"projects": { "projects": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": { "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj", "projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"projectName": "IMTest", "projectName": "IMTest",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj", "projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\", "packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\", "outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config", "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.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
], ],
"originalTargetFrameworks": [ "originalTargetFrameworks": [
"net8.0" "net8.0"
], ],
"sources": { "sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {}, "C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {} "https://api.nuget.org/v3/index.json": {}
}, },
"frameworks": { "frameworks": {
"net8.0": { "net8.0": {
"targetAlias": "net8.0", "targetAlias": "net8.0",
"projectReferences": { "projectReferences": {
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": { "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj" "projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj"
} }
} }
} }
}, },
"warningProperties": { "warningProperties": {
"warnAsError": [ "warnAsError": [
"NU1605" "NU1605"
] ]
}, },
"restoreAuditProperties": { "restoreAuditProperties": {
"enableAudit": "true", "enableAudit": "true",
"auditLevel": "low", "auditLevel": "low",
"auditMode": "direct" "auditMode": "direct"
}, },
"SdkAnalysisLevel": "9.0.300" "SdkAnalysisLevel": "9.0.300"
}, },
"frameworks": { "frameworks": {
"net8.0": { "net8.0": {
"targetAlias": "net8.0", "targetAlias": "net8.0",
"dependencies": { "dependencies": {
"Microsoft.EntityFrameworkCore.InMemory": { "Microsoft.EntityFrameworkCore.InMemory": {
"target": "Package", "target": "Package",
"version": "[8.0.22, )" "version": "[8.0.22, )"
}, },
"Microsoft.NET.Test.Sdk": { "Microsoft.NET.Test.Sdk": {
"target": "Package", "target": "Package",
"version": "[17.8.0, )" "version": "[17.8.0, )"
}, },
"Moq": { "Moq": {
"target": "Package", "target": "Package",
"version": "[4.20.72, )" "version": "[4.20.72, )"
}, },
"coverlet.collector": { "coverlet.collector": {
"target": "Package", "target": "Package",
"version": "[6.0.0, )" "version": "[6.0.0, )"
}, },
"xunit": { "xunit": {
"target": "Package", "target": "Package",
"version": "[2.5.3, )" "version": "[2.5.3, )"
}, },
"xunit.runner.visualstudio": { "xunit.runner.visualstudio": {
"target": "Package", "target": "Package",
"version": "[2.5.3, )" "version": "[2.5.3, )"
} }
}, },
"imports": [ "imports": [
"net461", "net461",
"net462", "net462",
"net47", "net47",
"net471", "net471",
"net472", "net472",
"net48", "net48",
"net481" "net481"
], ],
"assetTargetFallback": true, "assetTargetFallback": true,
"warn": true, "warn": true,
"frameworkReferences": { "frameworkReferences": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json" "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json"
} }
} }
}, },
"C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": { "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj", "projectUniqueName": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"projectName": "IM_API", "projectName": "IM_API",
"projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj", "projectPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\IM_API.csproj",
"packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\", "packagesPath": "C:\\Users\\nanxun\\.nuget\\packages\\",
"outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\obj\\", "outputPath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IM_API\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\nanxun\\AppData\\Roaming\\NuGet\\NuGet.Config", "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.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
], ],
"originalTargetFrameworks": [ "originalTargetFrameworks": [
"net8.0" "net8.0"
], ],
"sources": { "sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {}, "C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {} "https://api.nuget.org/v3/index.json": {}
}, },
"frameworks": { "frameworks": {
"net8.0": { "net8.0": {
"targetAlias": "net8.0", "targetAlias": "net8.0",
"projectReferences": {} "projectReferences": {}
} }
}, },
"warningProperties": { "warningProperties": {
"warnAsError": [ "warnAsError": [
"NU1605" "NU1605"
] ]
}, },
"restoreAuditProperties": { "restoreAuditProperties": {
"enableAudit": "true", "enableAudit": "true",
"auditLevel": "low", "auditLevel": "low",
"auditMode": "direct" "auditMode": "direct"
}, },
"SdkAnalysisLevel": "9.0.300" "SdkAnalysisLevel": "9.0.300"
}, },
"frameworks": { "frameworks": {
"net8.0": { "net8.0": {
"targetAlias": "net8.0", "targetAlias": "net8.0",
"dependencies": { "dependencies": {
"AutoMapper": { "AutoMapper": {
"target": "Package", "target": "Package",
"version": "[12.0.1, )" "version": "[12.0.1, )"
}, },
"AutoMapper.Extensions.Microsoft.DependencyInjection": { "AutoMapper.Extensions.Microsoft.DependencyInjection": {
"target": "Package", "target": "Package",
"version": "[12.0.0, )" "version": "[12.0.0, )"
}, },
"MassTransit.RabbitMQ": { "MassTransit.RabbitMQ": {
"target": "Package", "target": "Package",
"version": "[8.5.5, )" "version": "[8.5.5, )"
}, },
"Microsoft.AspNetCore.Authentication.JwtBearer": { "Microsoft.AspNetCore.Authentication.JwtBearer": {
"target": "Package", "target": "Package",
"version": "[8.0.21, )" "version": "[8.0.21, )"
}, },
"Microsoft.AspNetCore.SignalR": { "Microsoft.AspNetCore.SignalR": {
"target": "Package", "target": "Package",
"version": "[1.2.0, )" "version": "[1.2.0, )"
}, },
"Microsoft.EntityFrameworkCore.Design": { "Microsoft.EntityFrameworkCore.Design": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All", "suppressParent": "All",
"target": "Package", "target": "Package",
"version": "[8.0.21, )" "version": "[8.0.21, )"
}, },
"Microsoft.EntityFrameworkCore.Tools": { "Microsoft.EntityFrameworkCore.Tools": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All", "suppressParent": "All",
"target": "Package", "target": "Package",
"version": "[8.0.21, )" "version": "[8.0.21, )"
}, },
"Microsoft.Extensions.Caching.StackExchangeRedis": { "Microsoft.Extensions.Caching.StackExchangeRedis": {
"target": "Package", "target": "Package",
"version": "[10.0.2, )" "version": "[10.0.2, )"
}, },
"Microsoft.VisualStudio.Azure.Containers.Tools.Targets": { "Microsoft.VisualStudio.Azure.Containers.Tools.Targets": {
"target": "Package", "target": "Package",
"version": "[1.22.1, )" "version": "[1.22.1, )"
}, },
"Newtonsoft.Json": { "Newtonsoft.Json": {
"target": "Package", "target": "Package",
"version": "[13.0.4, )" "version": "[13.0.4, )"
}, },
"Pomelo.EntityFrameworkCore.MySql": { "Pomelo.EntityFrameworkCore.MySql": {
"target": "Package", "target": "Package",
"version": "[8.0.3, )" "version": "[8.0.3, )"
}, },
"RedLock.net": { "RedLock.net": {
"target": "Package", "target": "Package",
"version": "[2.3.2, )" "version": "[2.3.2, )"
}, },
"StackExchange.Redis": { "StackExchange.Redis": {
"target": "Package", "target": "Package",
"version": "[2.9.32, )" "version": "[2.9.32, )"
}, },
"Swashbuckle.AspNetCore": { "Swashbuckle.AspNetCore": {
"target": "Package", "target": "Package",
"version": "[6.6.2, )" "version": "[6.6.2, )"
}, },
"System.IdentityModel.Tokens.Jwt": { "System.IdentityModel.Tokens.Jwt": {
"target": "Package", "target": "Package",
"version": "[8.14.0, )" "version": "[8.14.0, )"
} }
}, },
"imports": [ "imports": [
"net461", "net461",
"net462", "net462",
"net47", "net47",
"net471", "net471",
"net472", "net472",
"net48", "net48",
"net481" "net481"
], ],
"assetTargetFallback": true, "assetTargetFallback": true,
"warn": true, "warn": true,
"frameworkReferences": { "frameworkReferences": {
"Microsoft.AspNetCore.App": { "Microsoft.AspNetCore.App": {
"privateAssets": "none" "privateAssets": "none"
}, },
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.304/PortableRuntimeIdentifierGraph.json" "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"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess> <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> <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> <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\nanxun\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.1</NuGetToolVersion> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.1</NuGetToolVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\nanxun\.nuget\packages\" /> <SourceRoot Include="C:\Users\nanxun\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" /> <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup> </ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <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.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)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.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.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.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')" /> <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> </ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Pkgxunit_analyzers Condition=" '$(Pkgxunit_analyzers)' == '' ">C:\Users\nanxun\.nuget\packages\xunit.analyzers\1.4.0</Pkgxunit_analyzers> <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_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> <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> </PropertyGroup>
</Project> </Project>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <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)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.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.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.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)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')" /> <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> </ImportGroup>
</Project> </Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,176 +1,176 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "ueA0djhC8vQ=", "dgSpecHash": "ueA0djhC8vQ=",
"success": true, "success": true,
"projectFilePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj", "projectFilePath": "C:\\Users\\nanxun\\Documents\\IM\\backend\\IMTest\\IMTest.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
"C:\\Users\\nanxun\\.nuget\\packages\\automapper\\12.0.1\\automapper.12.0.1.nupkg.sha512", "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\\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\\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\\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\\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.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\\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.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.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\\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.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.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.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.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\\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.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\\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.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.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.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\\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.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\\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.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.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.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.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.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.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.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.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\\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.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.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.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.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.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.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.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.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.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\\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.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.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\\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.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.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.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\\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.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.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.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.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.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.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.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\\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.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.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.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.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.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.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.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.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.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.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\\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\\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\\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\\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\\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\\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\\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\\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\\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\\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.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.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.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\\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.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.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.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.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.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.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.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.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.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.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.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\\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\\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\\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.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.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\\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.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.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\\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.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.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.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.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.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.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.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\\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.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.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.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\\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\\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.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\\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.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.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\\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.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.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.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.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.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.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\\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\\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.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.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.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.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.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.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.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\\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.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.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\\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.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.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.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.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.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.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.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.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.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\\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.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.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.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\\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.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.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\\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.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.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.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\\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\\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.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.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.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.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.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.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" "C:\\Users\\nanxun\\.nuget\\packages\\xunit.runner.visualstudio\\2.5.3\\xunit.runner.visualstudio.2.5.3.nupkg.sha512"
], ],
"logs": [] "logs": []
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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