SysRoleSeedData.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Furion.DatabaseAccessor;
  2. using Furion.JsonSerialization;
  3. using Microsoft.EntityFrameworkCore;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace YBEE.EQM.Core.SeedData;
  7. /// <summary>
  8. /// 角色种子
  9. /// </summary>
  10. public class SysRoleSeedData : IEntitySeedData<SysRole>
  11. {
  12. /// <summary>
  13. /// 种子数据
  14. /// </summary>
  15. /// <param name="dbContext"></param>
  16. /// <param name="dbContextLocator"></param>
  17. /// <returns></returns>
  18. public IEnumerable<SysRole> HasData(DbContext dbContext, Type dbContextLocator)
  19. {
  20. return new[]
  21. {
  22. new SysRole
  23. {
  24. Id = 1, Name = "超级管理员", SysRoleGroupId = 1, RoleType = RoleType.SUPER_ADMIN, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false,
  25. RoleDataScope = JSON.Serialize(new RoleDataScope(){ EducationStages = new(){ EducationStage.PRIMARY_SCHOOL_STAGE, EducationStage.JUNIOR_HIGH_SCHOOL_STAGE, EducationStage.SENIOR_HIGH_SCHOOL_STAGE, EducationStage.PRESCHOOL_STAGE } })
  26. },
  27. new SysRole { Id = 2, Name = "管理员", SysRoleGroupId = 2, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  28. new SysRole { Id = 3, Name = "小学特殊学生审核员", SysRoleGroupId = 2, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false, RoleDataScope = JSON.Serialize(new RoleDataScope(){ EducationStages = new(){ EducationStage.PRIMARY_SCHOOL_STAGE } }) },
  29. new SysRole { Id = 4, Name = "小学缺测替补审核员", SysRoleGroupId = 2, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false, RoleDataScope = JSON.Serialize(new RoleDataScope(){ EducationStages = new(){ EducationStage.PRIMARY_SCHOOL_STAGE } }) },
  30. new SysRole { Id = 5, Name = "学区结果应用人员", SysRoleGroupId = 3, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  31. new SysRole { Id = 6, Name = "学校管理人员", SysRoleGroupId = 4, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  32. new SysRole { Id = 7, Name = "数据上报人员", SysRoleGroupId = 4, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  33. new SysRole { Id = 8, Name = "结果应用人员", SysRoleGroupId = 4, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  34. new SysRole { Id = 9, Name = "初中特殊学生审核员", SysRoleGroupId = 2, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false, RoleDataScope = JSON.Serialize(new RoleDataScope(){ EducationStages = new(){ EducationStage.JUNIOR_HIGH_SCHOOL_STAGE } }) },
  35. new SysRole { Id = 10, Name = "初中缺测替补审核员", SysRoleGroupId = 2, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false, RoleDataScope = JSON.Serialize(new RoleDataScope(){ EducationStages = new(){ EducationStage.JUNIOR_HIGH_SCHOOL_STAGE } }) },
  36. new SysRole { Id = 11, Name = "双向细目表编制员", SysRoleGroupId = 5, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  37. new SysRole { Id = 12, Name = "学科问题建议编写员", SysRoleGroupId = 5, RoleType = RoleType.NORMAL, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE, IsDeleted = false },
  38. };
  39. }
  40. }