This commit is contained in:
chusan
2025-05-16 19:06:18 +08:00
parent 316a3e03e1
commit 2364f29b17
44 changed files with 854 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
package mvc.dao
import mvc.entities.User
class UserRepository {
val users = mutableMapOf<Long, User>()
init {
add(User(1L, "nian", "chen"))
}
fun add(user: User) {
users += user.id to user
}
fun findById(id: Long): User? {
return users[id]
}
fun update(user: User) {
users[user.id] = user
}
}