新增get(id: String)功能
This commit is contained in:
parent
b811352620
commit
de7171b72b
@ -287,17 +287,12 @@
|
|||||||
},
|
},
|
||||||
"modelData": {
|
"modelData": {
|
||||||
"material": {
|
"material": {
|
||||||
"_id": "6464410c9c67517fcbccf447",
|
"_id": "6465a6e2f5c86b7c50520486",
|
||||||
"ownerId": "646435a39c67517fcbccf426",
|
"ownerId": "646435a39c67517fcbccf426",
|
||||||
"name": "奸笑的綿芽",
|
"name": "獅子影片",
|
||||||
"path": "/upload/1684291852002.jpeg",
|
"path": "/upload/1684383458922.mp4",
|
||||||
"contentType": "image/jpeg",
|
"contentType": "video/mp4",
|
||||||
"fileTag": [
|
"createAt": 1684383458939
|
||||||
"圖片",
|
|
||||||
"Hololive"
|
|
||||||
],
|
|
||||||
"createAt": 1684291852023,
|
|
||||||
"updatedAt": 1684294290879
|
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"availableRange": 20,
|
"availableRange": 20,
|
||||||
@ -336,17 +331,12 @@
|
|||||||
},
|
},
|
||||||
"modelData": {
|
"modelData": {
|
||||||
"material": {
|
"material": {
|
||||||
"_id": "6464410c9c67517fcbccf447",
|
"_id": "6465a6e2f5c86b7c50520486",
|
||||||
"ownerId": "646435a39c67517fcbccf426",
|
"ownerId": "646435a39c67517fcbccf426",
|
||||||
"name": "奸笑的綿芽",
|
"name": "獅子影片",
|
||||||
"path": "/upload/1684291852002.jpeg",
|
"path": "/upload/1684383458922.mp4",
|
||||||
"contentType": "image/jpeg",
|
"contentType": "video/mp4",
|
||||||
"fileTag": [
|
"createAt": 1684383458939
|
||||||
"圖片",
|
|
||||||
"Hololive"
|
|
||||||
],
|
|
||||||
"createAt": 1684291852023,
|
|
||||||
"updatedAt": 1684294290879
|
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"availableRange": 20,
|
"availableRange": 20,
|
||||||
|
|||||||
@ -35,6 +35,19 @@ fun Application.configureArModelRouting() {
|
|||||||
call.sendSuccess(list)
|
call.sendSuccess(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get("/{id}") {
|
||||||
|
call.authentication.principal<User>()?.account ?: run {
|
||||||
|
call.sendUnauthorized()
|
||||||
|
return@get
|
||||||
|
}
|
||||||
|
val id = call.parameters["id"].toString()
|
||||||
|
val arModel = modelService.findById(id) ?: run {
|
||||||
|
call.sendNotFound()
|
||||||
|
return@get
|
||||||
|
}
|
||||||
|
call.sendSuccess(arModel.toDto())
|
||||||
|
}
|
||||||
|
|
||||||
post("/create") {
|
post("/create") {
|
||||||
val user = call.authentication.principal<User>() ?: run {
|
val user = call.authentication.principal<User>() ?: run {
|
||||||
call.sendUnauthorized()
|
call.sendUnauthorized()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user