Skip to content

Commit

Permalink
Merge pull request #49 from jilju-jilju/main
Browse files Browse the repository at this point in the history
테스트용 코드 제거
  • Loading branch information
bessapple14 authored Nov 3, 2021
2 parents a161f11 + cba357a commit 9ea47eb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 352 deletions.
196 changes: 0 additions & 196 deletions APP(Android)/jilju/assets/sample_data_1.txt

This file was deleted.

132 changes: 0 additions & 132 deletions APP(Android)/jilju/assets/sample_data_2.txt

This file was deleted.

24 changes: 0 additions & 24 deletions APP(Android)/jilju/lib/database.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:collection';
import 'dart:convert';
import 'dart:math';

import 'package:hive_flutter/hive_flutter.dart';

Expand Down Expand Up @@ -71,29 +70,6 @@ class DatabaseManager {
return box.keys.isEmpty ? 1 : (box.keys.last + 1);
}

static Future<void> loadSampleData(int seed) async {
List<String> sampleDatas = [];
for (int i = 1; i < 3; i++) {
sampleDatas.add(await readFileAsString('sample_data_$i.txt'));
}
Random random = Random(seed);
int fileId = 1;
for (int day = -29; day <= 0; day++) {
int j = 0;
for (int i = 1; i < 3; i++) {
for (; random.nextBool(); j++) {
int startTime = DateTime.now()
.add(Duration(days: day, hours: j))
.millisecondsSinceEpoch;
startTime ~/= 1000;
String fileData = startTime.toString() + '\n' + sampleDatas[i - 1];
DatabaseManager.putJilju(Jilju.fromFileData(fileId, fileData));
fileId++;
}
}
}
}

static Future<void> clearAllData() async {
var jiljuBox = await _jiljuBox;
var jiljuTagBox = await _jiljuTagBox;
Expand Down

0 comments on commit 9ea47eb

Please sign in to comment.