From 1cc24887b8dc6ed5df9706ecbcf1018671ffc8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Wed, 16 Jul 2025 09:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E4=BA=86=E5=AD=97=E6=AE=B5=E7=9A=84=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E5=85=B6=E7=AC=A6=E5=90=88=E7=8E=B0=E5=AE=9E?= =?UTF-8?q?=E8=A6=81=E6=B1=82=EF=BC=9B=E4=BF=AE=E6=94=B9=E4=BA=86=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E4=B8=BA=E5=AD=98Uct=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=88=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A7=84=E8=8C=83=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationDbContextModelSnapshot.cs | 40 +++++++++---------- AGSS/Models/Entities/MenuModel.cs | 20 +++++----- AGSS/Services/MenuService.cs | 8 ++-- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs b/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs index 950a7ef..490eb3c 100644 --- a/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs @@ -25,56 +25,56 @@ namespace AGSS.Migrations modelBuilder.Entity("AGSS.Models.Entities.MenuModel", b => { b.Property("Uuid") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); + .HasMaxLength(150) + .HasColumnType("character varying(150)"); b.Property("Adaptability") .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); + .HasMaxLength(120) + .HasColumnType("character varying(120)"); b.Property("Component") .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); + .HasMaxLength(1200) + .HasColumnType("character varying(1200)"); b.Property("CreateTime") .HasColumnType("timestamp with time zone"); b.Property("Icon") .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); + .HasMaxLength(300) + .HasColumnType("character varying(300)"); b.Property("Label") .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); + .HasMaxLength(300) + .HasColumnType("character varying(300)"); b.Property("MenuCode") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); b.Property("ParentId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); + .HasMaxLength(150) + .HasColumnType("character varying(150)"); b.Property("Path") .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); + .HasMaxLength(300) + .HasColumnType("character varying(300)"); b.Property("Query") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); + .HasMaxLength(10000) + .HasColumnType("character varying(10000)"); b.Property("Sort") .HasColumnType("integer"); b.Property("Status") .IsRequired() - .HasMaxLength(1) - .HasColumnType("character varying(1)"); + .HasMaxLength(20) + .HasColumnType("character varying(20)"); b.Property("UpdateTime") .HasColumnType("timestamp with time zone"); diff --git a/AGSS/Models/Entities/MenuModel.cs b/AGSS/Models/Entities/MenuModel.cs index 850de39..83f1693 100644 --- a/AGSS/Models/Entities/MenuModel.cs +++ b/AGSS/Models/Entities/MenuModel.cs @@ -5,36 +5,36 @@ namespace AGSS.Models.Entities; public class MenuModel { [Key] - [MaxLength(50)] + [MaxLength(150)] public string Uuid { get; set; } = string.Empty; - [MaxLength(50)] + [MaxLength(150)] public string? ParentId { get; set; } - [MaxLength(200)] + [MaxLength(300)] public string Path { get; set; } = string.Empty; - [MaxLength(100)] + [MaxLength(300)] public string Label { get; set; } = string.Empty; - [MaxLength(100)] + [MaxLength(300)] public string Icon { get; set; } = string.Empty; - [MaxLength(500)] + [MaxLength(1000)] public string? MenuCode { get; set; } - [MaxLength(20)] + [MaxLength(120)] public string Adaptability { get; set; } = "pc"; - [MaxLength(200)] + [MaxLength(1200)] public string Component { get; set; } = string.Empty; public int Sort { get; set; } - [MaxLength(1)] + [MaxLength(20)] public string Status { get; set; } = "1"; - [MaxLength(1000)] + [MaxLength(10000)] public string? Query { get; set; } public DateTime CreateTime { get; set; } = DateTime.Now; diff --git a/AGSS/Services/MenuService.cs b/AGSS/Services/MenuService.cs index 0307654..4d14ebb 100644 --- a/AGSS/Services/MenuService.cs +++ b/AGSS/Services/MenuService.cs @@ -35,7 +35,7 @@ public class MenuService Sort = request.Sort, Status = request.Status, Query = request.Query, - CreateTime = DateTime.Now + CreateTime = DateTime.UtcNow }; _context.Menus.Add(menu); @@ -82,7 +82,7 @@ public class MenuService menu.Sort = request.Sort; menu.Status = request.Status; menu.Query = request.Query; - menu.UpdateTime = DateTime.Now; + menu.UpdateTime = DateTime.UtcNow; await _context.SaveChangesAsync(); @@ -126,7 +126,7 @@ public class MenuService Sort = request.Sort, Status = request.Status, Query = request.Query, - CreateTime = DateTime.Now + CreateTime = DateTime.UtcNow }; _context.Menus.Add(menu); @@ -174,7 +174,7 @@ public class MenuService menu.Sort = request.Sort; menu.Status = request.Status; menu.Query = request.Query; - menu.UpdateTime = DateTime.Now; + menu.UpdateTime = DateTime.UtcNow; await _context.SaveChangesAsync();