Compare commits
6 Commits
a2acb7b928
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 386abf850d | |||
| de7171b72b | |||
| b811352620 | |||
| 51d5eae6c0 | |||
| 2b18af2b2d | |||
| 7c68dc5ceb |
+128
-71
@@ -20,9 +20,17 @@
|
||||
"modelData": {
|
||||
"type": 0,
|
||||
"material": {
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"id": "d6350683.jpg",
|
||||
"textureUrl": "https://cdn2.ettoday.net/images/6350/d6350683.jpg"
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"width": 1,
|
||||
@@ -100,9 +108,17 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"id": "d6350683.jpg",
|
||||
"textureUrl": "https://cdn2.ettoday.net/images/6350/d6350683.jpg"
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"width": 0.75,
|
||||
@@ -133,9 +149,17 @@
|
||||
"modelData": {
|
||||
"type": 2,
|
||||
"material": {
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"id": "d6350683.jpg",
|
||||
"textureUrl": "https://cdn2.ettoday.net/images/6350/d6350683.jpg"
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -168,9 +192,17 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"id": "d6350683.jpg",
|
||||
"textureUrl": "https://cdn2.ettoday.net/images/6350/d6350683.jpg"
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -205,9 +237,17 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"contentType": "model/gltf-binary",
|
||||
"id": "spiderbot.glb",
|
||||
"textureUrl": "https://www.ray650128.com/spiderbot.glb"
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -247,9 +287,12 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"contentType": "video/mpeg4",
|
||||
"id": "ker1.mp4",
|
||||
"textureUrl": "https://www.ray650128.com/video/ker1.mp4"
|
||||
"_id": "6465a6e2f5c86b7c50520486",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "獅子影片",
|
||||
"path": "/upload/1684383458922.mp4",
|
||||
"contentType": "video/mp4",
|
||||
"createAt": 1684383458939
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -288,9 +331,12 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"contentType": "video/mpeg4",
|
||||
"id": "ker2.mp4",
|
||||
"textureUrl": "https://www.ray650128.com/video/ker2.mp4"
|
||||
"_id": "6465a6e2f5c86b7c50520486",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "獅子影片",
|
||||
"path": "/upload/1684383458922.mp4",
|
||||
"contentType": "video/mp4",
|
||||
"createAt": 1684383458939
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -326,9 +372,17 @@
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"contentType": "video/mpeg4",
|
||||
"id": "hou1.mp4",
|
||||
"textureUrl": "https://www.ray650128.com/video/hou1.mp4"
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
"params": {
|
||||
"availableRange": 20,
|
||||
@@ -378,10 +432,10 @@
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": "MultiFace",
|
||||
"name": "MultiplePlane",
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"x": 1,
|
||||
"y": -1,
|
||||
"z": 0
|
||||
},
|
||||
"rotation": {
|
||||
@@ -395,56 +449,59 @@
|
||||
"z": 1
|
||||
},
|
||||
"modelData": {
|
||||
"material": {
|
||||
"contentTypes": [
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg",
|
||||
"image/jpeg"
|
||||
],
|
||||
"textureUrls": [
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg",
|
||||
"https://cdn2.ettoday.net/images/6350/d6350683.jpg"
|
||||
]
|
||||
},
|
||||
"materials": [
|
||||
{
|
||||
"_id": "6464410c9c67517fcbccf447",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "奸笑的綿芽",
|
||||
"path": "/upload/1684291852002.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"fileTag": [
|
||||
"圖片",
|
||||
"Hololive"
|
||||
],
|
||||
"createAt": 1684291852023,
|
||||
"updatedAt": 1684294290879
|
||||
},
|
||||
{
|
||||
"_id": "646590294df2e46df0f7a51b",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "供三小",
|
||||
"path": "/upload/1684377641965.jpeg",
|
||||
"contentType": "image/jpeg",
|
||||
"createAt": 1684377641977
|
||||
},
|
||||
{
|
||||
"_id": "646590674df2e46df0f7a524",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "解散囉",
|
||||
"path": "/upload/1684377703013.png",
|
||||
"contentType": "image/png",
|
||||
"createAt": 1684377703020
|
||||
},
|
||||
{
|
||||
"_id": "646590e04df2e46df0f7a52f",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "QRCode",
|
||||
"path": "/upload/1684377824564.png",
|
||||
"contentType": "image/png",
|
||||
"createAt": 1684377824573
|
||||
},
|
||||
{
|
||||
"_id": "646593304df2e46df0f7a54b",
|
||||
"ownerId": "646435a39c67517fcbccf426",
|
||||
"name": "煙霧",
|
||||
"path": "/upload/1684378416412.png",
|
||||
"contentType": "image/png",
|
||||
"createAt": 1684378416417
|
||||
}
|
||||
],
|
||||
"params": {
|
||||
"levelAngles": [
|
||||
45,
|
||||
0,
|
||||
-45
|
||||
],
|
||||
"levelBorders": [
|
||||
0.1,
|
||||
0.1,
|
||||
0.1
|
||||
],
|
||||
"levelCount": 3,
|
||||
"levelAngles": [ 0 ],
|
||||
"levelBorders": [ 0 ],
|
||||
"levelCount": 1,
|
||||
"planeBorder": 0.1,
|
||||
"planeCount": 5,
|
||||
"planeCount": 4,
|
||||
"speed": 1
|
||||
},
|
||||
"type": 6
|
||||
|
||||
@@ -2,11 +2,13 @@ val ktor_version: String by project
|
||||
val kotlin_version: String by project
|
||||
val logback_version: String by project
|
||||
val kmongo_version: String by project
|
||||
val swagger_codegen_version: String by project
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.21"
|
||||
id("io.ktor.plugin") version "2.3.0"
|
||||
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.21"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
|
||||
group = "com.ray650128"
|
||||
@@ -22,8 +24,15 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
tasks {
|
||||
create("stage").dependsOn("installDist")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("io.ktor:ktor-server-core-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-swagger:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-openapi:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-cors:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-netty-jvm:$ktor_version")
|
||||
@@ -35,4 +44,5 @@ dependencies {
|
||||
implementation("io.ktor:ktor-server-auth-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktor_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0")
|
||||
implementation("io.swagger.codegen.v3:swagger-codegen-generators:1.0.39")
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.ray650128
|
||||
|
||||
import com.ray650128.model.pojo.User
|
||||
import com.ray650128.plugins.configureUserRouting
|
||||
import com.ray650128.plugins.configureArMaterialRouting
|
||||
import com.ray650128.plugins.configureArModelRouting
|
||||
import com.ray650128.plugins.configureSwaggerRouting
|
||||
import com.ray650128.plugins.configureUserRouting
|
||||
import com.ray650128.service.UserService
|
||||
import io.ktor.http.*
|
||||
import io.ktor.serialization.kotlinx.json.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.auth.*
|
||||
@@ -12,11 +13,13 @@ import io.ktor.server.auth.jwt.*
|
||||
import io.ktor.server.engine.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.plugins.contentnegotiation.*
|
||||
import io.ktor.server.plugins.cors.routing.*
|
||||
import io.swagger.codegen.v3.generators.html.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.litote.kmongo.id.serialization.IdKotlinXSerializationModule
|
||||
|
||||
fun main() {
|
||||
embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
|
||||
embeddedServer(Netty, port = 8787, host = "0.0.0.0") {
|
||||
install(ContentNegotiation) {
|
||||
json(
|
||||
Json { serializersModule = IdKotlinXSerializationModule }
|
||||
@@ -37,8 +40,14 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
install(CORS) {
|
||||
anyHost()
|
||||
allowHeader(HttpHeaders.ContentType)
|
||||
}
|
||||
configureUserRouting()
|
||||
configureArMaterialRouting()
|
||||
configureArModelRouting()
|
||||
configureSwaggerRouting()
|
||||
}.start(wait = true)
|
||||
}
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
package com.ray650128.extension
|
||||
|
||||
import com.ray650128.model.pojo.Material
|
||||
import com.ray650128.model.pojo.arModel.ModelData
|
||||
import com.ray650128.model.pojo.arModelDto.ModelDataDto
|
||||
import com.ray650128.service.MaterialService
|
||||
import org.litote.kmongo.Id
|
||||
|
||||
fun ModelData.toDto(): ModelDataDto {
|
||||
val service = MaterialService()
|
||||
return ModelDataDto(
|
||||
type = this.type,
|
||||
material = service.findById(this.material.toString()),
|
||||
material = if (this.material != null) {
|
||||
service.findById(this.material.toString())
|
||||
} else null,
|
||||
materials = if (this.materials != null) {
|
||||
ArrayList<Material>().apply {
|
||||
materials?.forEach { id ->
|
||||
val material = service.findById(id.toString())
|
||||
if (material != null) {
|
||||
add(material)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else null,
|
||||
params = this.params
|
||||
)
|
||||
}
|
||||
@@ -18,5 +32,10 @@ fun ModelDataDto.toModelData(): ModelData =
|
||||
ModelData(
|
||||
type = this.type,
|
||||
material = this.material?._id,
|
||||
materials = ArrayList<Id<Material>>().apply {
|
||||
materials?.forEach { material ->
|
||||
add(material._id)
|
||||
}
|
||||
},
|
||||
params = this.params
|
||||
)
|
||||
@@ -9,5 +9,6 @@ import org.litote.kmongo.Id
|
||||
data class ModelData(
|
||||
var type: Int = -1,
|
||||
@Contextual var material: Id<Material>? = null,
|
||||
@Contextual var materials: List<Id<Material>>? = null,
|
||||
var params: ModelParams
|
||||
)
|
||||
@@ -10,5 +10,6 @@ import org.litote.kmongo.Id
|
||||
data class ModelDataDto(
|
||||
var type: Int = -1,
|
||||
var material: Material? = null,
|
||||
var materials: List<Material>? = null,
|
||||
var params: ModelParams
|
||||
)
|
||||
@@ -4,6 +4,7 @@ import com.ray650128.extension.*
|
||||
import com.ray650128.model.ErrorResponse
|
||||
import com.ray650128.model.pojo.arModel.ArModel
|
||||
import com.ray650128.model.pojo.User
|
||||
import com.ray650128.model.pojo.arModelDto.ArModelDto
|
||||
import com.ray650128.service.ModelService
|
||||
import com.ray650128.service.UserService
|
||||
import io.ktor.server.application.*
|
||||
@@ -34,12 +35,25 @@ fun Application.configureArModelRouting() {
|
||||
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") {
|
||||
val user = call.authentication.principal<User>() ?: run {
|
||||
call.sendUnauthorized()
|
||||
return@post
|
||||
}
|
||||
val body = call.receive<ArModel>()
|
||||
val body = call.receive<ArModelDto>().toArModel()
|
||||
body.apply {
|
||||
ownerId = user._id
|
||||
createAt = System.currentTimeMillis()
|
||||
@@ -58,7 +72,7 @@ fun Application.configureArModelRouting() {
|
||||
call.sendUnauthorized()
|
||||
return@put
|
||||
}
|
||||
val body = call.receive<ArModel>()
|
||||
val body = call.receive<ArModelDto>().toArModel()
|
||||
val id = call.parameters["id"].toString()
|
||||
val isSuccess = modelService.updateById(id, body)
|
||||
call.sendSuccess(mapOf("success" to isSuccess))
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ray650128.plugins
|
||||
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.plugins.swagger.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun Application.configureSwaggerRouting() {
|
||||
|
||||
routing {
|
||||
swaggerUI(path = "swagger", swaggerFile = "openapi/documentation.yaml")
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ fun Application.configureUserRouting() {
|
||||
}
|
||||
}
|
||||
|
||||
get {
|
||||
/*get {
|
||||
val peopleList = service.findAll()
|
||||
call.respond(peopleList)
|
||||
}
|
||||
@@ -110,7 +110,7 @@ fun Application.configureUserRouting() {
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound, ErrorResponse.NOT_FOUND_RESPONSE)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,22 +26,21 @@ class ModelService {
|
||||
return arModelCollection.find(ArModel::ownerId eq bsonId).toList()
|
||||
}
|
||||
|
||||
fun updateById(id: String, request: ArModel): Boolean =
|
||||
findById(id)?.let { arModel ->
|
||||
val updateResult = arModelCollection.replaceOne(
|
||||
arModel.copy(
|
||||
name = request.name,
|
||||
position = request.position,
|
||||
rotation = request.rotation,
|
||||
scale = request.scale,
|
||||
modelData = request.modelData,
|
||||
events = request.events,
|
||||
childEvents = request.childEvents,
|
||||
updatedAt = request.updatedAt
|
||||
)
|
||||
fun updateById(id: String, request: ArModel): Boolean = findById(id)?.let { arModel ->
|
||||
val updateResult = arModelCollection.replaceOne(
|
||||
arModel.copy(
|
||||
name = request.name,
|
||||
position = request.position,
|
||||
rotation = request.rotation,
|
||||
scale = request.scale,
|
||||
modelData = request.modelData,
|
||||
events = request.events,
|
||||
childEvents = request.childEvents,
|
||||
updatedAt = request.updatedAt
|
||||
)
|
||||
updateResult.modifiedCount == 1L
|
||||
} ?: false
|
||||
)
|
||||
updateResult.modifiedCount == 1L
|
||||
} ?: false
|
||||
|
||||
fun deleteById(id: String): Boolean {
|
||||
val deleteResult = arModelCollection.deleteOneById(ObjectId(id))
|
||||
|
||||
@@ -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>()
|
||||
|
||||
|
||||
@@ -0,0 +1,570 @@
|
||||
openapi: "3.0.3"
|
||||
info:
|
||||
title: "KtorMongoTest API"
|
||||
description: "KtorMongoTest API"
|
||||
version: "1.0.0"
|
||||
servers:
|
||||
- url: "https://KtorMongoTest"
|
||||
paths:
|
||||
/api/v1/models:
|
||||
get:
|
||||
description: ""
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
type: "object"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
/api/v1/models/{id}:
|
||||
delete:
|
||||
description: ""
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
put:
|
||||
description: ""
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ArModel"
|
||||
required: true
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
/api/v1/models/create:
|
||||
post:
|
||||
description: ""
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ArModel"
|
||||
required: true
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
"400":
|
||||
description: "Bad Request"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
/api/v1/login:
|
||||
post:
|
||||
description: ""
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/User"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
"400":
|
||||
description: "Bad Request"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
/api/v1/logout:
|
||||
post:
|
||||
description: ""
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
type: "object"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
/api/v1/register:
|
||||
post:
|
||||
description: ""
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/User"
|
||||
required: true
|
||||
responses:
|
||||
"400":
|
||||
description: "Bad Request"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
type: "object"
|
||||
headers:
|
||||
My-User-Id-Header:
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
"201":
|
||||
description: "Created"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
headers:
|
||||
My-User-Id-Header:
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
/api/v1/materials:
|
||||
get:
|
||||
description: ""
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
/api/v1/materials/{id}:
|
||||
delete:
|
||||
description: ""
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"404":
|
||||
description: "Not Found"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
put:
|
||||
description: ""
|
||||
parameters:
|
||||
- name: "id"
|
||||
in: "path"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Material"
|
||||
required: true
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"404":
|
||||
description: "Not Found"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
/api/v1/materials/upload:
|
||||
post:
|
||||
description: ""
|
||||
responses:
|
||||
"401":
|
||||
description: "Unauthorized"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
"200":
|
||||
description: "OK"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/Object"
|
||||
"400":
|
||||
description: "Bad Request"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorResponse"
|
||||
/upload/{name}:
|
||||
get:
|
||||
description: ""
|
||||
parameters:
|
||||
- name: "name"
|
||||
in: "path"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
responses:
|
||||
"404":
|
||||
description: "Not Found"
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
type: "object"
|
||||
"200":
|
||||
description: "OK <br> A file response"
|
||||
content:
|
||||
application/*:
|
||||
schema:
|
||||
type: "object"
|
||||
format: "binary"
|
||||
components:
|
||||
schemas:
|
||||
ErrorResponse:
|
||||
type: "object"
|
||||
properties:
|
||||
message:
|
||||
type: "string"
|
||||
Object:
|
||||
type: "object"
|
||||
properties: {}
|
||||
User:
|
||||
type: "object"
|
||||
properties:
|
||||
_id:
|
||||
$ref: "#/components/schemas/User"
|
||||
account:
|
||||
type: "string"
|
||||
password:
|
||||
type: "string"
|
||||
name:
|
||||
type: "string"
|
||||
token:
|
||||
type: "string"
|
||||
createAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
updatedAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
Float3:
|
||||
type: "object"
|
||||
properties:
|
||||
x:
|
||||
type: "number"
|
||||
format: "float"
|
||||
"y":
|
||||
type: "number"
|
||||
format: "float"
|
||||
z:
|
||||
type: "number"
|
||||
format: "float"
|
||||
Material:
|
||||
type: "object"
|
||||
properties:
|
||||
_id:
|
||||
$ref: "#/components/schemas/Material"
|
||||
ownerId:
|
||||
$ref: "#/components/schemas/User"
|
||||
name:
|
||||
type: "string"
|
||||
path:
|
||||
type: "string"
|
||||
contentType:
|
||||
type: "string"
|
||||
fileTag:
|
||||
type: "string"
|
||||
createAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
updatedAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
Color:
|
||||
type: "object"
|
||||
properties:
|
||||
r:
|
||||
type: "number"
|
||||
format: "float"
|
||||
g:
|
||||
type: "number"
|
||||
format: "float"
|
||||
b:
|
||||
type: "number"
|
||||
format: "float"
|
||||
a:
|
||||
type: "number"
|
||||
format: "float"
|
||||
ModelParams:
|
||||
type: "object"
|
||||
properties:
|
||||
availableRange:
|
||||
type: "number"
|
||||
format: "float"
|
||||
width:
|
||||
type: "number"
|
||||
format: "float"
|
||||
height:
|
||||
type: "number"
|
||||
format: "float"
|
||||
depth:
|
||||
type: "number"
|
||||
format: "float"
|
||||
radius:
|
||||
type: "number"
|
||||
format: "float"
|
||||
modelAnimSpeed:
|
||||
type: "number"
|
||||
format: "float"
|
||||
modelStartFrame:
|
||||
type: "number"
|
||||
format: "float"
|
||||
modelEndFrame:
|
||||
type: "number"
|
||||
format: "float"
|
||||
modelFPS:
|
||||
type: "number"
|
||||
format: "float"
|
||||
multiplyNumber:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
multiplyRadius:
|
||||
type: "number"
|
||||
format: "float"
|
||||
multiplyRange:
|
||||
type: "number"
|
||||
format: "float"
|
||||
hueAngle:
|
||||
type: "number"
|
||||
format: "float"
|
||||
hueRange:
|
||||
type: "number"
|
||||
format: "float"
|
||||
saturation:
|
||||
type: "number"
|
||||
format: "float"
|
||||
videoThumbnail:
|
||||
type: "string"
|
||||
lightIntensity:
|
||||
type: "number"
|
||||
format: "float"
|
||||
color:
|
||||
$ref: "#/components/schemas/Color"
|
||||
levelCount:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
levelBorders:
|
||||
type: "number"
|
||||
format: "float"
|
||||
levelAngles:
|
||||
type: "number"
|
||||
format: "float"
|
||||
planeCount:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
planeBorder:
|
||||
type: "number"
|
||||
format: "float"
|
||||
speed:
|
||||
type: "number"
|
||||
format: "float"
|
||||
signIcon:
|
||||
type: "string"
|
||||
signName:
|
||||
type: "string"
|
||||
signTextColor:
|
||||
$ref: "#/components/schemas/Color"
|
||||
ModelData:
|
||||
type: "object"
|
||||
properties:
|
||||
type:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
material:
|
||||
$ref: "#/components/schemas/Material"
|
||||
params:
|
||||
$ref: "#/components/schemas/ModelParams"
|
||||
ModelAction:
|
||||
type: "object"
|
||||
properties:
|
||||
actionType:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
duration:
|
||||
type: "number"
|
||||
format: "float"
|
||||
translation:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
rotation:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
scale:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
alpha:
|
||||
type: "number"
|
||||
format: "float"
|
||||
webUrl:
|
||||
type: "string"
|
||||
speed:
|
||||
type: "number"
|
||||
format: "float"
|
||||
startFrame:
|
||||
type: "number"
|
||||
format: "float"
|
||||
endFrame:
|
||||
type: "number"
|
||||
format: "float"
|
||||
fps:
|
||||
type: "number"
|
||||
format: "float"
|
||||
repeatCount:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
squareMoveWidth:
|
||||
type: "number"
|
||||
format: "float"
|
||||
squareMoveHeight:
|
||||
type: "number"
|
||||
format: "float"
|
||||
squareMoveTime:
|
||||
type: "number"
|
||||
format: "float"
|
||||
squareMoveRotationTime:
|
||||
type: "number"
|
||||
format: "float"
|
||||
clockwise:
|
||||
type: "boolean"
|
||||
roundMoveRadius:
|
||||
type: "number"
|
||||
format: "float"
|
||||
roundMoveStartAngle:
|
||||
type: "number"
|
||||
format: "float"
|
||||
roundMoveEndAngel:
|
||||
type: "number"
|
||||
format: "float"
|
||||
resolution:
|
||||
type: "number"
|
||||
format: "float"
|
||||
moveToFaceDistance:
|
||||
type: "number"
|
||||
format: "float"
|
||||
autoReturnDelay:
|
||||
type: "number"
|
||||
format: "float"
|
||||
vibrationTime:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
targetId:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
groupNumber:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
ModelEvent:
|
||||
type: "object"
|
||||
properties:
|
||||
eventType:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
actions:
|
||||
$ref: "#/components/schemas/ModelAction"
|
||||
ArModel:
|
||||
type: "object"
|
||||
properties:
|
||||
_id:
|
||||
$ref: "#/components/schemas/ArModel"
|
||||
ownerId:
|
||||
$ref: "#/components/schemas/User"
|
||||
name:
|
||||
type: "string"
|
||||
position:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
rotation:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
scale:
|
||||
$ref: "#/components/schemas/Float3"
|
||||
modelData:
|
||||
$ref: "#/components/schemas/ModelData"
|
||||
events:
|
||||
$ref: "#/components/schemas/ModelEvent"
|
||||
childEvents:
|
||||
type: "string"
|
||||
createAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
updatedAt:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
Reference in New Issue
Block a user