From 2f5d166ceff896e445598fb137c77bc3fc1e12c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8D=E6=BD=9C?= <1620556043@qq.com> Date: Tue, 25 Mar 2025 15:43:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=80=83=E8=AF=95?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=BC=96=E8=BE=91=E6=97=B6=EF=BC=8C=E8=80=83?= =?UTF-8?q?=E7=94=9F=E5=88=86=E7=BB=84=E6=B2=A1=E6=9C=89=E5=9B=9E=E5=A1=AB?= =?UTF-8?q?=E8=87=B3=E8=A1=A8=E5=8D=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ExamSetting/ExamSettingDto.cs | 6 ++++++ .../Dtos/ExamSetting/UpdateExamSettingDto.cs | 4 ++-- .../Dtos/Student/UpdateStudentDto.cs | 12 ++++++------ .../MappingProfiles/ExamSettingProfile.cs | 6 +++++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs b/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs index 5488a2d..770354f 100644 --- a/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs +++ b/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs @@ -98,6 +98,12 @@ public class ExamSettingDto [ListColumn(title: "name", subTitle: "description")] public List StudentGroups { get; set; } = []; + /// + /// 分组ID列表 + /// + [IgnoreColumn] + public List StudentGroupIds { get; set; } = new List(); + /// /// 创建时间 /// diff --git a/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/UpdateExamSettingDto.cs b/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/UpdateExamSettingDto.cs index 1cc9609..bd661d6 100644 --- a/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/UpdateExamSettingDto.cs +++ b/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/UpdateExamSettingDto.cs @@ -91,7 +91,7 @@ public class UpdateExamSettingDto [DisplayName("允许切屏次数")] [Range(0, 10, ErrorMessage = "允许切屏次数必须在0-10次之间")] public int AllowedScreenSwitchCount { get; set; } - + /// /// 参加考试的学生分组ID列表 /// @@ -108,5 +108,5 @@ public class UpdateExamSettingDto Clearable = true, Placeholder = "请选择参加考试的学生分组" )] - public List StudentGroupIds { get; set; } = []; + public List StudentGroupIds { get; set; } = new List(); } \ No newline at end of file diff --git a/Src/CodeSpirit.ExamApi/Dtos/Student/UpdateStudentDto.cs b/Src/CodeSpirit.ExamApi/Dtos/Student/UpdateStudentDto.cs index 14bf4b0..7c3f093 100644 --- a/Src/CodeSpirit.ExamApi/Dtos/Student/UpdateStudentDto.cs +++ b/Src/CodeSpirit.ExamApi/Dtos/Student/UpdateStudentDto.cs @@ -58,12 +58,12 @@ public class UpdateStudentDto Source = "${ROOT_API}/api/exam/StudentGroups", ValueField = "id", LabelField = "name", - Multiple = true, - JoinValues = false, - ExtractValue = true, - Searchable = true, - Clearable = true, - Placeholder = "请选择学生组" + Multiple = true, + JoinValues = false, + ExtractValue = true, + Searchable = true, + Clearable = true, + Placeholder = "请选择学生组" )] public List StudentGroupIds { get; set; } = new List(); } \ No newline at end of file diff --git a/Src/CodeSpirit.ExamApi/MappingProfiles/ExamSettingProfile.cs b/Src/CodeSpirit.ExamApi/MappingProfiles/ExamSettingProfile.cs index a0e2d7a..3a0d8e6 100644 --- a/Src/CodeSpirit.ExamApi/MappingProfiles/ExamSettingProfile.cs +++ b/Src/CodeSpirit.ExamApi/MappingProfiles/ExamSettingProfile.cs @@ -30,7 +30,11 @@ public class ExamSettingProfile : Profile CreateMap() .ForMember(dest => dest.ExamPaperName, opt => opt.MapFrom(src => src.ExamPaper.Name)) - .ForMember(dest => dest.StudentGroups, opt => opt.MapFrom(src => src.StudentGroups.Select(x => x.StudentGroup))); + .ForMember(dest => dest.StudentGroups, opt => opt.MapFrom(src => src.StudentGroups.Select(x => x.StudentGroup))) + .ForMember(dest => dest.StudentGroupIds, opt => opt.MapFrom(src => + src.StudentGroups != null ? + src.StudentGroups.Select(x => x.StudentGroup.Id).ToList() : + new List())); CreateMap(); CreateMap(); -- Gitee From 160ea2d831116d3b59834b047c61ef607ec21f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8D=E6=BD=9C?= <1620556043@qq.com> Date: Tue, 25 Mar 2025 16:51:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81jwtToken?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=E4=B8=BA3=E5=B0=8F?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/CodeSpirit.IdentityApi/Services/AuthService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/CodeSpirit.IdentityApi/Services/AuthService.cs b/Src/CodeSpirit.IdentityApi/Services/AuthService.cs index aab9529..c99293d 100644 --- a/Src/CodeSpirit.IdentityApi/Services/AuthService.cs +++ b/Src/CodeSpirit.IdentityApi/Services/AuthService.cs @@ -243,7 +243,7 @@ namespace CodeSpirit.IdentityApi.Services issuer: _issuer, audience: _audience, claims: claims, - expires: DateTime.Now.AddMinutes(_expirationMinutes), + expires: DateTime.Now.AddMinutes(180), signingCredentials: credentials ); -- Gitee