將mongoDB改成需登入
This commit is contained in:
parent
a2acb7b928
commit
7c68dc5ceb
@ -7,7 +7,7 @@ import org.litote.kmongo.*
|
||||
import org.litote.kmongo.id.toId
|
||||
|
||||
class MaterialService {
|
||||
private val client = KMongo.createClient("mongodb://www.ray650128.com:27017")
|
||||
private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@www.ray650128.com:27017")
|
||||
private val database = client.getDatabase("ar_system")
|
||||
private val materialCollection = database.getCollection<Material>()
|
||||
|
||||
@ -31,6 +31,7 @@ class MaterialService {
|
||||
val updateResult = materialCollection.replaceOne(
|
||||
material.copy(
|
||||
name = request.name,
|
||||
fileTag = request.fileTag,
|
||||
updatedAt = request.updatedAt
|
||||
)
|
||||
)
|
||||
|
||||
@ -7,7 +7,7 @@ import org.litote.kmongo.*
|
||||
import org.litote.kmongo.id.toId
|
||||
|
||||
class ModelService {
|
||||
private val client = KMongo.createClient("mongodb://www.ray650128.com:27017")
|
||||
private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@www.ray650128.com:27017")
|
||||
private val database = client.getDatabase("ar_system")
|
||||
private val arModelCollection = database.getCollection<ArModel>()
|
||||
|
||||
@ -26,8 +26,7 @@ class ModelService {
|
||||
return arModelCollection.find(ArModel::ownerId eq bsonId).toList()
|
||||
}
|
||||
|
||||
fun updateById(id: String, request: ArModel): Boolean =
|
||||
findById(id)?.let { arModel ->
|
||||
fun updateById(id: String, request: ArModel): Boolean = findById(id)?.let { arModel ->
|
||||
val updateResult = arModelCollection.replaceOne(
|
||||
arModel.copy(
|
||||
name = request.name,
|
||||
|
||||
@ -6,7 +6,7 @@ import org.litote.kmongo.*
|
||||
import org.litote.kmongo.id.toId
|
||||
|
||||
class UserService {
|
||||
private val client = KMongo.createClient("mongodb://www.ray650128.com:27017")
|
||||
private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@www.ray650128.com:27017")
|
||||
private val database = client.getDatabase("ar_system")
|
||||
private val userCollection = database.getCollection<User>()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user