diff --git a/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs b/Src/CodeSpirit.ExamApi/Dtos/ExamSetting/ExamSettingDto.cs index 5488a2d5c4f41abf71bba1a7ee38879ad01c1210..770354f4b614850ab43b766d48d294b4d68043b5 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 1cc9609040ccaf8bfdc5eda45dba0f98afe81431..bd661d6f64540cf5f76a055f0075f48ea53bb04a 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 14bf4b05a12b93d1f9699ad19f3bfd13d9da646f..7c3f09331d378660380009b721d2e929c1d7c23e 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 a0e2d7add8d72defdd9d90aa8ad927975f98e5fd..3a0d8e6f572c22ab26bd595fc524f70b64ad18f0 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(); diff --git a/Src/CodeSpirit.IdentityApi/Services/AuthService.cs b/Src/CodeSpirit.IdentityApi/Services/AuthService.cs index aab952937f7ef98c80139c221685d556daba3522..c99293dbd8bf0e68b5a7d06fc67ff6044f6fe7e2 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 );