Skip to content

Instantly share code, notes, and snippets.

@rikuTanide
Created October 14, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikuTanide/85e2e3f44154b65cdc5ba250bbaa7476 to your computer and use it in GitHub Desktop.
Save rikuTanide/85e2e3f44154b65cdc5ba250bbaa7476 to your computer and use it in GitHub Desktop.
正規化した
class Video {
String videoID;
}
class User {
String userID;
}
class PlayEvent {
String userID;
String videoID;
}
List<Video> videos = [];
List<User> users = [];
List<PlayEvent> playEvents = [];
// ユーザーが閲覧したvideoインスタンスの視聴ユーザーリストにユーザーを追加
void play(String userID, String videoID) {
playEvents.add(new PlayEvent()
..userID = userID
..videoID = videoID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment