生产环境
This commit is contained in:
@@ -10,31 +10,49 @@ public sealed class DatabaseInitializer(
|
||||
RoleManager<ApplicationRole> roleManager,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
DevelopmentSqliteMigrator sqliteMigrator,
|
||||
DevelopmentDemoDataSeeder developmentDemoDataSeeder,
|
||||
DatabaseOptions databaseOptions,
|
||||
IConfiguration configuration,
|
||||
IHostEnvironment environment,
|
||||
ILogger<DatabaseInitializer> logger)
|
||||
{
|
||||
public async Task InitializeAsync()
|
||||
public async Task InitializeAsync(bool migrateOnly = false)
|
||||
{
|
||||
if (environment.IsDevelopment())
|
||||
{
|
||||
if (migrateOnly)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"--migrate-only 仅用于非 Development 环境的 MySQL 数据库。");
|
||||
}
|
||||
|
||||
await db.Database.EnsureCreatedAsync();
|
||||
await sqliteMigrator.MigrateAsync();
|
||||
}
|
||||
else
|
||||
else if (migrateOnly || databaseOptions.ApplyMigrationsOnStartup)
|
||||
{
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var pendingMigrations = (await db.Database.GetPendingMigrationsAsync()).ToArray();
|
||||
if (pendingMigrations.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"数据库还有 {pendingMigrations.Length} 个待执行迁移。请在发布前运行 " +
|
||||
"'Jiaowu.Api --migrate-only',或显式配置 " +
|
||||
"Database:ApplyMigrationsOnStartup=true。");
|
||||
}
|
||||
}
|
||||
|
||||
if (migrateOnly)
|
||||
{
|
||||
logger.LogInformation("数据库迁移已完成。");
|
||||
return;
|
||||
}
|
||||
|
||||
await SeedRolesAsync();
|
||||
await SeedAdministratorAsync();
|
||||
await SeedCourseCategoriesAsync();
|
||||
|
||||
if (environment.IsDevelopment())
|
||||
{
|
||||
await SeedDevelopmentDataAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SeedRolesAsync()
|
||||
@@ -131,7 +149,11 @@ public sealed class DatabaseInitializer(
|
||||
.ToHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var (code, name, sortOrder) in defaults)
|
||||
{
|
||||
if (existingCodes.Contains(code)) continue;
|
||||
if (existingCodes.Contains(code))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
db.CourseCategories.Add(new CourseCategory
|
||||
{
|
||||
Code = code,
|
||||
@@ -159,523 +181,6 @@ public sealed class DatabaseInitializer(
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task SeedDevelopmentDataAsync()
|
||||
{
|
||||
if (!await db.Campuses.AnyAsync())
|
||||
{
|
||||
var campus = new Campus
|
||||
{
|
||||
Code = "MAIN",
|
||||
Name = "主校区",
|
||||
Address = "大学路 1 号"
|
||||
};
|
||||
var college = new College
|
||||
{
|
||||
Code = "CS",
|
||||
Name = "计算机学院",
|
||||
ShortName = "计算机学院",
|
||||
CampusId = campus.Id
|
||||
};
|
||||
var major = new Major
|
||||
{
|
||||
Code = "080901",
|
||||
Name = "计算机科学与技术",
|
||||
CollegeId = college.Id,
|
||||
DegreeType = "工学学士",
|
||||
SchoolingYears = 4
|
||||
};
|
||||
var building = new Building
|
||||
{
|
||||
Code = "J1",
|
||||
Name = "第一教学楼",
|
||||
CampusId = campus.Id
|
||||
};
|
||||
|
||||
db.AddRange(
|
||||
campus,
|
||||
college,
|
||||
major,
|
||||
new AdministrativeClass
|
||||
{
|
||||
Code = "CS2026-01",
|
||||
Name = "计科 2026-1 班",
|
||||
MajorId = major.Id,
|
||||
Grade = 2026,
|
||||
CounselorName = "陈老师"
|
||||
},
|
||||
building,
|
||||
new Classroom
|
||||
{
|
||||
Code = "J1-201",
|
||||
Name = "J1-201",
|
||||
BuildingId = building.Id,
|
||||
Capacity = 60,
|
||||
RoomType = "多媒体教室",
|
||||
Equipment = "投影、扩声、录播"
|
||||
},
|
||||
new AcademicTerm
|
||||
{
|
||||
Code = "2026-2027-1",
|
||||
Name = "2026—2027 学年第一学期",
|
||||
AcademicYear = "2026-2027",
|
||||
Season = TermSeason.Autumn,
|
||||
StartDate = new DateOnly(2026, 9, 7),
|
||||
EndDate = new DateOnly(2027, 1, 17),
|
||||
IsCurrent = true
|
||||
});
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
var computerCollege = await db.Colleges.SingleAsync(x => x.Code == "CS");
|
||||
var computerClass = await db.AdministrativeClasses
|
||||
.SingleAsync(x => x.Code == "CS2026-01");
|
||||
|
||||
if (!await db.Teachers.AnyAsync())
|
||||
{
|
||||
db.Teachers.AddRange(
|
||||
new Teacher
|
||||
{
|
||||
TeacherNumber = "T2026001",
|
||||
Name = "陈明远",
|
||||
Gender = Gender.Male,
|
||||
CollegeId = computerCollege.Id,
|
||||
Title = "副教授",
|
||||
Status = TeacherStatus.Active,
|
||||
HireDate = new DateOnly(2018, 7, 1),
|
||||
Email = "chenmy@example.edu.cn"
|
||||
},
|
||||
new Teacher
|
||||
{
|
||||
TeacherNumber = "T2026002",
|
||||
Name = "林书雅",
|
||||
Gender = Gender.Female,
|
||||
CollegeId = computerCollege.Id,
|
||||
Title = "讲师",
|
||||
Status = TeacherStatus.Active,
|
||||
HireDate = new DateOnly(2022, 9, 1),
|
||||
Email = "linsy@example.edu.cn"
|
||||
});
|
||||
}
|
||||
|
||||
if (!await db.Students.AnyAsync())
|
||||
{
|
||||
db.Students.AddRange(
|
||||
new Student
|
||||
{
|
||||
StudentNumber = "202601001",
|
||||
Name = "周启航",
|
||||
Gender = Gender.Male,
|
||||
AdministrativeClassId = computerClass.Id,
|
||||
EnrollmentYear = 2026,
|
||||
EnrollmentDate = new DateOnly(2026, 9, 7),
|
||||
Status = StudentStatus.Active
|
||||
},
|
||||
new Student
|
||||
{
|
||||
StudentNumber = "202601002",
|
||||
Name = "许知夏",
|
||||
Gender = Gender.Female,
|
||||
AdministrativeClassId = computerClass.Id,
|
||||
EnrollmentYear = 2026,
|
||||
EnrollmentDate = new DateOnly(2026, 9, 7),
|
||||
Status = StudentStatus.Active
|
||||
},
|
||||
new Student
|
||||
{
|
||||
StudentNumber = "202601003",
|
||||
Name = "方嘉树",
|
||||
Gender = Gender.Male,
|
||||
AdministrativeClassId = computerClass.Id,
|
||||
EnrollmentYear = 2026,
|
||||
EnrollmentDate = new DateOnly(2026, 9, 7),
|
||||
Status = StudentStatus.Active
|
||||
});
|
||||
}
|
||||
|
||||
var courseCategories = await db.CourseCategories
|
||||
.ToDictionaryAsync(x => x.Code, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
if (!await db.Courses.AnyAsync())
|
||||
{
|
||||
db.Courses.AddRange(
|
||||
new Course
|
||||
{
|
||||
Code = "CS101",
|
||||
Name = "程序设计基础",
|
||||
EnglishName = "Fundamentals of Programming",
|
||||
CollegeId = computerCollege.Id,
|
||||
CourseCategoryId = courseCategories["BASIC"].Id,
|
||||
Credits = 4,
|
||||
TotalHours = 64,
|
||||
LectureHours = 40,
|
||||
PracticeHours = 24,
|
||||
Nature = CourseNature.MajorRequired,
|
||||
AssessmentMethod = AssessmentMethod.Examination,
|
||||
Description = "面向一年级学生的程序设计入门课程。"
|
||||
},
|
||||
new Course
|
||||
{
|
||||
Code = "CS201",
|
||||
Name = "数据结构",
|
||||
EnglishName = "Data Structures",
|
||||
CollegeId = computerCollege.Id,
|
||||
CourseCategoryId = courseCategories["BASIC"].Id,
|
||||
Credits = 3.5m,
|
||||
TotalHours = 56,
|
||||
LectureHours = 40,
|
||||
PracticeHours = 16,
|
||||
Nature = CourseNature.MajorRequired,
|
||||
AssessmentMethod = AssessmentMethod.Examination
|
||||
},
|
||||
new Course
|
||||
{
|
||||
Code = "CS305",
|
||||
Name = "软件工程实践",
|
||||
EnglishName = "Software Engineering Practice",
|
||||
CollegeId = computerCollege.Id,
|
||||
CourseCategoryId = courseCategories["PRACTICE"].Id,
|
||||
Credits = 2,
|
||||
TotalHours = 48,
|
||||
LectureHours = 8,
|
||||
PracticeHours = 40,
|
||||
Nature = CourseNature.Practice,
|
||||
AssessmentMethod = AssessmentMethod.Assessment
|
||||
});
|
||||
}
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
if (!await db.CurriculumPlans.AnyAsync())
|
||||
{
|
||||
var seededCourses = await db.Courses
|
||||
.Where(x => x.Code == "CS101" || x.Code == "CS201" || x.Code == "CS305")
|
||||
.ToDictionaryAsync(x => x.Code);
|
||||
if (seededCourses.Count == 3)
|
||||
{
|
||||
db.CurriculumPlans.Add(new CurriculumPlan
|
||||
{
|
||||
MajorId = (await db.Majors.SingleAsync(x => x.Code == "080901")).Id,
|
||||
Name = "计算机科学与技术专业培养方案",
|
||||
Version = "2026版",
|
||||
EffectiveGrade = 2026,
|
||||
TotalCredits = 9.5m,
|
||||
Status = CurriculumPlanStatus.Published,
|
||||
PublishedAt = DateTime.UtcNow,
|
||||
Description = "用于本地开发的精简培养方案示例。",
|
||||
Modules =
|
||||
[
|
||||
new CurriculumModule
|
||||
{
|
||||
Code = "BASIC",
|
||||
Name = "专业基础课程",
|
||||
RequiredCredits = 7.5m,
|
||||
SortOrder = 10,
|
||||
Courses =
|
||||
[
|
||||
new CurriculumCourse
|
||||
{
|
||||
CourseId = seededCourses["CS101"].Id,
|
||||
RecommendedSemester = 1,
|
||||
Type = CurriculumCourseType.Required
|
||||
},
|
||||
new CurriculumCourse
|
||||
{
|
||||
CourseId = seededCourses["CS201"].Id,
|
||||
RecommendedSemester = 3,
|
||||
Type = CurriculumCourseType.Required
|
||||
}
|
||||
]
|
||||
},
|
||||
new CurriculumModule
|
||||
{
|
||||
Code = "PRACTICE",
|
||||
Name = "实践教学",
|
||||
RequiredCredits = 2m,
|
||||
SortOrder = 20,
|
||||
Courses =
|
||||
[
|
||||
new CurriculumCourse
|
||||
{
|
||||
CourseId = seededCourses["CS305"].Id,
|
||||
RecommendedSemester = 5,
|
||||
Type = CurriculumCourseType.Required
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
if (!await db.TeachingTasks.AnyAsync())
|
||||
{
|
||||
var term = await db.AcademicTerms.SingleAsync(x => x.IsCurrent);
|
||||
var course = await db.Courses.SingleAsync(x => x.Code == "CS101");
|
||||
var teacher = await db.Teachers.SingleAsync(x => x.TeacherNumber == "T2026001");
|
||||
var administrativeClass = await db.AdministrativeClasses
|
||||
.SingleAsync(x => x.Code == "CS2026-01");
|
||||
db.TeachingTasks.Add(new TeachingTask
|
||||
{
|
||||
TaskNumber = "2026-1-CS101-01",
|
||||
Name = "程序设计基础教学班 01",
|
||||
AcademicTermId = term.Id,
|
||||
CourseId = course.Id,
|
||||
Capacity = 60,
|
||||
StartWeek = 1,
|
||||
EndWeek = 16,
|
||||
WeeklyHours = 4,
|
||||
Status = TeachingTaskStatus.Published,
|
||||
PublishedAt = DateTime.UtcNow,
|
||||
Teachers =
|
||||
[
|
||||
new TeachingTaskTeacher
|
||||
{
|
||||
TeacherId = teacher.Id,
|
||||
IsPrimary = true
|
||||
}
|
||||
],
|
||||
Classes =
|
||||
[
|
||||
new TeachingTaskClass
|
||||
{
|
||||
AdministrativeClassId = administrativeClass.Id
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
if (!await db.SchedulePlans.AnyAsync())
|
||||
{
|
||||
var term = await db.AcademicTerms.SingleAsync(x => x.IsCurrent);
|
||||
var task = await db.TeachingTasks.SingleAsync(x => x.TaskNumber == "2026-1-CS101-01");
|
||||
var classroom = await db.Classrooms.SingleAsync(x => x.Code == "J1-201");
|
||||
db.SchedulePlans.Add(new SchedulePlan
|
||||
{
|
||||
AcademicTermId = term.Id,
|
||||
Name = "2026—2027 学年第一学期正式课表",
|
||||
Version = "V1",
|
||||
Status = SchedulePlanStatus.Published,
|
||||
PublishedAt = DateTime.UtcNow,
|
||||
Entries =
|
||||
[
|
||||
new ScheduleEntry
|
||||
{
|
||||
TeachingTaskId = task.Id,
|
||||
ClassroomId = classroom.Id,
|
||||
DayOfWeek = 1,
|
||||
StartPeriod = 1,
|
||||
PeriodCount = 2,
|
||||
StartWeek = 1,
|
||||
EndWeek = 16,
|
||||
WeekPattern = WeekPattern.All
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await SeedDevelopmentUsersAsync(computerCollege.Id);
|
||||
await SeedDevelopmentCourseSelectionAsync();
|
||||
await SeedDevelopmentGradesAsync();
|
||||
await SeedDevelopmentExamsAsync();
|
||||
await developmentDemoDataSeeder.SeedAsync();
|
||||
}
|
||||
|
||||
private async Task SeedDevelopmentCourseSelectionAsync()
|
||||
{
|
||||
if (!await db.CourseSelectionRounds.AnyAsync())
|
||||
{
|
||||
var term = await db.AcademicTerms.SingleAsync(x => x.IsCurrent);
|
||||
var task = await db.TeachingTasks.SingleAsync(
|
||||
x => x.TaskNumber == "2026-1-CS101-01");
|
||||
var now = DateTime.UtcNow;
|
||||
db.CourseSelectionRounds.Add(new CourseSelectionRound
|
||||
{
|
||||
AcademicTermId = term.Id,
|
||||
Name = "2026—2027 学年第一学期第一轮选课",
|
||||
StartsAt = now.AddDays(-2),
|
||||
EndsAt = now.AddDays(14),
|
||||
WithdrawalEndsAt = now.AddDays(21),
|
||||
MaxCredits = 30,
|
||||
Status = CourseSelectionRoundStatus.Open,
|
||||
Notes = "本地开发演示轮次,可用于验证选课、退课和教学班名单。",
|
||||
Offerings =
|
||||
[
|
||||
new CourseSelectionOffering
|
||||
{
|
||||
TeachingTaskId = task.Id,
|
||||
Capacity = 60,
|
||||
IsOpenToAll = false,
|
||||
Notes = "面向计科 2026-1 班开放。"
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
var seededTask = await db.TeachingTasks.SingleAsync(
|
||||
x => x.TaskNumber == "2026-1-CS101-01");
|
||||
var offering = await db.CourseSelectionOfferings.FirstOrDefaultAsync(
|
||||
x => x.TeachingTaskId == seededTask.Id);
|
||||
var student = await db.Students.SingleAsync(x =>
|
||||
x.StudentNumber == "202601001");
|
||||
if (offering is not null &&
|
||||
!await db.CourseEnrollments.AnyAsync(x =>
|
||||
x.CourseSelectionOfferingId == offering.Id &&
|
||||
x.StudentId == student.Id))
|
||||
{
|
||||
db.CourseEnrollments.Add(new CourseEnrollment
|
||||
{
|
||||
CourseSelectionOfferingId = offering.Id,
|
||||
StudentId = student.Id
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SeedDevelopmentGradesAsync()
|
||||
{
|
||||
if (await db.GradeSheets.AnyAsync()) return;
|
||||
var task = await db.TeachingTasks.SingleAsync(
|
||||
x => x.TaskNumber == "2026-1-CS101-01");
|
||||
var student = await db.Students.SingleAsync(
|
||||
x => x.StudentNumber == "202601001");
|
||||
db.GradeSheets.Add(new GradeSheet
|
||||
{
|
||||
TeachingTaskId = task.Id,
|
||||
RegularWeight = 30,
|
||||
FinalWeight = 70,
|
||||
Status = GradeSheetStatus.Draft,
|
||||
Records =
|
||||
[
|
||||
new GradeRecord
|
||||
{
|
||||
StudentId = student.Id,
|
||||
RegularScore = 88,
|
||||
FinalScore = 92,
|
||||
TotalScore = 90.8m,
|
||||
GradePoint = 4.0m
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task SeedDevelopmentExamsAsync()
|
||||
{
|
||||
if (await db.ExamPlans.AnyAsync()) return;
|
||||
var term = await db.AcademicTerms.SingleAsync(x => x.IsCurrent);
|
||||
var task = await db.TeachingTasks.SingleAsync(x => x.TaskNumber == "2026-1-CS101-01");
|
||||
var room = await db.Classrooms.SingleAsync(x => x.Code == "J1-201");
|
||||
var teacher = await db.Teachers.SingleAsync(x => x.TeacherNumber == "T2026001");
|
||||
db.ExamPlans.Add(new ExamPlan
|
||||
{
|
||||
AcademicTermId = term.Id,
|
||||
Name = "2026—2027 学年第一学期期末考试",
|
||||
Status = ExamPlanStatus.Published,
|
||||
PublishedAt = DateTime.UtcNow,
|
||||
Notes = "本地开发演示考试计划。",
|
||||
Sessions =
|
||||
[
|
||||
new ExamSession
|
||||
{
|
||||
TeachingTaskId = task.Id,
|
||||
ClassroomId = room.Id,
|
||||
ExamDate = new DateOnly(2027, 1, 8),
|
||||
StartPeriod = 1,
|
||||
PeriodCount = 2,
|
||||
StartsAt = new DateTime(2027, 1, 8, 9, 0, 0, DateTimeKind.Utc),
|
||||
EndsAt = new DateTime(2027, 1, 8, 11, 0, 0, DateTimeKind.Utc),
|
||||
RequiredInvigilatorCount = 2,
|
||||
Invigilators =
|
||||
[
|
||||
new ExamSessionInvigilator { TeacherId = teacher.Id }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task SeedDevelopmentUsersAsync(Guid collegeId)
|
||||
{
|
||||
var definitions = new[]
|
||||
{
|
||||
new DevelopmentUser(
|
||||
"academic", "校级教务员", "Academic@123456",
|
||||
null, null, SystemRoles.AcademicAdmin),
|
||||
new DevelopmentUser(
|
||||
"college", "计算机学院教务员", "College@123456",
|
||||
"A2026001", collegeId, SystemRoles.CollegeAdmin),
|
||||
new DevelopmentUser(
|
||||
"counselor", "陈老师", "Counselor@123456",
|
||||
"C2026001", collegeId, SystemRoles.Counselor),
|
||||
new DevelopmentUser(
|
||||
"teacher", "陈明远", "Teacher@123456",
|
||||
"T2026001", collegeId, SystemRoles.Teacher),
|
||||
new DevelopmentUser(
|
||||
"student", "周启航", "Student@123456",
|
||||
"202601001", collegeId, SystemRoles.Student),
|
||||
new DevelopmentUser(
|
||||
"leader", "教学分管领导", "Leader@123456",
|
||||
null, null, SystemRoles.Leader)
|
||||
};
|
||||
|
||||
foreach (var definition in definitions)
|
||||
{
|
||||
var user = await userManager.FindByNameAsync(definition.UserName);
|
||||
if (user is null)
|
||||
{
|
||||
user = new ApplicationUser
|
||||
{
|
||||
UserName = definition.UserName,
|
||||
DisplayName = definition.DisplayName,
|
||||
StaffNumber = definition.StaffNumber,
|
||||
CollegeId = definition.CollegeId,
|
||||
LockoutEnabled = true,
|
||||
IsEnabled = true
|
||||
};
|
||||
EnsureSucceeded(
|
||||
await userManager.CreateAsync(user, definition.Password),
|
||||
$"创建开发账号 {definition.UserName}");
|
||||
}
|
||||
|
||||
if (!await userManager.IsInRoleAsync(user, definition.Role))
|
||||
{
|
||||
EnsureSucceeded(
|
||||
await userManager.AddToRoleAsync(user, definition.Role),
|
||||
$"授予开发账号 {definition.UserName} 角色");
|
||||
}
|
||||
|
||||
if (definition.Role == SystemRoles.Teacher)
|
||||
{
|
||||
var teacher = await db.Teachers.SingleAsync(
|
||||
x => x.TeacherNumber == definition.StaffNumber);
|
||||
if (!teacher.UserId.HasValue) teacher.UserId = user.Id;
|
||||
}
|
||||
if (definition.Role == SystemRoles.Student)
|
||||
{
|
||||
var student = await db.Students.SingleAsync(
|
||||
x => x.StudentNumber == definition.StaffNumber);
|
||||
if (!student.UserId.HasValue) student.UserId = user.Id;
|
||||
}
|
||||
if (definition.Role == SystemRoles.Counselor)
|
||||
{
|
||||
var classes = await db.AdministrativeClasses
|
||||
.Where(x =>
|
||||
x.CounselorUserId == null &&
|
||||
x.CounselorName == definition.DisplayName)
|
||||
.ToListAsync();
|
||||
foreach (var administrativeClass in classes)
|
||||
administrativeClass.CounselorUserId = user.Id;
|
||||
}
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private static void EnsureSucceeded(IdentityResult result, string action)
|
||||
{
|
||||
if (result.Succeeded)
|
||||
@@ -686,12 +191,4 @@ public sealed class DatabaseInitializer(
|
||||
throw new InvalidOperationException(
|
||||
$"{action}失败:{string.Join(";", result.Errors.Select(x => x.Description))}");
|
||||
}
|
||||
|
||||
private sealed record DevelopmentUser(
|
||||
string UserName,
|
||||
string DisplayName,
|
||||
string Password,
|
||||
string? StaffNumber,
|
||||
Guid? CollegeId,
|
||||
string Role);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user