From d9c01de00ca9cec0b0f4b7c09c5438440084c719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E9=9B=95=E3=81=AE=E6=96=B9=E5=9D=97?= Date: Thu, 28 Sep 2023 21:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=84=8F=E5=A4=96=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E9=87=8D=E5=A4=8D=E5=85=B3=E8=81=94=E8=A1=A8=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CommodityAPIController.cs | 6 +- .../Controllers/SpaceAPIController.cs | 1 + .../Infrastructure/AppDbContext.cs | 4 +- ...8124605_AddGCoinsAndCommodity.Designer.cs} | 120 +++++++----------- ...> 20230928124605_AddGCoinsAndCommodity.cs} | 62 ++------- .../Migrations/AppDbContextModelSnapshot.cs | 118 +++++++---------- .../Model/ApplicationUser.cs | 2 +- .../CnGalWebSite.DataModel/Model/Commodity.cs | 4 +- .../Components/Buttons/ClothesButton.razor | 2 +- .../Models/UserDataModel.cs | 4 +- .../CnGalWebSite.Shared.Layout/PCLayout.razor | 6 +- .../PC/Layout/LoginButton.razor | 2 +- 12 files changed, 119 insertions(+), 212 deletions(-) rename CnGalWebSite/CnGalWebSite.APIServer/Migrations/{20230928112113_AddGCoinsAndCommodity.Designer.cs => 20230928124605_AddGCoinsAndCommodity.Designer.cs} (99%) rename CnGalWebSite/CnGalWebSite.APIServer/Migrations/{20230928112113_AddGCoinsAndCommodity.cs => 20230928124605_AddGCoinsAndCommodity.cs} (74%) diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Controllers/CommodityAPIController.cs b/CnGalWebSite/CnGalWebSite.APIServer/Controllers/CommodityAPIController.cs index 88ab4914a..6992d884b 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Controllers/CommodityAPIController.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Controllers/CommodityAPIController.cs @@ -21,14 +21,14 @@ namespace CnGalWebSite.APIServer.Controllers public class CommodityAPIController : ControllerBase { private readonly IRepository _commodityRepository; - private readonly IRepository _commodityUserRepository; + private readonly IRepository _commodityUserRepository; private readonly IQueryService _queryService; private readonly IAppHelper _appHelper; private readonly IRepository _userRepository; private readonly IRepository _userIntegralRepository; private readonly IUserService _userService; - public CommodityAPIController(IRepository commodityRepository, IQueryService queryService, IAppHelper appHelper, IRepository userRepository, IRepository commodityUserRepository, + public CommodityAPIController(IRepository commodityRepository, IQueryService queryService, IAppHelper appHelper, IRepository userRepository, IRepository commodityUserRepository, IRepository userIntegralRepository, IUserService userService) { _commodityRepository= commodityRepository; @@ -191,7 +191,7 @@ public async Task BuyCommodity(BuyCommodityModel model) } await _userService.TryAddGCoins(user.Id, UserIntegralSourceType.BuyCommodity, -commodity.Price, $"给看板娘买{commodity.Name}"); - await _commodityUserRepository.InsertAsync(new CommodityApplicationUser + await _commodityUserRepository.InsertAsync(new ApplicationUserCommodity { ApplicationUserId = user.Id, CommodityId = commodity.Id, diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Controllers/SpaceAPIController.cs b/CnGalWebSite/CnGalWebSite.APIServer/Controllers/SpaceAPIController.cs index 215313492..064328c0b 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Controllers/SpaceAPIController.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Controllers/SpaceAPIController.cs @@ -625,6 +625,7 @@ public async Task> GetUserTasks() else { await _userService.TryAddGCoins(user.Id, UserIntegralSourceType.BindSteamId, 10, null); + model.IsBindSteamId = true; } } diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Infrastructure/AppDbContext.cs b/CnGalWebSite/CnGalWebSite.APIServer/Infrastructure/AppDbContext.cs index f348ae2cd..53c2ce337 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Infrastructure/AppDbContext.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Infrastructure/AppDbContext.cs @@ -100,7 +100,7 @@ public AppDbContext(DbContextOptions options) : base(options) public DbSet EntryInformationTypes { get; set; } public DbSet BasicEntryInformation { get; set; } public DbSet Commodities { get; set; } - public DbSet CommodityApplicationUsers { get; set; } + public DbSet ApplicationUserCommodities { get; set; } protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) @@ -171,7 +171,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity() .HasMany(e => e.Users) .WithMany(e => e.Commodities) - .UsingEntity(); + .UsingEntity(); //设置周边自身多对多关系 modelBuilder.Entity(entity => diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.Designer.cs b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.Designer.cs similarity index 99% rename from CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.Designer.cs rename to CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.Designer.cs index 45c2a3f4e..e2a739651 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.Designer.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.Designer.cs @@ -11,7 +11,7 @@ namespace CnGalWebSite.APIServer.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20230928112113_AddGCoinsAndCommodity")] + [Migration("20230928124605_AddGCoinsAndCommodity")] partial class AddGCoinsAndCommodity { /// @@ -22,21 +22,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("ProductVersion", "7.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); - modelBuilder.Entity("ApplicationUserCommodity", b => - { - b.Property("CommoditiesId") - .HasColumnType("bigint"); - - b.Property("UsersId") - .HasColumnType("varchar(255)"); - - b.HasKey("CommoditiesId", "UsersId"); - - b.HasIndex("UsersId"); - - b.ToTable("ApplicationUserCommodity"); - }); - modelBuilder.Entity("ArticleEntry", b => { b.Property("ArticlesId") @@ -279,7 +264,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) Id = "a18be9c0-aa65-4af8-bd17-00bd9344e575", AccessFailedCount = 0, CanComment = true, - ConcurrencyStamp = "f7625f82-d8a0-47c9-bab2-4b9a3799cd4b", + ConcurrencyStamp = "00dfc3c2-8d7e-4938-ad11-6b3de1305bf5", ContributionValue = 0, DisplayContributionValue = 0, DisplayIntegral = 0, @@ -301,13 +286,34 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) PasswordHash = "AQAAAAEAACcQAAAAEDecloBliZOnB0dNPQmr8qhoodaLmPdrKN10/bvLDrHaAJSxqWOnrEsvBhl5kzrZmQ==", PersonalSignature = "这个人太懒了,什么也没写额(~ ̄▽ ̄)~", PhoneNumberConfirmed = false, - RegistTime = new DateTime(2023, 9, 28, 19, 21, 13, 20, DateTimeKind.Utc).AddTicks(9432), + RegistTime = new DateTime(2023, 9, 28, 20, 46, 4, 578, DateTimeKind.Utc).AddTicks(5257), SecurityStamp = "", TwoFactorEnabled = false, UserName = "Admin" }); }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUserCommodity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ApplicationUserId") + .HasColumnType("varchar(255)"); + + b.Property("CommodityId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("CommodityId"); + + b.ToTable("ApplicationUserCommodities"); + }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.Article", b => { b.Property("Id") @@ -778,27 +784,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Commodities"); }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.CommodityApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("CommodityId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("CommodityId"); - - b.ToTable("CommodityApplicationUsers"); - }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.Disambig", b => { b.Property("Id") @@ -4008,21 +3993,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("VoteOptionVoteUser"); }); - modelBuilder.Entity("ApplicationUserCommodity", b => - { - b.HasOne("CnGalWebSite.DataModel.Model.Commodity", null) - .WithMany() - .HasForeignKey("CommoditiesId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", null) - .WithMany() - .HasForeignKey("UsersId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - modelBuilder.Entity("ArticleEntry", b => { b.HasOne("CnGalWebSite.DataModel.Model.Article", null) @@ -4068,6 +4038,24 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUserCommodity", b => + { + b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "ApplicationUser") + .WithMany("ApplicationUserCommodities") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("CnGalWebSite.DataModel.Model.Commodity", "Commodity") + .WithMany("ApplicationUserCommodities") + .HasForeignKey("CommodityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ApplicationUser"); + + b.Navigation("Commodity"); + }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.Article", b => { b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "CreateUser") @@ -4254,24 +4242,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Vote"); }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.CommodityApplicationUser", b => - { - b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "ApplicationUser") - .WithMany("CommodityApplicationUsers") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("CnGalWebSite.DataModel.Model.Commodity", "Commodity") - .WithMany("CommodityApplicationUsers") - .HasForeignKey("CommodityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Commodity"); - }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.Entry", b => { b.HasOne("CnGalWebSite.DataModel.Model.Disambig", "Disambig") @@ -5171,9 +5141,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUser", b => { - b.Navigation("Certification"); + b.Navigation("ApplicationUserCommodities"); - b.Navigation("CommodityApplicationUsers"); + b.Navigation("Certification"); b.Navigation("Examines"); @@ -5251,7 +5221,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("CnGalWebSite.DataModel.Model.Commodity", b => { - b.Navigation("CommodityApplicationUsers"); + b.Navigation("ApplicationUserCommodities"); }); modelBuilder.Entity("CnGalWebSite.DataModel.Model.Disambig", b => diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.cs b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.cs similarity index 74% rename from CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.cs rename to CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.cs index 9653a59f8..6bcffc69c 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928112113_AddGCoinsAndCommodity.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/20230928124605_AddGCoinsAndCommodity.cs @@ -72,33 +72,7 @@ protected override void Up(MigrationBuilder migrationBuilder) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "ApplicationUserCommodity", - columns: table => new - { - CommoditiesId = table.Column(type: "bigint", nullable: false), - UsersId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_ApplicationUserCommodity", x => new { x.CommoditiesId, x.UsersId }); - table.ForeignKey( - name: "FK_ApplicationUserCommodity_AspNetUsers_UsersId", - column: x => x.UsersId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ApplicationUserCommodity_Commodities_CommoditiesId", - column: x => x.CommoditiesId, - principalTable: "Commodities", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "CommodityApplicationUsers", + name: "ApplicationUserCommodities", columns: table => new { Id = table.Column(type: "bigint", nullable: false) @@ -109,15 +83,15 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_CommodityApplicationUsers", x => x.Id); + table.PrimaryKey("PK_ApplicationUserCommodities", x => x.Id); table.ForeignKey( - name: "FK_CommodityApplicationUsers_AspNetUsers_ApplicationUserId", + name: "FK_ApplicationUserCommodities_AspNetUsers_ApplicationUserId", column: x => x.ApplicationUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_CommodityApplicationUsers_Commodities_CommodityId", + name: "FK_ApplicationUserCommodities_Commodities_CommodityId", column: x => x.CommodityId, principalTable: "Commodities", principalColumn: "Id", @@ -130,7 +104,7 @@ protected override void Up(MigrationBuilder migrationBuilder) keyColumn: "Id", keyValue: "a18be9c0-aa65-4af8-bd17-00bd9344e575", columns: new[] { "ConcurrencyStamp", "GCoins", "RegistTime" }, - values: new object[] { "f7625f82-d8a0-47c9-bab2-4b9a3799cd4b", 0, new DateTime(2023, 9, 28, 19, 21, 13, 20, DateTimeKind.Utc).AddTicks(9432) }); + values: new object[] { "00dfc3c2-8d7e-4938-ad11-6b3de1305bf5", 0, new DateTime(2023, 9, 28, 20, 46, 4, 578, DateTimeKind.Utc).AddTicks(5257) }); migrationBuilder.CreateIndex( name: "IX_EntryInformationTypes_Name", @@ -139,35 +113,27 @@ protected override void Up(MigrationBuilder migrationBuilder) unique: true); migrationBuilder.CreateIndex( - name: "IX_ApplicationUserCommodity_UsersId", - table: "ApplicationUserCommodity", - column: "UsersId"); + name: "IX_ApplicationUserCommodities_ApplicationUserId", + table: "ApplicationUserCommodities", + column: "ApplicationUserId"); + + migrationBuilder.CreateIndex( + name: "IX_ApplicationUserCommodities_CommodityId", + table: "ApplicationUserCommodities", + column: "CommodityId"); migrationBuilder.CreateIndex( name: "IX_Commodities_Name", table: "Commodities", column: "Name", unique: true); - - migrationBuilder.CreateIndex( - name: "IX_CommodityApplicationUsers_ApplicationUserId", - table: "CommodityApplicationUsers", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_CommodityApplicationUsers_CommodityId", - table: "CommodityApplicationUsers", - column: "CommodityId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "ApplicationUserCommodity"); - - migrationBuilder.DropTable( - name: "CommodityApplicationUsers"); + name: "ApplicationUserCommodities"); migrationBuilder.DropTable( name: "Commodities"); diff --git a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/AppDbContextModelSnapshot.cs b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/AppDbContextModelSnapshot.cs index d82b3a1b3..f77f500f0 100644 --- a/CnGalWebSite/CnGalWebSite.APIServer/Migrations/AppDbContextModelSnapshot.cs +++ b/CnGalWebSite/CnGalWebSite.APIServer/Migrations/AppDbContextModelSnapshot.cs @@ -19,21 +19,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("ProductVersion", "7.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 64); - modelBuilder.Entity("ApplicationUserCommodity", b => - { - b.Property("CommoditiesId") - .HasColumnType("bigint"); - - b.Property("UsersId") - .HasColumnType("varchar(255)"); - - b.HasKey("CommoditiesId", "UsersId"); - - b.HasIndex("UsersId"); - - b.ToTable("ApplicationUserCommodity"); - }); - modelBuilder.Entity("ArticleEntry", b => { b.Property("ArticlesId") @@ -276,7 +261,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = "a18be9c0-aa65-4af8-bd17-00bd9344e575", AccessFailedCount = 0, CanComment = true, - ConcurrencyStamp = "f7625f82-d8a0-47c9-bab2-4b9a3799cd4b", + ConcurrencyStamp = "00dfc3c2-8d7e-4938-ad11-6b3de1305bf5", ContributionValue = 0, DisplayContributionValue = 0, DisplayIntegral = 0, @@ -298,13 +283,34 @@ protected override void BuildModel(ModelBuilder modelBuilder) PasswordHash = "AQAAAAEAACcQAAAAEDecloBliZOnB0dNPQmr8qhoodaLmPdrKN10/bvLDrHaAJSxqWOnrEsvBhl5kzrZmQ==", PersonalSignature = "这个人太懒了,什么也没写额(~ ̄▽ ̄)~", PhoneNumberConfirmed = false, - RegistTime = new DateTime(2023, 9, 28, 19, 21, 13, 20, DateTimeKind.Utc).AddTicks(9432), + RegistTime = new DateTime(2023, 9, 28, 20, 46, 4, 578, DateTimeKind.Utc).AddTicks(5257), SecurityStamp = "", TwoFactorEnabled = false, UserName = "Admin" }); }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUserCommodity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ApplicationUserId") + .HasColumnType("varchar(255)"); + + b.Property("CommodityId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("CommodityId"); + + b.ToTable("ApplicationUserCommodities"); + }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.Article", b => { b.Property("Id") @@ -775,27 +781,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Commodities"); }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.CommodityApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("CommodityId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("CommodityId"); - - b.ToTable("CommodityApplicationUsers"); - }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.Disambig", b => { b.Property("Id") @@ -4005,21 +3990,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("VoteOptionVoteUser"); }); - modelBuilder.Entity("ApplicationUserCommodity", b => - { - b.HasOne("CnGalWebSite.DataModel.Model.Commodity", null) - .WithMany() - .HasForeignKey("CommoditiesId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", null) - .WithMany() - .HasForeignKey("UsersId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - modelBuilder.Entity("ArticleEntry", b => { b.HasOne("CnGalWebSite.DataModel.Model.Article", null) @@ -4065,6 +4035,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUserCommodity", b => + { + b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "ApplicationUser") + .WithMany("ApplicationUserCommodities") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("CnGalWebSite.DataModel.Model.Commodity", "Commodity") + .WithMany("ApplicationUserCommodities") + .HasForeignKey("CommodityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ApplicationUser"); + + b.Navigation("Commodity"); + }); + modelBuilder.Entity("CnGalWebSite.DataModel.Model.Article", b => { b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "CreateUser") @@ -4251,24 +4239,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Vote"); }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.CommodityApplicationUser", b => - { - b.HasOne("CnGalWebSite.DataModel.Model.ApplicationUser", "ApplicationUser") - .WithMany("CommodityApplicationUsers") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("CnGalWebSite.DataModel.Model.Commodity", "Commodity") - .WithMany("CommodityApplicationUsers") - .HasForeignKey("CommodityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Commodity"); - }); - modelBuilder.Entity("CnGalWebSite.DataModel.Model.Entry", b => { b.HasOne("CnGalWebSite.DataModel.Model.Disambig", "Disambig") @@ -5168,9 +5138,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("CnGalWebSite.DataModel.Model.ApplicationUser", b => { - b.Navigation("Certification"); + b.Navigation("ApplicationUserCommodities"); - b.Navigation("CommodityApplicationUsers"); + b.Navigation("Certification"); b.Navigation("Examines"); @@ -5248,7 +5218,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("CnGalWebSite.DataModel.Model.Commodity", b => { - b.Navigation("CommodityApplicationUsers"); + b.Navigation("ApplicationUserCommodities"); }); modelBuilder.Entity("CnGalWebSite.DataModel.Model.Disambig", b => diff --git a/CnGalWebSite/CnGalWebSite.DataModel/Model/ApplicationUser.cs b/CnGalWebSite/CnGalWebSite.DataModel/Model/ApplicationUser.cs index 2b3b01906..839e6782b 100644 --- a/CnGalWebSite/CnGalWebSite.DataModel/Model/ApplicationUser.cs +++ b/CnGalWebSite/CnGalWebSite.DataModel/Model/ApplicationUser.cs @@ -154,7 +154,7 @@ public class ApplicationUser : IdentityUser public virtual ICollection ReviewEntries { get; set; } public virtual ICollection Commodities { get; set; } - public virtual ICollection CommodityApplicationUsers { get; set; } + public virtual ICollection ApplicationUserCommodities { get; set; } } diff --git a/CnGalWebSite/CnGalWebSite.DataModel/Model/Commodity.cs b/CnGalWebSite/CnGalWebSite.DataModel/Model/Commodity.cs index 3ad0fde66..6bb7d8c69 100644 --- a/CnGalWebSite/CnGalWebSite.DataModel/Model/Commodity.cs +++ b/CnGalWebSite/CnGalWebSite.DataModel/Model/Commodity.cs @@ -38,10 +38,10 @@ public class Commodity public int Priority { get; set; } public virtual ICollection Users { get; set; } - public virtual ICollection CommodityApplicationUsers { get; set; } + public virtual ICollection ApplicationUserCommodities { get; set; } } - public class CommodityApplicationUser + public class ApplicationUserCommodity { public long Id { get; set; } diff --git a/CnGalWebSite/CnGalWebSite.Kanban/Components/Buttons/ClothesButton.razor b/CnGalWebSite/CnGalWebSite.Kanban/Components/Buttons/ClothesButton.razor index d15afb839..2e6ad3caf 100644 --- a/CnGalWebSite/CnGalWebSite.Kanban/Components/Buttons/ClothesButton.razor +++ b/CnGalWebSite/CnGalWebSite.Kanban/Components/Buttons/ClothesButton.razor @@ -14,7 +14,7 @@ - +
衣服
@foreach (var item in _clothesRepository.GetAll()) diff --git a/CnGalWebSite/CnGalWebSite.Kanban/Models/UserDataModel.cs b/CnGalWebSite/CnGalWebSite.Kanban/Models/UserDataModel.cs index 341c36b39..11ea05b0a 100644 --- a/CnGalWebSite/CnGalWebSite.Kanban/Models/UserDataModel.cs +++ b/CnGalWebSite/CnGalWebSite.Kanban/Models/UserDataModel.cs @@ -17,7 +17,7 @@ public class UserDataModel public class ClothesDataModel { public string ClothesName { get; set; } - public string StockingsName { get; set; } = "stocking2"; - public string ShoesName { get; set; } = "shoes1"; + public string StockingsName { get; set; } + public string ShoesName { get; set; } } } diff --git a/CnGalWebSite/CnGalWebSite.Shared.Layout/PCLayout.razor b/CnGalWebSite/CnGalWebSite.Shared.Layout/PCLayout.razor index c572f7349..511cbedd0 100644 --- a/CnGalWebSite/CnGalWebSite.Shared.Layout/PCLayout.razor +++ b/CnGalWebSite/CnGalWebSite.Shared.Layout/PCLayout.razor @@ -19,11 +19,11 @@ - + - - + + diff --git a/CnGalWebSite/CnGalWebSite.Shared.MasaComponent/PC/Layout/LoginButton.razor b/CnGalWebSite/CnGalWebSite.Shared.MasaComponent/PC/Layout/LoginButton.razor index 56e93952e..894772cd6 100644 --- a/CnGalWebSite/CnGalWebSite.Shared.MasaComponent/PC/Layout/LoginButton.razor +++ b/CnGalWebSite/CnGalWebSite.Shared.MasaComponent/PC/Layout/LoginButton.razor @@ -2,7 +2,7 @@ - +