This commit is contained in:
parent
7594fa6753
commit
922d22c07d
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,4 +5,5 @@
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
*.log
|
||||
*.log
|
||||
*.wav
|
@ -47,6 +47,7 @@ dependencies {
|
||||
compile 'com.rabbitmq:amqp-client:2.7.1'
|
||||
compile 'com.zaxxer:HikariCP:2.7.8'
|
||||
compile 'com.viartemev:the-white-rabbit:0.0.5'
|
||||
compile 'com.sun.activation:javax.activation:1.2.0'
|
||||
implementation "org.koin:koin-ktor:$koin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation "io.ktor:ktor-server-netty:$ktor_version"
|
||||
@ -58,7 +59,6 @@ dependencies {
|
||||
implementation "io.ktor:ktor-client-core-jvm:$ktor_version"
|
||||
implementation "io.ktor:ktor-client-apache:$ktor_version"
|
||||
implementation "io.ktor:ktor-auth:$ktor_version"
|
||||
implementation 'jakarta.activation:jakarta.activation-api:1.2.2'
|
||||
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ services:
|
||||
MQ_PASSWORD: rabbitmq
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
- output-service-postgres
|
||||
- input-service-postgres
|
||||
|
||||
rabbitmq:
|
||||
image: "rabbitmq:3-management"
|
||||
|
19
test.py
Normal file
19
test.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
import requests
|
||||
import os.path
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
URL = "http://127.0.0.1:8080/sample"
|
||||
|
||||
FILE = 'CommonStarling_102761_45.wav'
|
||||
|
||||
files = {
|
||||
"file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}),
|
||||
"description" : (None, json.dumps({'date' : datetime.now().isoformat(), 'device_id' : '123'}), "application/json")
|
||||
}
|
||||
|
||||
r = requests.post(URL,files=files)
|
||||
print("Content: ", r.content)
|
||||
print("Headers:", r.headers)
|
||||
r.raise_for_status()
|
Loading…
Reference in New Issue
Block a user