Enabled GZip support (but don't use it as class annotation, otherwise constructor injection will fail)

This commit is contained in:
dankito 2023-04-11 00:50:31 +02:00
parent 2bd8fb6e06
commit 55f53e0dd5
2 changed files with 13 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema
import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse
import org.eclipse.microprofile.openapi.annotations.tags.Tag
import org.jboss.resteasy.annotations.GZIP
import org.slf4j.LoggerFactory
import java.util.*
import javax.inject.Inject
@ -20,11 +21,16 @@ import javax.ws.rs.core.Response
@Path("/epcqrcode/v1")
@Produces(MediaType.APPLICATION_JSON)
@GZIP
@Tag(name = "EPC QR Code")
class EpcQrCodeResource(
@Inject private val service: EpcQrCodeService,
@Inject private val htmlService: HtmlService
) {
class EpcQrCodeResource {
// after adding GZip support compiler didn't like constructor injection anymore, so i switched to property injection
@Inject
private lateinit var service: EpcQrCodeService
@Inject
internal lateinit var htmlService: HtmlService
private val log = LoggerFactory.getLogger(EpcQrCodeResource::class.java)

View File

@ -5,6 +5,9 @@ quarkus.http.port=8080
quarkus.http.cors=true
quarkus.resteasy.gzip.enabled=true
quarkus.resteasy.gzip.max-input=10M
# disable this output:
# Press [h] for more options>