Skip to content

Commit

Permalink
📜 :Add main use models
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoMasegi committed Dec 7, 2019
1 parent 9dd3143 commit 0410cd9
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
13 changes: 13 additions & 0 deletions model/src/main/java/com/sho/masegi/model/Event.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sho.masegi.model

import java.util.*

typealias EventId = String

data class Event(
val id: EventId,
val type: String,
val actor: User,
val repo: RepoLink,
val createdAt: Date
)
9 changes: 9 additions & 0 deletions model/src/main/java/com/sho/masegi/model/RepoLink.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.sho.masegi.model

import java.net.URL

data class RepoLink(
val id: RepositoryId,
val name: String,
val url: URL
)
23 changes: 23 additions & 0 deletions model/src/main/java/com/sho/masegi/model/Repository.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.sho.masegi.model

import java.net.URL
import java.util.Date

typealias RepositoryId = Long

data class Repository(
val id: RepositoryId,
val name: String,
val fullName: String,
val owner: User,
val url: URL,
val forksCount: Int,
val openIssuesCount: Int,
val watchersCount: Int,
val stargazersCount: Int,
val language: String?,
val createdAt: Date,
val updatedAt: Date,
val `private`: Boolean,
val description: String?
)
11 changes: 9 additions & 2 deletions model/src/main/java/com/sho/masegi/model/User.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package com.sho.masegi.model

import java.net.URL

typealias UserId = Long

data class User(
val id: Int,
val name: String
val id: UserId,
val login: String,
val displayLogin: String?,
val url: URL,
val avatarUrl: URL
)

0 comments on commit 0410cd9

Please sign in to comment.