From 93c3b915bf88a6606722ea5f72b7aa3dbe341b28 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 13 Mar 2022 21:52:09 +0100 Subject: [PATCH] Renamed CreatorParam to EpcQrCodeConfig --- .../epcqrcode/{CreatorParam.kt => EpcQrCodeConfig.kt} | 2 +- .../net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt | 4 ++-- .../java/net/codinux/banking/epcqrcode/MainActivity.kt | 4 ++-- .../codinux/banking/epcqrcode/windows/main/MainWindow.kt | 2 +- .../codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt | 8 ++++---- EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/{CreatorParam.kt => EpcQrCodeConfig.kt} (91%) diff --git a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/CreatorParam.kt b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeConfig.kt similarity index 91% rename from EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/CreatorParam.kt rename to EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeConfig.kt index 3924941..88cfe5b 100644 --- a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/CreatorParam.kt +++ b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeConfig.kt @@ -1,7 +1,7 @@ package net.codinux.banking.epcqrcode -open class CreatorParam( +open class EpcQrCodeConfig( var receiverName: String = "", diff --git a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt index 895ed7e..dd28f1b 100644 --- a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt +++ b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt @@ -8,7 +8,7 @@ open class EpcQrCodeCreator { // } - open fun generate(param: CreatorParam): EpcQrCode { + open fun generate(param: EpcQrCodeConfig): EpcQrCode { return EpcQrCode( EpcQrCode.ServiceTagDefaultValue, EpcQrCodeVersion.Version2, @@ -26,7 +26,7 @@ open class EpcQrCodeCreator { ) } - open fun generateAsString(param: CreatorParam): String { + open fun generateAsString(param: EpcQrCodeConfig): String { val epcQrCode = generate(param) val epcQrCodeBuilder = StringBuilder() diff --git a/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt b/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt index 5a132c4..2536cbe 100644 --- a/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt +++ b/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt @@ -20,14 +20,14 @@ class MainActivity : AppCompatActivity() { private fun generateQrCode() { hideKeyboard(edtxtReference) - val param = CreatorParam(edtxtReceiver.string, edtxtIban.string, edtxtBic.string, map(edtxtAmount.string), edtxtReference.string) + val param = EpcQrCodeConfig(edtxtReceiver.string, edtxtIban.string, edtxtBic.string, map(edtxtAmount.string), edtxtReference.string) generateQrCodeAsync(param) { createdQrCode -> imgGeneratedQrCode.setImageBitmap(createdQrCode) } } - private fun generateQrCodeAsync(param: CreatorParam, done: (Bitmap) -> Unit) { + private fun generateQrCodeAsync(param: EpcQrCodeConfig, done: (Bitmap) -> Unit) { thread { val density = resources.displayMetrics.density val config = EncodeToQrCodeConfig((EncodeToQrCodeConfig.DefaultWidth * density).toInt(), (EncodeToQrCodeConfig.DefaultHeight * density).toInt()) diff --git a/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt b/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt index 897a91a..cab8047 100644 --- a/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt +++ b/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt @@ -267,7 +267,7 @@ class MainWindow : View(FX.messages["application.title"]) { } private fun generateQrCode() { - val param = CreatorParam(receiver.value, iban.value, bic.value, map(amount.value), reference.value) + val param = EpcQrCodeConfig(receiver.value, iban.value, bic.value, map(amount.value), reference.value) val qrCodeContent = EpcQrCodeCreator().generateAsString(param) generatedQrCodeImage.value = generateQrCode(qrCodeContent) diff --git a/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt b/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt index 388b7e0..5c07714 100644 --- a/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt +++ b/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt @@ -1,6 +1,6 @@ package net.codinux.banking.epcqrcode.rest -import net.codinux.banking.epcqrcode.CreatorParam +import net.codinux.banking.epcqrcode.EpcQrCodeConfig import net.codinux.banking.epcqrcode.EncodeToQrCodeConfig import net.codinux.banking.epcqrcode.EpcQrCodeCreator import net.codinux.banking.epcqrcode.QrCodeGenerator @@ -31,7 +31,7 @@ class EpcQrCodeResource { @Produces(MediaType.APPLICATION_JSON) fun createEpcQrCode(requestDto: GenerateEpcQrCodeRequestDto): Response { try { - val qrCodeContent = epcQrCodeCreator.generateAsString(mapToCreatorParam(requestDto)) + val qrCodeContent = epcQrCodeCreator.generateAsString(mapToEpcQrCodeConfig(requestDto)) val qrCodeBytes = qrCodeGenerator.generateQrCode(qrCodeContent, map(requestDto)) return Response.ok(GenerateEpcQrCodeResponseDto(qrCodeBytes)) @@ -46,8 +46,8 @@ class EpcQrCodeResource { } } - private fun mapToCreatorParam(dto: GenerateEpcQrCodeRequestDto): CreatorParam { - return CreatorParam( + private fun mapToEpcQrCodeConfig(dto: GenerateEpcQrCodeRequestDto): EpcQrCodeConfig { + return EpcQrCodeConfig( dto.receiverName, dto.iban, dto.bic, diff --git a/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift b/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift index a962a45..c17d3f6 100644 --- a/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift +++ b/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift @@ -82,7 +82,7 @@ struct ContentView: View { private func generateQRCode() { let creator = EpcQrCodeCreator() - let param = CreatorParam(receiverName: receiver, iban: iban, bic: bic, amount: map(amount), reference: reference, noteToUser: nil, encoding: .utf8) + let param = EpcQrCodeConfig(receiverName: receiver, iban: iban, bic: bic, amount: map(amount), reference: reference, noteToUser: nil, encoding: .utf8) let qrCodeContent = creator.generateAsString(param: param)