Ejemplo n.º 1
0
        public static UserLog[] GetSeederData()
        {
            var droneSeeder = new List <UserLog>();
            var rand        = new Random();

            for (var i = 0; i < 40; i++)
            {
                var ranDay    = rand.Next(1, 3);
                var ranHour   = rand.Next(1, 18);
                var ranMinute = rand.Next(1, 50);
                var apiType   = Utility.GetRandomApiType();
                var droneLog  = new UserLog()
                {
                    Metadata              = "Meta data example " + i,
                    ProjectType           = Models.ProjectType.GetRandomProjectType(),
                    EntityLogPrimaryKeyId = i + 10,
                    RegionId              = MonitorRegionLog.GetRandomEntityId(),
                    EntityId              = UserLog.GetRandomEntityId(),
                    Name             = Utility.RandomString(5) + " " + Utility.RandomString(4),
                    Type             = apiType,
                    AuthorId         = UserLog.GetRandomEntityId(),
                    ResolveProblemId = ResolveProblemLog.GetRandomEntityId(),
                    Description      = "User " + apiType.GetDescription(),
                    Timestamp        = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0)
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }
Ejemplo n.º 2
0
        public static MonitorRegionLog[] GetSeederData()
        {
            var droneSeeder = new List <MonitorRegionLog>();
            var rand        = new Random();

            for (var i = 0; i < 40; i++)
            {
                var ranDay    = rand.Next(1, 3);
                var ranHour   = rand.Next(1, 18);
                var ranMinute = rand.Next(1, 50);
                var apiType   = Utility.GetRandomApiType();
                var entityId  = GetRandomEntityId();
                var droneLog  = new MonitorRegionLog()
                {
                    EntityLogPrimaryKeyId = i + 1,
                    EntityId    = entityId,
                    AuthorId    = UserLog.GetRandomEntityId(),
                    Type        = apiType,
                    ProjectType = Models.ProjectType.GetRandomProjectType(),
                    Description = "MonitorRegion " + apiType.GetDescription(),
                    Name        = "MonitorRegion " + entityId,
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }
Ejemplo n.º 3
0
        public static UavConnectLog[] GetSeederData()
        {
            var droneSeeder = new List <UavConnectLog>();
            var rand        = new Random();

            for (var i = 0; i < 40; i++)
            {
                var    ranDay      = rand.Next(1, 3);
                var    ranHour     = rand.Next(1, 18);
                var    ranMinute   = rand.Next(1, 50);
                var    apiType     = Utility.GetRandomApiType();
                string projectType = Models.ProjectType.GetRandomProjectType();
                var    droneLog    = new UavConnectLog()
                {
                    EntityLogPrimaryKeyId = i + 10,
                    RegionId    = MonitorRegionLog.GetRandomEntityId(),
                    ProjectType = projectType,
                    EntityId    = UavConnectLog.GetRandomEntityId(),
                    Type        = apiType,
                    AuthorId    = UserLog.GetRandomEntityId(),
                    Description = "Giám sát " + apiType.GetDescription(),
                    Name        = "Đợi giám sát quý " + rand.Next(1, 3),
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }