添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,15 @@
using GroupService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace GroupService.Infrastructure.Configs
{
public class GroupConfig : IEntityTypeConfiguration<Group>
{
public void Configure(EntityTypeBuilder<Group> builder)
{
builder.ToTable("groups");
}
}
}
@@ -0,0 +1,46 @@
using GroupService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace GroupService.Infrastructure.Configs
{
public class GroupInvitationConfig : IEntityTypeConfiguration<GroupInvitation>
{
public void Configure(EntityTypeBuilder<GroupInvitation> builder)
{
builder.ToTable("group_invitations");
builder.HasKey(x => x.Id);
builder.HasKey(x => new { x.GroupId, x.UserId });
builder.ComplexProperty(x => x.UserProfile, u =>
{
u.Property(p => p.Avatar)
.HasMaxLength(100);
u.Property(p => p.NickName)
.IsRequired()
.HasMaxLength(20);
});
builder.ComplexProperty(x => x.OperatorProfile, u =>
{
u.Property(p => p.Avatar)
.HasMaxLength(100);
u.Property(p => p.NickName)
.IsRequired()
.HasMaxLength(20);
});
builder.ComplexProperty(x => x.GroupProfile, u =>
{
u.Property(p => p.Avatar)
.IsRequired()
.HasMaxLength(100);
u.Property(p => p.GroupName)
.IsRequired()
.HasMaxLength(20);
});
}
}
}
@@ -0,0 +1,37 @@
using GroupService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace GroupService.Infrastructure.Configs
{
public class GroupJoinRequestConfig : IEntityTypeConfiguration<GroupJoinRequest>
{
public void Configure(EntityTypeBuilder<GroupJoinRequest> builder)
{
builder.ToTable("group_join_requests");
builder.HasKey(x => x.Id);
builder.HasKey(x => new { x.GroupId, x.UserId });
builder.ComplexProperty(x => x.UserProfile, u =>
{
u.Property(p => p.Avatar)
.HasMaxLength(100);
u.Property(p => p.NickName)
.IsRequired()
.HasMaxLength(20);
});
builder.ComplexProperty(x => x.GroupProfile, u =>
{
u.Property(p => p.Avatar)
.IsRequired()
.HasMaxLength(100);
u.Property(p => p.GroupName)
.IsRequired()
.HasMaxLength(20);
});
}
}
}
@@ -0,0 +1,14 @@
using GroupService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace GroupService.Infrastructure.Configs
{
public class GroupMemberConfig : IEntityTypeConfiguration<GroupMember>
{
public void Configure(EntityTypeBuilder<GroupMember> builder)
{
builder.ToTable("group_members");
}
}
}