├── .gitattributes ├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator └── VERSION ├── .travis.yml ├── LICENSE ├── README.md ├── build.gradle ├── build.sbt ├── docs ├── DefaultApi.md ├── InlineObject.md ├── InlineObject1.md ├── InlineObject2.md ├── InlineResponse200.md └── InlineResponse2001.md ├── git_push.sh ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pom.xml ├── settings.gradle └── src ├── main ├── AndroidManifest.xml └── java │ └── org │ └── openapitools │ └── client │ ├── ApiCallback.java │ ├── ApiClient.java │ ├── ApiException.java │ ├── ApiResponse.java │ ├── Configuration.java │ ├── GzipRequestInterceptor.java │ ├── JSON.java │ ├── Pair.java │ ├── ProgressRequestBody.java │ ├── ProgressResponseBody.java │ ├── ServerConfiguration.java │ ├── ServerVariable.java │ ├── StringUtil.java │ ├── api │ └── DefaultApi.java │ ├── auth │ ├── ApiKeyAuth.java │ ├── Authentication.java │ ├── HttpBasicAuth.java │ └── HttpBearerAuth.java │ └── model │ ├── InlineObject.java │ ├── InlineObject1.java │ ├── InlineObject2.java │ ├── InlineResponse200.java │ └── InlineResponse2001.java └── test └── java └── org └── openapitools └── client ├── api └── DefaultApiTest.java └── model ├── InlineObject1Test.java ├── InlineObject2Test.java ├── InlineObjectTest.java ├── InlineResponse2001Test.java └── InlineResponse200Test.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # exclude jar for gradle wrapper 12 | !gradle/wrapper/*.jar 13 | 14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 15 | hs_err_pid* 16 | 17 | # build files 18 | **/target 19 | target 20 | .gradle 21 | build 22 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 4.3.0 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Generated by OpenAPI Generator: https://openapi-generator.tech 3 | # 4 | # Ref: https://docs.travis-ci.com/user/languages/java/ 5 | # 6 | language: java 7 | jdk: 8 | - openjdk12 9 | - openjdk11 10 | - openjdk10 11 | - openjdk9 12 | - openjdk8 13 | before_install: 14 | # ensure gradlew has proper permission 15 | - chmod a+x ./gradlew 16 | script: 17 | # test using maven 18 | #- mvn test 19 | # test using gradle 20 | - gradle test 21 | # test using sbt 22 | # - sbt test 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 qinchuan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # openapi-java-client 2 | 3 | 直接模式 4 | - API version: 1.0.0 5 | - Build date: 2022-05-01T20:54:45.948+08:00[Asia/Shanghai] 6 | 7 | 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 8 | 9 | 10 | *Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* 11 | 12 | 13 | ## Requirements 14 | 15 | Building the API client library requires: 16 | 1. Java 1.7+ 17 | 2. Maven/Gradle 18 | 19 | ## Installation 20 | 21 | To install the API client library to your local Maven repository, simply execute: 22 | 23 | ```shell 24 | mvn clean install 25 | ``` 26 | 27 | To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: 28 | 29 | ```shell 30 | mvn clean deploy 31 | ``` 32 | 33 | Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. 34 | 35 | ### Maven users 36 | 37 | Add this dependency to your project's POM: 38 | 39 | ```xml 40 | 41 | org.openapitools 42 | openapi-java-client 43 | 1.0.0 44 | compile 45 | 46 | ``` 47 | 48 | ### Gradle users 49 | 50 | Add this dependency to your project's build file: 51 | 52 | ```groovy 53 | compile "org.openapitools:openapi-java-client:1.0.0" 54 | ``` 55 | 56 | ### Others 57 | 58 | At first generate the JAR by executing: 59 | 60 | ```shell 61 | mvn clean package 62 | ``` 63 | 64 | Then manually install the following JARs: 65 | 66 | * `target/openapi-java-client-1.0.0.jar` 67 | * `target/lib/*.jar` 68 | 69 | ## Getting Started 70 | 71 | Please follow the [installation](#installation) instruction and execute the following Java code: 72 | 73 | ```java 74 | 75 | // Import classes: 76 | import org.openapitools.client.ApiClient; 77 | import org.openapitools.client.ApiException; 78 | import org.openapitools.client.Configuration; 79 | import org.openapitools.client.models.*; 80 | import org.openapitools.client.api.DefaultApi; 81 | 82 | public class Example { 83 | public static void main(String[] args) { 84 | ApiClient defaultClient = Configuration.getDefaultApiClient(); 85 | defaultClient.setBasePath("http://localhost"); 86 | 87 | DefaultApi apiInstance = new DefaultApi(defaultClient); 88 | InlineObject inlineObject = new InlineObject(); // InlineObject | 89 | try { 90 | InlineResponse200 result = apiInstance.isPhoneRegPost(inlineObject); 91 | System.out.println(result); 92 | } catch (ApiException e) { 93 | System.err.println("Exception when calling DefaultApi#isPhoneRegPost"); 94 | System.err.println("Status code: " + e.getCode()); 95 | System.err.println("Reason: " + e.getResponseBody()); 96 | System.err.println("Response headers: " + e.getResponseHeaders()); 97 | e.printStackTrace(); 98 | } 99 | } 100 | } 101 | 102 | ``` 103 | 104 | ## Documentation for API Endpoints 105 | 106 | All URIs are relative to *http://localhost* 107 | 108 | Class | Method | HTTP request | Description 109 | ------------ | ------------- | ------------- | ------------- 110 | *DefaultApi* | [**isPhoneRegPost**](docs/DefaultApi.md#isPhoneRegPost) | **POST** /IsPhoneReg | 检查手机号是否注册 111 | *DefaultApi* | [**juguguLoginCodeandReturnInfoPost**](docs/DefaultApi.md#juguguLoginCodeandReturnInfoPost) | **POST** /Jugugu_LoginCodeandReturnInfo | ①获取验证码图片 112 | *DefaultApi* | [**jugugugRegAndVerifyandReturnInfoPost**](docs/DefaultApi.md#jugugugRegAndVerifyandReturnInfoPost) | **POST** /Jugugug_RegAndVerifyandReturnInfo | ③注册Jugugu 113 | 114 | 115 | ## Documentation for Models 116 | 117 | - [InlineObject](docs/InlineObject.md) 118 | - [InlineObject1](docs/InlineObject1.md) 119 | - [InlineObject2](docs/InlineObject2.md) 120 | - [InlineResponse200](docs/InlineResponse200.md) 121 | - [InlineResponse2001](docs/InlineResponse2001.md) 122 | 123 | 124 | ## Documentation for Authorization 125 | 126 | All endpoints do not require authorization. 127 | Authentication schemes defined for the API: 128 | 129 | ## Recommendation 130 | 131 | It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. 132 | 133 | ## Author 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'idea' 2 | apply plugin: 'eclipse' 3 | apply plugin: 'java' 4 | 5 | group = 'org.openapitools' 6 | version = '1.0.0' 7 | 8 | buildscript { 9 | repositories { 10 | maven { url "https://repo1.maven.org/maven2" } 11 | jcenter() 12 | } 13 | dependencies { 14 | classpath 'com.android.tools.build:gradle:2.3.+' 15 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' 16 | } 17 | } 18 | 19 | repositories { 20 | jcenter() 21 | } 22 | sourceSets { 23 | main.java.srcDirs = ['src/main/java'] 24 | } 25 | 26 | if(hasProperty('target') && target == 'android') { 27 | 28 | apply plugin: 'com.android.library' 29 | apply plugin: 'com.github.dcendents.android-maven' 30 | 31 | android { 32 | compileSdkVersion 25 33 | buildToolsVersion '25.0.2' 34 | defaultConfig { 35 | minSdkVersion 14 36 | targetSdkVersion 25 37 | } 38 | compileOptions { 39 | sourceCompatibility JavaVersion.VERSION_1_7 40 | targetCompatibility JavaVersion.VERSION_1_7 41 | } 42 | 43 | // Rename the aar correctly 44 | libraryVariants.all { variant -> 45 | variant.outputs.each { output -> 46 | def outputFile = output.outputFile 47 | if (outputFile != null && outputFile.name.endsWith('.aar')) { 48 | def fileName = "${project.name}-${variant.baseName}-${version}.aar" 49 | output.outputFile = new File(outputFile.parent, fileName) 50 | } 51 | } 52 | } 53 | 54 | dependencies { 55 | provided 'javax.annotation:jsr250-api:1.0' 56 | } 57 | } 58 | 59 | afterEvaluate { 60 | android.libraryVariants.all { variant -> 61 | def task = project.tasks.create "jar${variant.name.capitalize()}", Jar 62 | task.description = "Create jar artifact for ${variant.name}" 63 | task.dependsOn variant.javaCompile 64 | task.from variant.javaCompile.destinationDir 65 | task.destinationDir = project.file("${project.buildDir}/outputs/jar") 66 | task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" 67 | artifacts.add('archives', task); 68 | } 69 | } 70 | 71 | task sourcesJar(type: Jar) { 72 | from android.sourceSets.main.java.srcDirs 73 | classifier = 'sources' 74 | } 75 | 76 | artifacts { 77 | archives sourcesJar 78 | } 79 | 80 | } else { 81 | 82 | apply plugin: 'java' 83 | apply plugin: 'maven' 84 | 85 | sourceCompatibility = JavaVersion.VERSION_1_7 86 | targetCompatibility = JavaVersion.VERSION_1_7 87 | 88 | install { 89 | repositories.mavenInstaller { 90 | pom.artifactId = 'openapi-java-client' 91 | } 92 | } 93 | 94 | task execute(type:JavaExec) { 95 | main = System.getProperty('mainClass') 96 | classpath = sourceSets.main.runtimeClasspath 97 | } 98 | } 99 | 100 | dependencies { 101 | compile 'io.swagger:swagger-annotations:1.5.22' 102 | compile "com.google.code.findbugs:jsr305:3.0.2" 103 | compile 'com.squareup.okhttp3:okhttp:3.14.2' 104 | compile 'com.squareup.okhttp3:logging-interceptor:3.14.2' 105 | compile 'com.google.code.gson:gson:2.8.5' 106 | compile 'io.gsonfire:gson-fire:1.8.3' 107 | compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9' 108 | compile 'org.threeten:threetenbp:1.4.0' 109 | testCompile 'junit:junit:4.13' 110 | } 111 | 112 | javadoc { 113 | options.tags = [ "http.response.details:a:Http Response Details" ] 114 | } 115 | -------------------------------------------------------------------------------- /build.sbt: -------------------------------------------------------------------------------- 1 | lazy val root = (project in file(".")). 2 | settings( 3 | organization := "org.openapitools", 4 | name := "openapi-java-client", 5 | version := "1.0.0", 6 | scalaVersion := "2.11.4", 7 | scalacOptions ++= Seq("-feature"), 8 | javacOptions in compile ++= Seq("-Xlint:deprecation"), 9 | publishArtifact in (Compile, packageDoc) := false, 10 | resolvers += Resolver.mavenLocal, 11 | libraryDependencies ++= Seq( 12 | "io.swagger" % "swagger-annotations" % "1.5.22", 13 | "com.squareup.okhttp3" % "okhttp" % "3.14.2", 14 | "com.squareup.okhttp3" % "logging-interceptor" % "3.14.2", 15 | "com.google.code.gson" % "gson" % "2.8.5", 16 | "org.apache.commons" % "commons-lang3" % "3.9", 17 | "org.threeten" % "threetenbp" % "1.4.0" % "compile", 18 | "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", 19 | "javax.annotation" % "jsr250-api" % "1.0" % "compile", 20 | "junit" % "junit" % "4.13" % "test", 21 | "com.novocode" % "junit-interface" % "0.10" % "test" 22 | ) 23 | ) 24 | -------------------------------------------------------------------------------- /docs/DefaultApi.md: -------------------------------------------------------------------------------- 1 | # DefaultApi 2 | 3 | All URIs are relative to *http://localhost* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**isPhoneRegPost**](DefaultApi.md#isPhoneRegPost) | **POST** /IsPhoneReg | 检查手机号是否注册 8 | [**juguguLoginCodeandReturnInfoPost**](DefaultApi.md#juguguLoginCodeandReturnInfoPost) | **POST** /Jugugu_LoginCodeandReturnInfo | ①获取验证码图片 9 | [**jugugugRegAndVerifyandReturnInfoPost**](DefaultApi.md#jugugugRegAndVerifyandReturnInfoPost) | **POST** /Jugugug_RegAndVerifyandReturnInfo | ③注册Jugugu 10 | 11 | 12 | 13 | # **isPhoneRegPost** 14 | > InlineResponse200 isPhoneRegPost(inlineObject) 15 | 16 | 检查手机号是否注册 17 | 18 | 检查手机号是否注册,返回“true”和“false”字符串 19 | 20 | ### Example 21 | ```java 22 | // Import classes: 23 | import org.openapitools.client.ApiClient; 24 | import org.openapitools.client.ApiException; 25 | import org.openapitools.client.Configuration; 26 | import org.openapitools.client.models.*; 27 | import org.openapitools.client.api.DefaultApi; 28 | 29 | public class Example { 30 | public static void main(String[] args) { 31 | ApiClient defaultClient = Configuration.getDefaultApiClient(); 32 | defaultClient.setBasePath("http://localhost"); 33 | 34 | DefaultApi apiInstance = new DefaultApi(defaultClient); 35 | InlineObject inlineObject = new InlineObject(); // InlineObject | 36 | try { 37 | InlineResponse200 result = apiInstance.isPhoneRegPost(inlineObject); 38 | System.out.println(result); 39 | } catch (ApiException e) { 40 | System.err.println("Exception when calling DefaultApi#isPhoneRegPost"); 41 | System.err.println("Status code: " + e.getCode()); 42 | System.err.println("Reason: " + e.getResponseBody()); 43 | System.err.println("Response headers: " + e.getResponseHeaders()); 44 | e.printStackTrace(); 45 | } 46 | } 47 | } 48 | ``` 49 | 50 | ### Parameters 51 | 52 | Name | Type | Description | Notes 53 | ------------- | ------------- | ------------- | ------------- 54 | **inlineObject** | [**InlineObject**](InlineObject.md)| | [optional] 55 | 56 | ### Return type 57 | 58 | [**InlineResponse200**](InlineResponse200.md) 59 | 60 | ### Authorization 61 | 62 | No authorization required 63 | 64 | ### HTTP request headers 65 | 66 | - **Content-Type**: application/json 67 | - **Accept**: */* 68 | 69 | ### HTTP response details 70 | | Status code | Description | Response headers | 71 | |-------------|-------------|------------------| 72 | **200** | 成功 | - | 73 | 74 | 75 | # **juguguLoginCodeandReturnInfoPost** 76 | > InlineResponse2001 juguguLoginCodeandReturnInfoPost(inlineObject2) 77 | 78 | ①获取验证码图片 79 | 80 | 获取用于防御机器人的验证码图片,phone的传参必须为空字符串 81 | 82 | ### Example 83 | ```java 84 | // Import classes: 85 | import org.openapitools.client.ApiClient; 86 | import org.openapitools.client.ApiException; 87 | import org.openapitools.client.Configuration; 88 | import org.openapitools.client.models.*; 89 | import org.openapitools.client.api.DefaultApi; 90 | 91 | public class Example { 92 | public static void main(String[] args) { 93 | ApiClient defaultClient = Configuration.getDefaultApiClient(); 94 | defaultClient.setBasePath("http://localhost"); 95 | 96 | DefaultApi apiInstance = new DefaultApi(defaultClient); 97 | InlineObject2 inlineObject2 = new InlineObject2(); // InlineObject2 | 98 | try { 99 | InlineResponse2001 result = apiInstance.juguguLoginCodeandReturnInfoPost(inlineObject2); 100 | System.out.println(result); 101 | } catch (ApiException e) { 102 | System.err.println("Exception when calling DefaultApi#juguguLoginCodeandReturnInfoPost"); 103 | System.err.println("Status code: " + e.getCode()); 104 | System.err.println("Reason: " + e.getResponseBody()); 105 | System.err.println("Response headers: " + e.getResponseHeaders()); 106 | e.printStackTrace(); 107 | } 108 | } 109 | } 110 | ``` 111 | 112 | ### Parameters 113 | 114 | Name | Type | Description | Notes 115 | ------------- | ------------- | ------------- | ------------- 116 | **inlineObject2** | [**InlineObject2**](InlineObject2.md)| | [optional] 117 | 118 | ### Return type 119 | 120 | [**InlineResponse2001**](InlineResponse2001.md) 121 | 122 | ### Authorization 123 | 124 | No authorization required 125 | 126 | ### HTTP request headers 127 | 128 | - **Content-Type**: application/json 129 | - **Accept**: application/json 130 | 131 | ### HTTP response details 132 | | Status code | Description | Response headers | 133 | |-------------|-------------|------------------| 134 | **200** | 成功 | - | 135 | 136 | 137 | # **jugugugRegAndVerifyandReturnInfoPost** 138 | > InlineResponse2001 jugugugRegAndVerifyandReturnInfoPost(inlineObject1) 139 | 140 | ③注册Jugugu 141 | 142 | 注册jugugu,注意三点 1.phone的传参必须为11位的国内手机号。 2.robotcodeid和robotcode是通过【①】获得 3.code短信验证码通过【②】 4.paymentpassword区块链短密钥,该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 143 | 144 | ### Example 145 | ```java 146 | // Import classes: 147 | import org.openapitools.client.ApiClient; 148 | import org.openapitools.client.ApiException; 149 | import org.openapitools.client.Configuration; 150 | import org.openapitools.client.models.*; 151 | import org.openapitools.client.api.DefaultApi; 152 | 153 | public class Example { 154 | public static void main(String[] args) { 155 | ApiClient defaultClient = Configuration.getDefaultApiClient(); 156 | defaultClient.setBasePath("http://localhost"); 157 | 158 | DefaultApi apiInstance = new DefaultApi(defaultClient); 159 | InlineObject1 inlineObject1 = new InlineObject1(); // InlineObject1 | 160 | try { 161 | InlineResponse2001 result = apiInstance.jugugugRegAndVerifyandReturnInfoPost(inlineObject1); 162 | System.out.println(result); 163 | } catch (ApiException e) { 164 | System.err.println("Exception when calling DefaultApi#jugugugRegAndVerifyandReturnInfoPost"); 165 | System.err.println("Status code: " + e.getCode()); 166 | System.err.println("Reason: " + e.getResponseBody()); 167 | System.err.println("Response headers: " + e.getResponseHeaders()); 168 | e.printStackTrace(); 169 | } 170 | } 171 | } 172 | ``` 173 | 174 | ### Parameters 175 | 176 | Name | Type | Description | Notes 177 | ------------- | ------------- | ------------- | ------------- 178 | **inlineObject1** | [**InlineObject1**](InlineObject1.md)| | [optional] 179 | 180 | ### Return type 181 | 182 | [**InlineResponse2001**](InlineResponse2001.md) 183 | 184 | ### Authorization 185 | 186 | No authorization required 187 | 188 | ### HTTP request headers 189 | 190 | - **Content-Type**: application/json 191 | - **Accept**: application/json 192 | 193 | ### HTTP response details 194 | | Status code | Description | Response headers | 195 | |-------------|-------------|------------------| 196 | **200** | 成功 | - | 197 | 198 | -------------------------------------------------------------------------------- /docs/InlineObject.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # InlineObject 4 | 5 | ## Properties 6 | 7 | Name | Type | Description | Notes 8 | ------------ | ------------- | ------------- | ------------- 9 | **phone** | **String** | 此处传参为空字符串 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/InlineObject1.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # InlineObject1 4 | 5 | ## Properties 6 | 7 | Name | Type | Description | Notes 8 | ------------ | ------------- | ------------- | ------------- 9 | **phone** | **String** | 此处传参为空字符串 | 10 | **robotcodeid** | **String** | | 11 | **robotcode** | **String** | | 12 | **code** | **String** | | 13 | **paymentpassword** | **String** | 该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/InlineObject2.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # InlineObject2 4 | 5 | ## Properties 6 | 7 | Name | Type | Description | Notes 8 | ------------ | ------------- | ------------- | ------------- 9 | **phone** | **String** | 此处传参为空字符串 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/InlineResponse200.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # InlineResponse200 4 | 5 | ## Properties 6 | 7 | Name | Type | Description | Notes 8 | ------------ | ------------- | ------------- | ------------- 9 | **token** | **String** | 用户登录识别令牌,用于后续多个函数的交互,作为输入参数 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/InlineResponse2001.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # InlineResponse2001 4 | 5 | ## Properties 6 | 7 | Name | Type | Description | Notes 8 | ------------ | ------------- | ------------- | ------------- 9 | **state** | **String** | 响应状态分为:-1,0,1 分别代表响应错误、响应提示、响应成功 | 10 | **msg** | **String** | 响应状态为-1时该值为错误信息。响应状态为0时,该值为响应提示信息。响应状态为1时该值为空字符串 | 11 | **phone** | **String** | | 12 | **virifycodeid** | **String** | 验证码图片的ID值 | 13 | **virifyimage** | **String** | data:image/png;base64 | 14 | **confluxaddress** | **String** | 树图区块链地址 | 15 | **ethaddress** | **String** | 以太坊、Arbitrum、polygon、BSC等EVM链地址 | 16 | **token** | **String** | 用户登录识别令牌,用于后续多个函数的交互,作为输入参数 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | git_host=$4 10 | 11 | if [ "$git_host" = "" ]; then 12 | git_host="github.com" 13 | echo "[INFO] No command line input provided. Set \$git_host to $git_host" 14 | fi 15 | 16 | if [ "$git_user_id" = "" ]; then 17 | git_user_id="GIT_USER_ID" 18 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 19 | fi 20 | 21 | if [ "$git_repo_id" = "" ]; then 22 | git_repo_id="GIT_REPO_ID" 23 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 24 | fi 25 | 26 | if [ "$release_note" = "" ]; then 27 | release_note="Minor update" 28 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 29 | fi 30 | 31 | # Initialize the local directory as a Git repository 32 | git init 33 | 34 | # Adds the files in the local repository and stages them for commit. 35 | git add . 36 | 37 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 38 | git commit -m "$release_note" 39 | 40 | # Sets the new remote 41 | git_remote=`git remote` 42 | if [ "$git_remote" = "" ]; then # git remote not defined 43 | 44 | if [ "$GIT_TOKEN" = "" ]; then 45 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 46 | git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git 47 | else 48 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git 49 | fi 50 | 51 | fi 52 | 53 | git pull origin master 54 | 55 | # Pushes (Forces) the changes in the local repository up to the remote repository 56 | echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" 57 | git push origin master 2>&1 | grep -v 'To https' 58 | 59 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Uncomment to build for Android 2 | #target = android -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypherfoxQCW/Jugugu-Direct-Java/60e48c14188bfd4c85a6da2871625bb0bf0e27db/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.openapitools 5 | openapi-java-client 6 | jar 7 | openapi-java-client 8 | 1.0.0 9 | https://github.com/openapitools/openapi-generator 10 | OpenAPI Java 11 | 12 | scm:git:git@github.com:openapitools/openapi-generator.git 13 | scm:git:git@github.com:openapitools/openapi-generator.git 14 | https://github.com/openapitools/openapi-generator 15 | 16 | 17 | 18 | 19 | Unlicense 20 | http://unlicense.org 21 | repo 22 | 23 | 24 | 25 | 26 | 27 | OpenAPI-Generator Contributors 28 | team@openapitools.org 29 | OpenAPITools.org 30 | http://openapitools.org 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-enforcer-plugin 39 | 3.0.0-M1 40 | 41 | 42 | enforce-maven 43 | 44 | enforce 45 | 46 | 47 | 48 | 49 | 2.2.0 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-surefire-plugin 59 | 3.0.0-M4 60 | 61 | 62 | 63 | loggerPath 64 | conf/log4j.properties 65 | 66 | 67 | -Xms512m -Xmx1500m 68 | methods 69 | 10 70 | 71 | 72 | 73 | maven-dependency-plugin 74 | 75 | 76 | package 77 | 78 | copy-dependencies 79 | 80 | 81 | ${project.build.directory}/lib 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-jar-plugin 91 | 2.2 92 | 93 | 94 | 95 | jar 96 | test-jar 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | org.codehaus.mojo 106 | build-helper-maven-plugin 107 | 1.10 108 | 109 | 110 | add_sources 111 | generate-sources 112 | 113 | add-source 114 | 115 | 116 | 117 | src/main/java 118 | 119 | 120 | 121 | 122 | add_test_sources 123 | generate-test-sources 124 | 125 | add-test-source 126 | 127 | 128 | 129 | src/test/java 130 | 131 | 132 | 133 | 134 | 135 | 136 | org.apache.maven.plugins 137 | maven-javadoc-plugin 138 | 3.1.1 139 | 140 | 141 | attach-javadocs 142 | 143 | jar 144 | 145 | 146 | 147 | 148 | none 149 | 150 | 151 | http.response.details 152 | a 153 | Http Response Details: 154 | 155 | 156 | 157 | 158 | 159 | org.apache.maven.plugins 160 | maven-source-plugin 161 | 2.2.1 162 | 163 | 164 | attach-sources 165 | 166 | jar-no-fork 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | sign-artifacts 177 | 178 | 179 | 180 | org.apache.maven.plugins 181 | maven-gpg-plugin 182 | 1.5 183 | 184 | 185 | sign-artifacts 186 | verify 187 | 188 | sign 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | io.swagger 201 | swagger-annotations 202 | ${swagger-core-version} 203 | 204 | 205 | 206 | com.google.code.findbugs 207 | jsr305 208 | 3.0.2 209 | 210 | 211 | com.squareup.okhttp3 212 | okhttp 213 | ${okhttp-version} 214 | 215 | 216 | com.squareup.okhttp3 217 | logging-interceptor 218 | ${okhttp-version} 219 | 220 | 221 | com.google.code.gson 222 | gson 223 | ${gson-version} 224 | 225 | 226 | io.gsonfire 227 | gson-fire 228 | ${gson-fire-version} 229 | 230 | 231 | org.apache.commons 232 | commons-lang3 233 | ${commons-lang3-version} 234 | 235 | 236 | org.threeten 237 | threetenbp 238 | ${threetenbp-version} 239 | 240 | 241 | javax.annotation 242 | jsr250-api 243 | ${javax-annotation-version} 244 | 245 | 246 | 247 | junit 248 | junit 249 | ${junit-version} 250 | test 251 | 252 | 253 | 254 | 1.7 255 | ${java.version} 256 | ${java.version} 257 | 1.8.3 258 | 1.5.22 259 | 3.14.2 260 | 2.8.5 261 | 3.9 262 | 1.4.0 263 | 1.0.0 264 | 1.0 265 | 4.13 266 | UTF-8 267 | 268 | 269 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "openapi-java-client" -------------------------------------------------------------------------------- /src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ApiCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import java.io.IOException; 17 | 18 | import java.util.Map; 19 | import java.util.List; 20 | 21 | /** 22 | * Callback for asynchronous API call. 23 | * 24 | * @param The return type 25 | */ 26 | public interface ApiCallback { 27 | /** 28 | * This is called when the API call fails. 29 | * 30 | * @param e The exception causing the failure 31 | * @param statusCode Status code of the response if available, otherwise it would be 0 32 | * @param responseHeaders Headers of the response if available, otherwise it would be null 33 | */ 34 | void onFailure(ApiException e, int statusCode, Map> responseHeaders); 35 | 36 | /** 37 | * This is called when the API call succeeded. 38 | * 39 | * @param result The result deserialized from response 40 | * @param statusCode Status code of the response 41 | * @param responseHeaders Headers of the response 42 | */ 43 | void onSuccess(T result, int statusCode, Map> responseHeaders); 44 | 45 | /** 46 | * This is called when the API upload processing. 47 | * 48 | * @param bytesWritten bytes Written 49 | * @param contentLength content length of request body 50 | * @param done write end 51 | */ 52 | void onUploadProgress(long bytesWritten, long contentLength, boolean done); 53 | 54 | /** 55 | * This is called when the API downlond processing. 56 | * 57 | * @param bytesRead bytes Read 58 | * @param contentLength content lenngth of the response 59 | * @param done Read end 60 | */ 61 | void onDownloadProgress(long bytesRead, long contentLength, boolean done); 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ApiClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import okhttp3.*; 17 | import okhttp3.internal.http.HttpMethod; 18 | import okhttp3.internal.tls.OkHostnameVerifier; 19 | import okhttp3.logging.HttpLoggingInterceptor; 20 | import okhttp3.logging.HttpLoggingInterceptor.Level; 21 | import okio.BufferedSink; 22 | import okio.Okio; 23 | import org.threeten.bp.LocalDate; 24 | import org.threeten.bp.OffsetDateTime; 25 | import org.threeten.bp.format.DateTimeFormatter; 26 | 27 | import javax.net.ssl.*; 28 | import java.io.File; 29 | import java.io.IOException; 30 | import java.io.InputStream; 31 | import java.io.UnsupportedEncodingException; 32 | import java.lang.reflect.Type; 33 | import java.net.URI; 34 | import java.net.URLConnection; 35 | import java.net.URLEncoder; 36 | import java.security.GeneralSecurityException; 37 | import java.security.KeyStore; 38 | import java.security.SecureRandom; 39 | import java.security.cert.Certificate; 40 | import java.security.cert.CertificateException; 41 | import java.security.cert.CertificateFactory; 42 | import java.security.cert.X509Certificate; 43 | import java.text.DateFormat; 44 | import java.util.*; 45 | import java.util.Map.Entry; 46 | import java.util.concurrent.TimeUnit; 47 | import java.util.regex.Matcher; 48 | import java.util.regex.Pattern; 49 | 50 | import org.openapitools.client.auth.Authentication; 51 | import org.openapitools.client.auth.HttpBasicAuth; 52 | import org.openapitools.client.auth.HttpBearerAuth; 53 | import org.openapitools.client.auth.ApiKeyAuth; 54 | 55 | public class ApiClient { 56 | 57 | private String basePath = "http://localhost"; 58 | private boolean debugging = false; 59 | private Map defaultHeaderMap = new HashMap(); 60 | private Map defaultCookieMap = new HashMap(); 61 | private String tempFolderPath = null; 62 | 63 | private Map authentications; 64 | 65 | private DateFormat dateFormat; 66 | private DateFormat datetimeFormat; 67 | private boolean lenientDatetimeFormat; 68 | private int dateLength; 69 | 70 | private InputStream sslCaCert; 71 | private boolean verifyingSsl; 72 | private KeyManager[] keyManagers; 73 | 74 | private OkHttpClient httpClient; 75 | private JSON json; 76 | 77 | private HttpLoggingInterceptor loggingInterceptor; 78 | 79 | /* 80 | * Basic constructor for ApiClient 81 | */ 82 | public ApiClient() { 83 | init(); 84 | initHttpClient(); 85 | 86 | // Setup authentications (key: authentication name, value: authentication). 87 | // Prevent the authentications from being modified. 88 | authentications = Collections.unmodifiableMap(authentications); 89 | } 90 | 91 | private void initHttpClient() { 92 | initHttpClient(Collections.emptyList()); 93 | } 94 | 95 | private void initHttpClient(List interceptors) { 96 | OkHttpClient.Builder builder = new OkHttpClient.Builder(); 97 | builder.addNetworkInterceptor(getProgressInterceptor()); 98 | for (Interceptor interceptor: interceptors) { 99 | builder.addInterceptor(interceptor); 100 | } 101 | 102 | httpClient = builder.build(); 103 | } 104 | 105 | private void init() { 106 | verifyingSsl = true; 107 | 108 | json = new JSON(); 109 | 110 | // Set default User-Agent. 111 | setUserAgent("OpenAPI-Generator/1.0.0/java"); 112 | 113 | authentications = new HashMap(); 114 | } 115 | 116 | /** 117 | * Get base path 118 | * 119 | * @return Base path 120 | */ 121 | public String getBasePath() { 122 | return basePath; 123 | } 124 | 125 | /** 126 | * Set base path 127 | * 128 | * @param basePath Base path of the URL (e.g http://localhost 129 | * @return An instance of OkHttpClient 130 | */ 131 | public ApiClient setBasePath(String basePath) { 132 | this.basePath = basePath; 133 | return this; 134 | } 135 | 136 | /** 137 | * Get HTTP client 138 | * 139 | * @return An instance of OkHttpClient 140 | */ 141 | public OkHttpClient getHttpClient() { 142 | return httpClient; 143 | } 144 | 145 | /** 146 | * Set HTTP client, which must never be null. 147 | * 148 | * @param newHttpClient An instance of OkHttpClient 149 | * @return Api Client 150 | * @throws NullPointerException when newHttpClient is null 151 | */ 152 | public ApiClient setHttpClient(OkHttpClient newHttpClient) { 153 | this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); 154 | return this; 155 | } 156 | 157 | /** 158 | * Get JSON 159 | * 160 | * @return JSON object 161 | */ 162 | public JSON getJSON() { 163 | return json; 164 | } 165 | 166 | /** 167 | * Set JSON 168 | * 169 | * @param json JSON object 170 | * @return Api client 171 | */ 172 | public ApiClient setJSON(JSON json) { 173 | this.json = json; 174 | return this; 175 | } 176 | 177 | /** 178 | * True if isVerifyingSsl flag is on 179 | * 180 | * @return True if isVerifySsl flag is on 181 | */ 182 | public boolean isVerifyingSsl() { 183 | return verifyingSsl; 184 | } 185 | 186 | /** 187 | * Configure whether to verify certificate and hostname when making https requests. 188 | * Default to true. 189 | * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. 190 | * 191 | * @param verifyingSsl True to verify TLS/SSL connection 192 | * @return ApiClient 193 | */ 194 | public ApiClient setVerifyingSsl(boolean verifyingSsl) { 195 | this.verifyingSsl = verifyingSsl; 196 | applySslSettings(); 197 | return this; 198 | } 199 | 200 | /** 201 | * Get SSL CA cert. 202 | * 203 | * @return Input stream to the SSL CA cert 204 | */ 205 | public InputStream getSslCaCert() { 206 | return sslCaCert; 207 | } 208 | 209 | /** 210 | * Configure the CA certificate to be trusted when making https requests. 211 | * Use null to reset to default. 212 | * 213 | * @param sslCaCert input stream for SSL CA cert 214 | * @return ApiClient 215 | */ 216 | public ApiClient setSslCaCert(InputStream sslCaCert) { 217 | this.sslCaCert = sslCaCert; 218 | applySslSettings(); 219 | return this; 220 | } 221 | 222 | public KeyManager[] getKeyManagers() { 223 | return keyManagers; 224 | } 225 | 226 | /** 227 | * Configure client keys to use for authorization in an SSL session. 228 | * Use null to reset to default. 229 | * 230 | * @param managers The KeyManagers to use 231 | * @return ApiClient 232 | */ 233 | public ApiClient setKeyManagers(KeyManager[] managers) { 234 | this.keyManagers = managers; 235 | applySslSettings(); 236 | return this; 237 | } 238 | 239 | public DateFormat getDateFormat() { 240 | return dateFormat; 241 | } 242 | 243 | public ApiClient setDateFormat(DateFormat dateFormat) { 244 | this.json.setDateFormat(dateFormat); 245 | return this; 246 | } 247 | 248 | public ApiClient setSqlDateFormat(DateFormat dateFormat) { 249 | this.json.setSqlDateFormat(dateFormat); 250 | return this; 251 | } 252 | 253 | public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { 254 | this.json.setOffsetDateTimeFormat(dateFormat); 255 | return this; 256 | } 257 | 258 | public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { 259 | this.json.setLocalDateFormat(dateFormat); 260 | return this; 261 | } 262 | 263 | public ApiClient setLenientOnJson(boolean lenientOnJson) { 264 | this.json.setLenientOnJson(lenientOnJson); 265 | return this; 266 | } 267 | 268 | /** 269 | * Get authentications (key: authentication name, value: authentication). 270 | * 271 | * @return Map of authentication objects 272 | */ 273 | public Map getAuthentications() { 274 | return authentications; 275 | } 276 | 277 | /** 278 | * Get authentication for the given name. 279 | * 280 | * @param authName The authentication name 281 | * @return The authentication, null if not found 282 | */ 283 | public Authentication getAuthentication(String authName) { 284 | return authentications.get(authName); 285 | } 286 | 287 | /** 288 | * Helper method to set username for the first HTTP basic authentication. 289 | * 290 | * @param username Username 291 | */ 292 | public void setUsername(String username) { 293 | for (Authentication auth : authentications.values()) { 294 | if (auth instanceof HttpBasicAuth) { 295 | ((HttpBasicAuth) auth).setUsername(username); 296 | return; 297 | } 298 | } 299 | throw new RuntimeException("No HTTP basic authentication configured!"); 300 | } 301 | 302 | /** 303 | * Helper method to set password for the first HTTP basic authentication. 304 | * 305 | * @param password Password 306 | */ 307 | public void setPassword(String password) { 308 | for (Authentication auth : authentications.values()) { 309 | if (auth instanceof HttpBasicAuth) { 310 | ((HttpBasicAuth) auth).setPassword(password); 311 | return; 312 | } 313 | } 314 | throw new RuntimeException("No HTTP basic authentication configured!"); 315 | } 316 | 317 | /** 318 | * Helper method to set API key value for the first API key authentication. 319 | * 320 | * @param apiKey API key 321 | */ 322 | public void setApiKey(String apiKey) { 323 | for (Authentication auth : authentications.values()) { 324 | if (auth instanceof ApiKeyAuth) { 325 | ((ApiKeyAuth) auth).setApiKey(apiKey); 326 | return; 327 | } 328 | } 329 | throw new RuntimeException("No API key authentication configured!"); 330 | } 331 | 332 | /** 333 | * Helper method to set API key prefix for the first API key authentication. 334 | * 335 | * @param apiKeyPrefix API key prefix 336 | */ 337 | public void setApiKeyPrefix(String apiKeyPrefix) { 338 | for (Authentication auth : authentications.values()) { 339 | if (auth instanceof ApiKeyAuth) { 340 | ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); 341 | return; 342 | } 343 | } 344 | throw new RuntimeException("No API key authentication configured!"); 345 | } 346 | 347 | /** 348 | * Helper method to set access token for the first OAuth2 authentication. 349 | * 350 | * @param accessToken Access token 351 | */ 352 | public void setAccessToken(String accessToken) { 353 | throw new RuntimeException("No OAuth2 authentication configured!"); 354 | } 355 | 356 | /** 357 | * Set the User-Agent header's value (by adding to the default header map). 358 | * 359 | * @param userAgent HTTP request's user agent 360 | * @return ApiClient 361 | */ 362 | public ApiClient setUserAgent(String userAgent) { 363 | addDefaultHeader("User-Agent", userAgent); 364 | return this; 365 | } 366 | 367 | /** 368 | * Add a default header. 369 | * 370 | * @param key The header's key 371 | * @param value The header's value 372 | * @return ApiClient 373 | */ 374 | public ApiClient addDefaultHeader(String key, String value) { 375 | defaultHeaderMap.put(key, value); 376 | return this; 377 | } 378 | 379 | /** 380 | * Add a default cookie. 381 | * 382 | * @param key The cookie's key 383 | * @param value The cookie's value 384 | * @return ApiClient 385 | */ 386 | public ApiClient addDefaultCookie(String key, String value) { 387 | defaultCookieMap.put(key, value); 388 | return this; 389 | } 390 | 391 | /** 392 | * Check that whether debugging is enabled for this API client. 393 | * 394 | * @return True if debugging is enabled, false otherwise. 395 | */ 396 | public boolean isDebugging() { 397 | return debugging; 398 | } 399 | 400 | /** 401 | * Enable/disable debugging for this API client. 402 | * 403 | * @param debugging To enable (true) or disable (false) debugging 404 | * @return ApiClient 405 | */ 406 | public ApiClient setDebugging(boolean debugging) { 407 | if (debugging != this.debugging) { 408 | if (debugging) { 409 | loggingInterceptor = new HttpLoggingInterceptor(); 410 | loggingInterceptor.setLevel(Level.BODY); 411 | httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); 412 | } else { 413 | httpClient.interceptors().remove(loggingInterceptor); 414 | loggingInterceptor = null; 415 | } 416 | } 417 | this.debugging = debugging; 418 | return this; 419 | } 420 | 421 | /** 422 | * The path of temporary folder used to store downloaded files from endpoints 423 | * with file response. The default value is null, i.e. using 424 | * the system's default tempopary folder. 425 | * 426 | * @see createTempFile 427 | * @return Temporary folder path 428 | */ 429 | public String getTempFolderPath() { 430 | return tempFolderPath; 431 | } 432 | 433 | /** 434 | * Set the temporary folder path (for downloading files) 435 | * 436 | * @param tempFolderPath Temporary folder path 437 | * @return ApiClient 438 | */ 439 | public ApiClient setTempFolderPath(String tempFolderPath) { 440 | this.tempFolderPath = tempFolderPath; 441 | return this; 442 | } 443 | 444 | /** 445 | * Get connection timeout (in milliseconds). 446 | * 447 | * @return Timeout in milliseconds 448 | */ 449 | public int getConnectTimeout() { 450 | return httpClient.connectTimeoutMillis(); 451 | } 452 | 453 | /** 454 | * Sets the connect timeout (in milliseconds). 455 | * A value of 0 means no timeout, otherwise values must be between 1 and 456 | * {@link Integer#MAX_VALUE}. 457 | * 458 | * @param connectionTimeout connection timeout in milliseconds 459 | * @return Api client 460 | */ 461 | public ApiClient setConnectTimeout(int connectionTimeout) { 462 | httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); 463 | return this; 464 | } 465 | 466 | /** 467 | * Get read timeout (in milliseconds). 468 | * 469 | * @return Timeout in milliseconds 470 | */ 471 | public int getReadTimeout() { 472 | return httpClient.readTimeoutMillis(); 473 | } 474 | 475 | /** 476 | * Sets the read timeout (in milliseconds). 477 | * A value of 0 means no timeout, otherwise values must be between 1 and 478 | * {@link Integer#MAX_VALUE}. 479 | * 480 | * @param readTimeout read timeout in milliseconds 481 | * @return Api client 482 | */ 483 | public ApiClient setReadTimeout(int readTimeout) { 484 | httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); 485 | return this; 486 | } 487 | 488 | /** 489 | * Get write timeout (in milliseconds). 490 | * 491 | * @return Timeout in milliseconds 492 | */ 493 | public int getWriteTimeout() { 494 | return httpClient.writeTimeoutMillis(); 495 | } 496 | 497 | /** 498 | * Sets the write timeout (in milliseconds). 499 | * A value of 0 means no timeout, otherwise values must be between 1 and 500 | * {@link Integer#MAX_VALUE}. 501 | * 502 | * @param writeTimeout connection timeout in milliseconds 503 | * @return Api client 504 | */ 505 | public ApiClient setWriteTimeout(int writeTimeout) { 506 | httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); 507 | return this; 508 | } 509 | 510 | 511 | /** 512 | * Format the given parameter object into string. 513 | * 514 | * @param param Parameter 515 | * @return String representation of the parameter 516 | */ 517 | public String parameterToString(Object param) { 518 | if (param == null) { 519 | return ""; 520 | } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { 521 | //Serialize to json string and remove the " enclosing characters 522 | String jsonStr = json.serialize(param); 523 | return jsonStr.substring(1, jsonStr.length() - 1); 524 | } else if (param instanceof Collection) { 525 | StringBuilder b = new StringBuilder(); 526 | for (Object o : (Collection) param) { 527 | if (b.length() > 0) { 528 | b.append(","); 529 | } 530 | b.append(String.valueOf(o)); 531 | } 532 | return b.toString(); 533 | } else { 534 | return String.valueOf(param); 535 | } 536 | } 537 | 538 | /** 539 | * Formats the specified query parameter to a list containing a single {@code Pair} object. 540 | * 541 | * Note that {@code value} must not be a collection. 542 | * 543 | * @param name The name of the parameter. 544 | * @param value The value of the parameter. 545 | * @return A list containing a single {@code Pair} object. 546 | */ 547 | public List parameterToPair(String name, Object value) { 548 | List params = new ArrayList(); 549 | 550 | // preconditions 551 | if (name == null || name.isEmpty() || value == null || value instanceof Collection) { 552 | return params; 553 | } 554 | 555 | params.add(new Pair(name, parameterToString(value))); 556 | return params; 557 | } 558 | 559 | /** 560 | * Formats the specified collection query parameters to a list of {@code Pair} objects. 561 | * 562 | * Note that the values of each of the returned Pair objects are percent-encoded. 563 | * 564 | * @param collectionFormat The collection format of the parameter. 565 | * @param name The name of the parameter. 566 | * @param value The value of the parameter. 567 | * @return A list of {@code Pair} objects. 568 | */ 569 | public List parameterToPairs(String collectionFormat, String name, Collection value) { 570 | List params = new ArrayList(); 571 | 572 | // preconditions 573 | if (name == null || name.isEmpty() || value == null || value.isEmpty()) { 574 | return params; 575 | } 576 | 577 | // create the params based on the collection format 578 | if ("multi".equals(collectionFormat)) { 579 | for (Object item : value) { 580 | params.add(new Pair(name, escapeString(parameterToString(item)))); 581 | } 582 | return params; 583 | } 584 | 585 | // collectionFormat is assumed to be "csv" by default 586 | String delimiter = ","; 587 | 588 | // escape all delimiters except commas, which are URI reserved 589 | // characters 590 | if ("ssv".equals(collectionFormat)) { 591 | delimiter = escapeString(" "); 592 | } else if ("tsv".equals(collectionFormat)) { 593 | delimiter = escapeString("\t"); 594 | } else if ("pipes".equals(collectionFormat)) { 595 | delimiter = escapeString("|"); 596 | } 597 | 598 | StringBuilder sb = new StringBuilder(); 599 | for (Object item : value) { 600 | sb.append(delimiter); 601 | sb.append(escapeString(parameterToString(item))); 602 | } 603 | 604 | params.add(new Pair(name, sb.substring(delimiter.length()))); 605 | 606 | return params; 607 | } 608 | 609 | /** 610 | * Formats the specified collection path parameter to a string value. 611 | * 612 | * @param collectionFormat The collection format of the parameter. 613 | * @param value The value of the parameter. 614 | * @return String representation of the parameter 615 | */ 616 | public String collectionPathParameterToString(String collectionFormat, Collection value) { 617 | // create the value based on the collection format 618 | if ("multi".equals(collectionFormat)) { 619 | // not valid for path params 620 | return parameterToString(value); 621 | } 622 | 623 | // collectionFormat is assumed to be "csv" by default 624 | String delimiter = ","; 625 | 626 | if ("ssv".equals(collectionFormat)) { 627 | delimiter = " "; 628 | } else if ("tsv".equals(collectionFormat)) { 629 | delimiter = "\t"; 630 | } else if ("pipes".equals(collectionFormat)) { 631 | delimiter = "|"; 632 | } 633 | 634 | StringBuilder sb = new StringBuilder() ; 635 | for (Object item : value) { 636 | sb.append(delimiter); 637 | sb.append(parameterToString(item)); 638 | } 639 | 640 | return sb.substring(delimiter.length()); 641 | } 642 | 643 | /** 644 | * Sanitize filename by removing path. 645 | * e.g. ../../sun.gif becomes sun.gif 646 | * 647 | * @param filename The filename to be sanitized 648 | * @return The sanitized filename 649 | */ 650 | public String sanitizeFilename(String filename) { 651 | return filename.replaceAll(".*[/\\\\]", ""); 652 | } 653 | 654 | /** 655 | * Check if the given MIME is a JSON MIME. 656 | * JSON MIME examples: 657 | * application/json 658 | * application/json; charset=UTF8 659 | * APPLICATION/JSON 660 | * application/vnd.company+json 661 | * "* / *" is also default to JSON 662 | * @param mime MIME (Multipurpose Internet Mail Extensions) 663 | * @return True if the given MIME is JSON, false otherwise. 664 | */ 665 | public boolean isJsonMime(String mime) { 666 | String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; 667 | return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); 668 | } 669 | 670 | /** 671 | * Select the Accept header's value from the given accepts array: 672 | * if JSON exists in the given array, use it; 673 | * otherwise use all of them (joining into a string) 674 | * 675 | * @param accepts The accepts array to select from 676 | * @return The Accept header to use. If the given array is empty, 677 | * null will be returned (not to set the Accept header explicitly). 678 | */ 679 | public String selectHeaderAccept(String[] accepts) { 680 | if (accepts.length == 0) { 681 | return null; 682 | } 683 | for (String accept : accepts) { 684 | if (isJsonMime(accept)) { 685 | return accept; 686 | } 687 | } 688 | return StringUtil.join(accepts, ","); 689 | } 690 | 691 | /** 692 | * Select the Content-Type header's value from the given array: 693 | * if JSON exists in the given array, use it; 694 | * otherwise use the first one of the array. 695 | * 696 | * @param contentTypes The Content-Type array to select from 697 | * @return The Content-Type header to use. If the given array is empty, 698 | * or matches "any", JSON will be used. 699 | */ 700 | public String selectHeaderContentType(String[] contentTypes) { 701 | if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { 702 | return "application/json"; 703 | } 704 | for (String contentType : contentTypes) { 705 | if (isJsonMime(contentType)) { 706 | return contentType; 707 | } 708 | } 709 | return contentTypes[0]; 710 | } 711 | 712 | /** 713 | * Escape the given string to be used as URL query value. 714 | * 715 | * @param str String to be escaped 716 | * @return Escaped string 717 | */ 718 | public String escapeString(String str) { 719 | try { 720 | return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); 721 | } catch (UnsupportedEncodingException e) { 722 | return str; 723 | } 724 | } 725 | 726 | /** 727 | * Deserialize response body to Java object, according to the return type and 728 | * the Content-Type response header. 729 | * 730 | * @param Type 731 | * @param response HTTP response 732 | * @param returnType The type of the Java object 733 | * @return The deserialized Java object 734 | * @throws ApiException If fail to deserialize response body, i.e. cannot read response body 735 | * or the Content-Type of the response is not supported. 736 | */ 737 | @SuppressWarnings("unchecked") 738 | public T deserialize(Response response, Type returnType) throws ApiException { 739 | if (response == null || returnType == null) { 740 | return null; 741 | } 742 | 743 | if ("byte[]".equals(returnType.toString())) { 744 | // Handle binary response (byte array). 745 | try { 746 | return (T) response.body().bytes(); 747 | } catch (IOException e) { 748 | throw new ApiException(e); 749 | } 750 | } else if (returnType.equals(File.class)) { 751 | // Handle file downloading. 752 | return (T) downloadFileFromResponse(response); 753 | } 754 | 755 | String respBody; 756 | try { 757 | if (response.body() != null) 758 | respBody = response.body().string(); 759 | else 760 | respBody = null; 761 | } catch (IOException e) { 762 | throw new ApiException(e); 763 | } 764 | 765 | if (respBody == null || "".equals(respBody)) { 766 | return null; 767 | } 768 | 769 | String contentType = response.headers().get("Content-Type"); 770 | if (contentType == null) { 771 | // ensuring a default content type 772 | contentType = "application/json"; 773 | } 774 | if (isJsonMime(contentType)) { 775 | return json.deserialize(respBody, returnType); 776 | } else if (returnType.equals(String.class)) { 777 | // Expecting string, return the raw response body. 778 | return (T) respBody; 779 | } else { 780 | throw new ApiException( 781 | "Content type \"" + contentType + "\" is not supported for type: " + returnType, 782 | response.code(), 783 | response.headers().toMultimap(), 784 | respBody); 785 | } 786 | } 787 | 788 | /** 789 | * Serialize the given Java object into request body according to the object's 790 | * class and the request Content-Type. 791 | * 792 | * @param obj The Java object 793 | * @param contentType The request Content-Type 794 | * @return The serialized request body 795 | * @throws ApiException If fail to serialize the given object 796 | */ 797 | public RequestBody serialize(Object obj, String contentType) throws ApiException { 798 | if (obj instanceof byte[]) { 799 | // Binary (byte array) body parameter support. 800 | return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); 801 | } else if (obj instanceof File) { 802 | // File body parameter support. 803 | return RequestBody.create(MediaType.parse(contentType), (File) obj); 804 | } else if (isJsonMime(contentType)) { 805 | String content; 806 | if (obj != null) { 807 | content = json.serialize(obj); 808 | } else { 809 | content = null; 810 | } 811 | return RequestBody.create(MediaType.parse(contentType), content); 812 | } else { 813 | throw new ApiException("Content type \"" + contentType + "\" is not supported"); 814 | } 815 | } 816 | 817 | /** 818 | * Download file from the given response. 819 | * 820 | * @param response An instance of the Response object 821 | * @throws ApiException If fail to read file content from response and write to disk 822 | * @return Downloaded file 823 | */ 824 | public File downloadFileFromResponse(Response response) throws ApiException { 825 | try { 826 | File file = prepareDownloadFile(response); 827 | BufferedSink sink = Okio.buffer(Okio.sink(file)); 828 | sink.writeAll(response.body().source()); 829 | sink.close(); 830 | return file; 831 | } catch (IOException e) { 832 | throw new ApiException(e); 833 | } 834 | } 835 | 836 | /** 837 | * Prepare file for download 838 | * 839 | * @param response An instance of the Response object 840 | * @return Prepared file for the download 841 | * @throws IOException If fail to prepare file for download 842 | */ 843 | public File prepareDownloadFile(Response response) throws IOException { 844 | String filename = null; 845 | String contentDisposition = response.header("Content-Disposition"); 846 | if (contentDisposition != null && !"".equals(contentDisposition)) { 847 | // Get filename from the Content-Disposition header. 848 | Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); 849 | Matcher matcher = pattern.matcher(contentDisposition); 850 | if (matcher.find()) { 851 | filename = sanitizeFilename(matcher.group(1)); 852 | } 853 | } 854 | 855 | String prefix = null; 856 | String suffix = null; 857 | if (filename == null) { 858 | prefix = "download-"; 859 | suffix = ""; 860 | } else { 861 | int pos = filename.lastIndexOf("."); 862 | if (pos == -1) { 863 | prefix = filename + "-"; 864 | } else { 865 | prefix = filename.substring(0, pos) + "-"; 866 | suffix = filename.substring(pos); 867 | } 868 | // File.createTempFile requires the prefix to be at least three characters long 869 | if (prefix.length() < 3) 870 | prefix = "download-"; 871 | } 872 | 873 | if (tempFolderPath == null) 874 | return File.createTempFile(prefix, suffix); 875 | else 876 | return File.createTempFile(prefix, suffix, new File(tempFolderPath)); 877 | } 878 | 879 | /** 880 | * {@link #execute(Call, Type)} 881 | * 882 | * @param Type 883 | * @param call An instance of the Call object 884 | * @return ApiResponse<T> 885 | * @throws ApiException If fail to execute the call 886 | */ 887 | public ApiResponse execute(Call call) throws ApiException { 888 | return execute(call, null); 889 | } 890 | 891 | /** 892 | * Execute HTTP call and deserialize the HTTP response body into the given return type. 893 | * 894 | * @param returnType The return type used to deserialize HTTP response body 895 | * @param The return type corresponding to (same with) returnType 896 | * @param call Call 897 | * @return ApiResponse object containing response status, headers and 898 | * data, which is a Java object deserialized from response body and would be null 899 | * when returnType is null. 900 | * @throws ApiException If fail to execute the call 901 | */ 902 | public ApiResponse execute(Call call, Type returnType) throws ApiException { 903 | try { 904 | Response response = call.execute(); 905 | T data = handleResponse(response, returnType); 906 | return new ApiResponse(response.code(), response.headers().toMultimap(), data); 907 | } catch (IOException e) { 908 | throw new ApiException(e); 909 | } 910 | } 911 | 912 | /** 913 | * {@link #executeAsync(Call, Type, ApiCallback)} 914 | * 915 | * @param Type 916 | * @param call An instance of the Call object 917 | * @param callback ApiCallback<T> 918 | */ 919 | public void executeAsync(Call call, ApiCallback callback) { 920 | executeAsync(call, null, callback); 921 | } 922 | 923 | /** 924 | * Execute HTTP call asynchronously. 925 | * 926 | * @param Type 927 | * @param call The callback to be executed when the API call finishes 928 | * @param returnType Return type 929 | * @param callback ApiCallback 930 | * @see #execute(Call, Type) 931 | */ 932 | @SuppressWarnings("unchecked") 933 | public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { 934 | call.enqueue(new Callback() { 935 | @Override 936 | public void onFailure(Call call, IOException e) { 937 | callback.onFailure(new ApiException(e), 0, null); 938 | } 939 | 940 | @Override 941 | public void onResponse(Call call, Response response) throws IOException { 942 | T result; 943 | try { 944 | result = (T) handleResponse(response, returnType); 945 | } catch (ApiException e) { 946 | callback.onFailure(e, response.code(), response.headers().toMultimap()); 947 | return; 948 | } 949 | callback.onSuccess(result, response.code(), response.headers().toMultimap()); 950 | } 951 | }); 952 | } 953 | 954 | /** 955 | * Handle the given response, return the deserialized object when the response is successful. 956 | * 957 | * @param Type 958 | * @param response Response 959 | * @param returnType Return type 960 | * @return Type 961 | * @throws ApiException If the response has an unsuccessful status code or 962 | * fail to deserialize the response body 963 | */ 964 | public T handleResponse(Response response, Type returnType) throws ApiException { 965 | if (response.isSuccessful()) { 966 | if (returnType == null || response.code() == 204) { 967 | // returning null if the returnType is not defined, 968 | // or the status code is 204 (No Content) 969 | if (response.body() != null) { 970 | try { 971 | response.body().close(); 972 | } catch (Exception e) { 973 | throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); 974 | } 975 | } 976 | return null; 977 | } else { 978 | return deserialize(response, returnType); 979 | } 980 | } else { 981 | String respBody = null; 982 | if (response.body() != null) { 983 | try { 984 | respBody = response.body().string(); 985 | } catch (IOException e) { 986 | throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); 987 | } 988 | } 989 | throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); 990 | } 991 | } 992 | 993 | /** 994 | * Build HTTP call with the given options. 995 | * 996 | * @param path The sub-path of the HTTP URL 997 | * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" 998 | * @param queryParams The query parameters 999 | * @param collectionQueryParams The collection query parameters 1000 | * @param body The request body object 1001 | * @param headerParams The header parameters 1002 | * @param cookieParams The cookie parameters 1003 | * @param formParams The form parameters 1004 | * @param authNames The authentications to apply 1005 | * @param callback Callback for upload/download progress 1006 | * @return The HTTP call 1007 | * @throws ApiException If fail to serialize the request body object 1008 | */ 1009 | public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { 1010 | Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); 1011 | 1012 | return httpClient.newCall(request); 1013 | } 1014 | 1015 | /** 1016 | * Build an HTTP request with the given options. 1017 | * 1018 | * @param path The sub-path of the HTTP URL 1019 | * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" 1020 | * @param queryParams The query parameters 1021 | * @param collectionQueryParams The collection query parameters 1022 | * @param body The request body object 1023 | * @param headerParams The header parameters 1024 | * @param cookieParams The cookie parameters 1025 | * @param formParams The form parameters 1026 | * @param authNames The authentications to apply 1027 | * @param callback Callback for upload/download progress 1028 | * @return The HTTP request 1029 | * @throws ApiException If fail to serialize the request body object 1030 | */ 1031 | public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { 1032 | updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); 1033 | 1034 | final String url = buildUrl(path, queryParams, collectionQueryParams); 1035 | final Request.Builder reqBuilder = new Request.Builder().url(url); 1036 | processHeaderParams(headerParams, reqBuilder); 1037 | processCookieParams(cookieParams, reqBuilder); 1038 | 1039 | String contentType = (String) headerParams.get("Content-Type"); 1040 | // ensuring a default content type 1041 | if (contentType == null) { 1042 | contentType = "application/json"; 1043 | } 1044 | 1045 | RequestBody reqBody; 1046 | if (!HttpMethod.permitsRequestBody(method)) { 1047 | reqBody = null; 1048 | } else if ("application/x-www-form-urlencoded".equals(contentType)) { 1049 | reqBody = buildRequestBodyFormEncoding(formParams); 1050 | } else if ("multipart/form-data".equals(contentType)) { 1051 | reqBody = buildRequestBodyMultipart(formParams); 1052 | } else if (body == null) { 1053 | if ("DELETE".equals(method)) { 1054 | // allow calling DELETE without sending a request body 1055 | reqBody = null; 1056 | } else { 1057 | // use an empty request body (for POST, PUT and PATCH) 1058 | reqBody = RequestBody.create(MediaType.parse(contentType), ""); 1059 | } 1060 | } else { 1061 | reqBody = serialize(body, contentType); 1062 | } 1063 | 1064 | // Associate callback with request (if not null) so interceptor can 1065 | // access it when creating ProgressResponseBody 1066 | reqBuilder.tag(callback); 1067 | 1068 | Request request = null; 1069 | 1070 | if (callback != null && reqBody != null) { 1071 | ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); 1072 | request = reqBuilder.method(method, progressRequestBody).build(); 1073 | } else { 1074 | request = reqBuilder.method(method, reqBody).build(); 1075 | } 1076 | 1077 | return request; 1078 | } 1079 | 1080 | /** 1081 | * Build full URL by concatenating base path, the given sub path and query parameters. 1082 | * 1083 | * @param path The sub path 1084 | * @param queryParams The query parameters 1085 | * @param collectionQueryParams The collection query parameters 1086 | * @return The full URL 1087 | */ 1088 | public String buildUrl(String path, List queryParams, List collectionQueryParams) { 1089 | final StringBuilder url = new StringBuilder(); 1090 | url.append(basePath).append(path); 1091 | 1092 | if (queryParams != null && !queryParams.isEmpty()) { 1093 | // support (constant) query string in `path`, e.g. "/posts?draft=1" 1094 | String prefix = path.contains("?") ? "&" : "?"; 1095 | for (Pair param : queryParams) { 1096 | if (param.getValue() != null) { 1097 | if (prefix != null) { 1098 | url.append(prefix); 1099 | prefix = null; 1100 | } else { 1101 | url.append("&"); 1102 | } 1103 | String value = parameterToString(param.getValue()); 1104 | url.append(escapeString(param.getName())).append("=").append(escapeString(value)); 1105 | } 1106 | } 1107 | } 1108 | 1109 | if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { 1110 | String prefix = url.toString().contains("?") ? "&" : "?"; 1111 | for (Pair param : collectionQueryParams) { 1112 | if (param.getValue() != null) { 1113 | if (prefix != null) { 1114 | url.append(prefix); 1115 | prefix = null; 1116 | } else { 1117 | url.append("&"); 1118 | } 1119 | String value = parameterToString(param.getValue()); 1120 | // collection query parameter value already escaped as part of parameterToPairs 1121 | url.append(escapeString(param.getName())).append("=").append(value); 1122 | } 1123 | } 1124 | } 1125 | 1126 | return url.toString(); 1127 | } 1128 | 1129 | /** 1130 | * Set header parameters to the request builder, including default headers. 1131 | * 1132 | * @param headerParams Header parameters in the form of Map 1133 | * @param reqBuilder Request.Builder 1134 | */ 1135 | public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { 1136 | for (Entry param : headerParams.entrySet()) { 1137 | reqBuilder.header(param.getKey(), parameterToString(param.getValue())); 1138 | } 1139 | for (Entry header : defaultHeaderMap.entrySet()) { 1140 | if (!headerParams.containsKey(header.getKey())) { 1141 | reqBuilder.header(header.getKey(), parameterToString(header.getValue())); 1142 | } 1143 | } 1144 | } 1145 | 1146 | /** 1147 | * Set cookie parameters to the request builder, including default cookies. 1148 | * 1149 | * @param cookieParams Cookie parameters in the form of Map 1150 | * @param reqBuilder Request.Builder 1151 | */ 1152 | public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { 1153 | for (Entry param : cookieParams.entrySet()) { 1154 | reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); 1155 | } 1156 | for (Entry param : defaultCookieMap.entrySet()) { 1157 | if (!cookieParams.containsKey(param.getKey())) { 1158 | reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); 1159 | } 1160 | } 1161 | } 1162 | 1163 | /** 1164 | * Update query and header parameters based on authentication settings. 1165 | * 1166 | * @param authNames The authentications to apply 1167 | * @param queryParams List of query parameters 1168 | * @param headerParams Map of header parameters 1169 | * @param cookieParams Map of cookie parameters 1170 | */ 1171 | public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { 1172 | for (String authName : authNames) { 1173 | Authentication auth = authentications.get(authName); 1174 | if (auth == null) { 1175 | throw new RuntimeException("Authentication undefined: " + authName); 1176 | } 1177 | auth.applyToParams(queryParams, headerParams, cookieParams); 1178 | } 1179 | } 1180 | 1181 | /** 1182 | * Build a form-encoding request body with the given form parameters. 1183 | * 1184 | * @param formParams Form parameters in the form of Map 1185 | * @return RequestBody 1186 | */ 1187 | public RequestBody buildRequestBodyFormEncoding(Map formParams) { 1188 | okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); 1189 | for (Entry param : formParams.entrySet()) { 1190 | formBuilder.add(param.getKey(), parameterToString(param.getValue())); 1191 | } 1192 | return formBuilder.build(); 1193 | } 1194 | 1195 | /** 1196 | * Build a multipart (file uploading) request body with the given form parameters, 1197 | * which could contain text fields and file fields. 1198 | * 1199 | * @param formParams Form parameters in the form of Map 1200 | * @return RequestBody 1201 | */ 1202 | public RequestBody buildRequestBodyMultipart(Map formParams) { 1203 | MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); 1204 | for (Entry param : formParams.entrySet()) { 1205 | if (param.getValue() instanceof File) { 1206 | File file = (File) param.getValue(); 1207 | Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); 1208 | MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); 1209 | mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); 1210 | } else { 1211 | Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); 1212 | mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); 1213 | } 1214 | } 1215 | return mpBuilder.build(); 1216 | } 1217 | 1218 | /** 1219 | * Guess Content-Type header from the given file (defaults to "application/octet-stream"). 1220 | * 1221 | * @param file The given file 1222 | * @return The guessed Content-Type 1223 | */ 1224 | public String guessContentTypeFromFile(File file) { 1225 | String contentType = URLConnection.guessContentTypeFromName(file.getName()); 1226 | if (contentType == null) { 1227 | return "application/octet-stream"; 1228 | } else { 1229 | return contentType; 1230 | } 1231 | } 1232 | 1233 | /** 1234 | * Get network interceptor to add it to the httpClient to track download progress for 1235 | * async requests. 1236 | */ 1237 | private Interceptor getProgressInterceptor() { 1238 | return new Interceptor() { 1239 | @Override 1240 | public Response intercept(Interceptor.Chain chain) throws IOException { 1241 | final Request request = chain.request(); 1242 | final Response originalResponse = chain.proceed(request); 1243 | if (request.tag() instanceof ApiCallback) { 1244 | final ApiCallback callback = (ApiCallback) request.tag(); 1245 | return originalResponse.newBuilder() 1246 | .body(new ProgressResponseBody(originalResponse.body(), callback)) 1247 | .build(); 1248 | } 1249 | return originalResponse; 1250 | } 1251 | }; 1252 | } 1253 | 1254 | /** 1255 | * Apply SSL related settings to httpClient according to the current values of 1256 | * verifyingSsl and sslCaCert. 1257 | */ 1258 | private void applySslSettings() { 1259 | try { 1260 | TrustManager[] trustManagers; 1261 | HostnameVerifier hostnameVerifier; 1262 | if (!verifyingSsl) { 1263 | trustManagers = new TrustManager[]{ 1264 | new X509TrustManager() { 1265 | @Override 1266 | public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { 1267 | } 1268 | 1269 | @Override 1270 | public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { 1271 | } 1272 | 1273 | @Override 1274 | public java.security.cert.X509Certificate[] getAcceptedIssuers() { 1275 | return new java.security.cert.X509Certificate[]{}; 1276 | } 1277 | } 1278 | }; 1279 | hostnameVerifier = new HostnameVerifier() { 1280 | @Override 1281 | public boolean verify(String hostname, SSLSession session) { 1282 | return true; 1283 | } 1284 | }; 1285 | } else { 1286 | TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); 1287 | 1288 | if (sslCaCert == null) { 1289 | trustManagerFactory.init((KeyStore) null); 1290 | } else { 1291 | char[] password = null; // Any password will work. 1292 | CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); 1293 | Collection certificates = certificateFactory.generateCertificates(sslCaCert); 1294 | if (certificates.isEmpty()) { 1295 | throw new IllegalArgumentException("expected non-empty set of trusted certificates"); 1296 | } 1297 | KeyStore caKeyStore = newEmptyKeyStore(password); 1298 | int index = 0; 1299 | for (Certificate certificate : certificates) { 1300 | String certificateAlias = "ca" + Integer.toString(index++); 1301 | caKeyStore.setCertificateEntry(certificateAlias, certificate); 1302 | } 1303 | trustManagerFactory.init(caKeyStore); 1304 | } 1305 | trustManagers = trustManagerFactory.getTrustManagers(); 1306 | hostnameVerifier = OkHostnameVerifier.INSTANCE; 1307 | } 1308 | 1309 | SSLContext sslContext = SSLContext.getInstance("TLS"); 1310 | sslContext.init(keyManagers, trustManagers, new SecureRandom()); 1311 | httpClient = httpClient.newBuilder() 1312 | .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) 1313 | .hostnameVerifier(hostnameVerifier) 1314 | .build(); 1315 | } catch (GeneralSecurityException e) { 1316 | throw new RuntimeException(e); 1317 | } 1318 | } 1319 | 1320 | private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { 1321 | try { 1322 | KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); 1323 | keyStore.load(null, password); 1324 | return keyStore; 1325 | } catch (IOException e) { 1326 | throw new AssertionError(e); 1327 | } 1328 | } 1329 | } 1330 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ApiException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import java.util.Map; 17 | import java.util.List; 18 | 19 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 20 | public class ApiException extends Exception { 21 | private int code = 0; 22 | private Map> responseHeaders = null; 23 | private String responseBody = null; 24 | 25 | public ApiException() {} 26 | 27 | public ApiException(Throwable throwable) { 28 | super(throwable); 29 | } 30 | 31 | public ApiException(String message) { 32 | super(message); 33 | } 34 | 35 | public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { 36 | super(message, throwable); 37 | this.code = code; 38 | this.responseHeaders = responseHeaders; 39 | this.responseBody = responseBody; 40 | } 41 | 42 | public ApiException(String message, int code, Map> responseHeaders, String responseBody) { 43 | this(message, (Throwable) null, code, responseHeaders, responseBody); 44 | } 45 | 46 | public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { 47 | this(message, throwable, code, responseHeaders, null); 48 | } 49 | 50 | public ApiException(int code, Map> responseHeaders, String responseBody) { 51 | this((String) null, (Throwable) null, code, responseHeaders, responseBody); 52 | } 53 | 54 | public ApiException(int code, String message) { 55 | super(message); 56 | this.code = code; 57 | } 58 | 59 | public ApiException(int code, String message, Map> responseHeaders, String responseBody) { 60 | this(code, message); 61 | this.responseHeaders = responseHeaders; 62 | this.responseBody = responseBody; 63 | } 64 | 65 | /** 66 | * Get the HTTP status code. 67 | * 68 | * @return HTTP status code 69 | */ 70 | public int getCode() { 71 | return code; 72 | } 73 | 74 | /** 75 | * Get the HTTP response headers. 76 | * 77 | * @return A map of list of string 78 | */ 79 | public Map> getResponseHeaders() { 80 | return responseHeaders; 81 | } 82 | 83 | /** 84 | * Get the HTTP response body. 85 | * 86 | * @return Response body in the form of string 87 | */ 88 | public String getResponseBody() { 89 | return responseBody; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ApiResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * API response returned by API call. 21 | * 22 | * @param The type of data that is deserialized from response body 23 | */ 24 | public class ApiResponse { 25 | final private int statusCode; 26 | final private Map> headers; 27 | final private T data; 28 | 29 | /** 30 | * @param statusCode The status code of HTTP response 31 | * @param headers The headers of HTTP response 32 | */ 33 | public ApiResponse(int statusCode, Map> headers) { 34 | this(statusCode, headers, null); 35 | } 36 | 37 | /** 38 | * @param statusCode The status code of HTTP response 39 | * @param headers The headers of HTTP response 40 | * @param data The object deserialized from response bod 41 | */ 42 | public ApiResponse(int statusCode, Map> headers, T data) { 43 | this.statusCode = statusCode; 44 | this.headers = headers; 45 | this.data = data; 46 | } 47 | 48 | public int getStatusCode() { 49 | return statusCode; 50 | } 51 | 52 | public Map> getHeaders() { 53 | return headers; 54 | } 55 | 56 | public T getData() { 57 | return data; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 17 | public class Configuration { 18 | private static ApiClient defaultApiClient = new ApiClient(); 19 | 20 | /** 21 | * Get the default API client, which would be used when creating API 22 | * instances without providing an API client. 23 | * 24 | * @return Default API client 25 | */ 26 | public static ApiClient getDefaultApiClient() { 27 | return defaultApiClient; 28 | } 29 | 30 | /** 31 | * Set the default API client, which would be used when creating API 32 | * instances without providing an API client. 33 | * 34 | * @param apiClient API client 35 | */ 36 | public static void setDefaultApiClient(ApiClient apiClient) { 37 | defaultApiClient = apiClient; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/GzipRequestInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import okhttp3.*; 17 | import okio.Buffer; 18 | import okio.BufferedSink; 19 | import okio.GzipSink; 20 | import okio.Okio; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * Encodes request bodies using gzip. 26 | * 27 | * Taken from https://github.com/square/okhttp/issues/350 28 | */ 29 | class GzipRequestInterceptor implements Interceptor { 30 | @Override 31 | public Response intercept(Chain chain) throws IOException { 32 | Request originalRequest = chain.request(); 33 | if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { 34 | return chain.proceed(originalRequest); 35 | } 36 | 37 | Request compressedRequest = originalRequest.newBuilder() 38 | .header("Content-Encoding", "gzip") 39 | .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) 40 | .build(); 41 | return chain.proceed(compressedRequest); 42 | } 43 | 44 | private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { 45 | final Buffer buffer = new Buffer(); 46 | requestBody.writeTo(buffer); 47 | return new RequestBody() { 48 | @Override 49 | public MediaType contentType() { 50 | return requestBody.contentType(); 51 | } 52 | 53 | @Override 54 | public long contentLength() { 55 | return buffer.size(); 56 | } 57 | 58 | @Override 59 | public void writeTo(BufferedSink sink) throws IOException { 60 | sink.write(buffer.snapshot()); 61 | } 62 | }; 63 | } 64 | 65 | private RequestBody gzip(final RequestBody body) { 66 | return new RequestBody() { 67 | @Override 68 | public MediaType contentType() { 69 | return body.contentType(); 70 | } 71 | 72 | @Override 73 | public long contentLength() { 74 | return -1; // We don't know the compressed length in advance! 75 | } 76 | 77 | @Override 78 | public void writeTo(BufferedSink sink) throws IOException { 79 | BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); 80 | body.writeTo(gzipSink); 81 | gzipSink.close(); 82 | } 83 | }; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/JSON.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import com.google.gson.Gson; 17 | import com.google.gson.GsonBuilder; 18 | import com.google.gson.JsonParseException; 19 | import com.google.gson.TypeAdapter; 20 | import com.google.gson.internal.bind.util.ISO8601Utils; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import com.google.gson.JsonElement; 24 | import io.gsonfire.GsonFireBuilder; 25 | import io.gsonfire.TypeSelector; 26 | import org.threeten.bp.LocalDate; 27 | import org.threeten.bp.OffsetDateTime; 28 | import org.threeten.bp.format.DateTimeFormatter; 29 | 30 | import org.openapitools.client.model.*; 31 | import okio.ByteString; 32 | 33 | import java.io.IOException; 34 | import java.io.StringReader; 35 | import java.lang.reflect.Type; 36 | import java.text.DateFormat; 37 | import java.text.ParseException; 38 | import java.text.ParsePosition; 39 | import java.util.Date; 40 | import java.util.Locale; 41 | import java.util.Map; 42 | import java.util.HashMap; 43 | 44 | public class JSON { 45 | private Gson gson; 46 | private boolean isLenientOnJson = false; 47 | private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); 48 | private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); 49 | private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); 50 | private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); 51 | private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); 52 | 53 | public static GsonBuilder createGson() { 54 | GsonFireBuilder fireBuilder = new GsonFireBuilder() 55 | ; 56 | GsonBuilder builder = fireBuilder.createGsonBuilder(); 57 | return builder; 58 | } 59 | 60 | private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { 61 | JsonElement element = readElement.getAsJsonObject().get(discriminatorField); 62 | if (null == element) { 63 | throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); 64 | } 65 | return element.getAsString(); 66 | } 67 | 68 | private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { 69 | Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase(Locale.ROOT)); 70 | if (null == clazz) { 71 | throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); 72 | } 73 | return clazz; 74 | } 75 | 76 | public JSON() { 77 | gson = createGson() 78 | .registerTypeAdapter(Date.class, dateTypeAdapter) 79 | .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) 80 | .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) 81 | .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) 82 | .registerTypeAdapter(byte[].class, byteArrayAdapter) 83 | .create(); 84 | } 85 | 86 | /** 87 | * Get Gson. 88 | * 89 | * @return Gson 90 | */ 91 | public Gson getGson() { 92 | return gson; 93 | } 94 | 95 | /** 96 | * Set Gson. 97 | * 98 | * @param gson Gson 99 | * @return JSON 100 | */ 101 | public JSON setGson(Gson gson) { 102 | this.gson = gson; 103 | return this; 104 | } 105 | 106 | public JSON setLenientOnJson(boolean lenientOnJson) { 107 | isLenientOnJson = lenientOnJson; 108 | return this; 109 | } 110 | 111 | /** 112 | * Serialize the given Java object into JSON string. 113 | * 114 | * @param obj Object 115 | * @return String representation of the JSON 116 | */ 117 | public String serialize(Object obj) { 118 | return gson.toJson(obj); 119 | } 120 | 121 | /** 122 | * Deserialize the given JSON string to Java object. 123 | * 124 | * @param Type 125 | * @param body The JSON string 126 | * @param returnType The type to deserialize into 127 | * @return The deserialized Java object 128 | */ 129 | @SuppressWarnings("unchecked") 130 | public T deserialize(String body, Type returnType) { 131 | try { 132 | if (isLenientOnJson) { 133 | JsonReader jsonReader = new JsonReader(new StringReader(body)); 134 | // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) 135 | jsonReader.setLenient(true); 136 | return gson.fromJson(jsonReader, returnType); 137 | } else { 138 | return gson.fromJson(body, returnType); 139 | } 140 | } catch (JsonParseException e) { 141 | // Fallback processing when failed to parse JSON form response body: 142 | // return the response body string directly for the String return type; 143 | if (returnType.equals(String.class)) { 144 | return (T) body; 145 | } else { 146 | throw (e); 147 | } 148 | } 149 | } 150 | 151 | /** 152 | * Gson TypeAdapter for Byte Array type 153 | */ 154 | public class ByteArrayAdapter extends TypeAdapter { 155 | 156 | @Override 157 | public void write(JsonWriter out, byte[] value) throws IOException { 158 | if (value == null) { 159 | out.nullValue(); 160 | } else { 161 | out.value(ByteString.of(value).base64()); 162 | } 163 | } 164 | 165 | @Override 166 | public byte[] read(JsonReader in) throws IOException { 167 | switch (in.peek()) { 168 | case NULL: 169 | in.nextNull(); 170 | return null; 171 | default: 172 | String bytesAsBase64 = in.nextString(); 173 | ByteString byteString = ByteString.decodeBase64(bytesAsBase64); 174 | return byteString.toByteArray(); 175 | } 176 | } 177 | } 178 | 179 | /** 180 | * Gson TypeAdapter for JSR310 OffsetDateTime type 181 | */ 182 | public static class OffsetDateTimeTypeAdapter extends TypeAdapter { 183 | 184 | private DateTimeFormatter formatter; 185 | 186 | public OffsetDateTimeTypeAdapter() { 187 | this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); 188 | } 189 | 190 | public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { 191 | this.formatter = formatter; 192 | } 193 | 194 | public void setFormat(DateTimeFormatter dateFormat) { 195 | this.formatter = dateFormat; 196 | } 197 | 198 | @Override 199 | public void write(JsonWriter out, OffsetDateTime date) throws IOException { 200 | if (date == null) { 201 | out.nullValue(); 202 | } else { 203 | out.value(formatter.format(date)); 204 | } 205 | } 206 | 207 | @Override 208 | public OffsetDateTime read(JsonReader in) throws IOException { 209 | switch (in.peek()) { 210 | case NULL: 211 | in.nextNull(); 212 | return null; 213 | default: 214 | String date = in.nextString(); 215 | if (date.endsWith("+0000")) { 216 | date = date.substring(0, date.length()-5) + "Z"; 217 | } 218 | return OffsetDateTime.parse(date, formatter); 219 | } 220 | } 221 | } 222 | 223 | /** 224 | * Gson TypeAdapter for JSR310 LocalDate type 225 | */ 226 | public class LocalDateTypeAdapter extends TypeAdapter { 227 | 228 | private DateTimeFormatter formatter; 229 | 230 | public LocalDateTypeAdapter() { 231 | this(DateTimeFormatter.ISO_LOCAL_DATE); 232 | } 233 | 234 | public LocalDateTypeAdapter(DateTimeFormatter formatter) { 235 | this.formatter = formatter; 236 | } 237 | 238 | public void setFormat(DateTimeFormatter dateFormat) { 239 | this.formatter = dateFormat; 240 | } 241 | 242 | @Override 243 | public void write(JsonWriter out, LocalDate date) throws IOException { 244 | if (date == null) { 245 | out.nullValue(); 246 | } else { 247 | out.value(formatter.format(date)); 248 | } 249 | } 250 | 251 | @Override 252 | public LocalDate read(JsonReader in) throws IOException { 253 | switch (in.peek()) { 254 | case NULL: 255 | in.nextNull(); 256 | return null; 257 | default: 258 | String date = in.nextString(); 259 | return LocalDate.parse(date, formatter); 260 | } 261 | } 262 | } 263 | 264 | public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { 265 | offsetDateTimeTypeAdapter.setFormat(dateFormat); 266 | return this; 267 | } 268 | 269 | public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { 270 | localDateTypeAdapter.setFormat(dateFormat); 271 | return this; 272 | } 273 | 274 | /** 275 | * Gson TypeAdapter for java.sql.Date type 276 | * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used 277 | * (more efficient than SimpleDateFormat). 278 | */ 279 | public static class SqlDateTypeAdapter extends TypeAdapter { 280 | 281 | private DateFormat dateFormat; 282 | 283 | public SqlDateTypeAdapter() {} 284 | 285 | public SqlDateTypeAdapter(DateFormat dateFormat) { 286 | this.dateFormat = dateFormat; 287 | } 288 | 289 | public void setFormat(DateFormat dateFormat) { 290 | this.dateFormat = dateFormat; 291 | } 292 | 293 | @Override 294 | public void write(JsonWriter out, java.sql.Date date) throws IOException { 295 | if (date == null) { 296 | out.nullValue(); 297 | } else { 298 | String value; 299 | if (dateFormat != null) { 300 | value = dateFormat.format(date); 301 | } else { 302 | value = date.toString(); 303 | } 304 | out.value(value); 305 | } 306 | } 307 | 308 | @Override 309 | public java.sql.Date read(JsonReader in) throws IOException { 310 | switch (in.peek()) { 311 | case NULL: 312 | in.nextNull(); 313 | return null; 314 | default: 315 | String date = in.nextString(); 316 | try { 317 | if (dateFormat != null) { 318 | return new java.sql.Date(dateFormat.parse(date).getTime()); 319 | } 320 | return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); 321 | } catch (ParseException e) { 322 | throw new JsonParseException(e); 323 | } 324 | } 325 | } 326 | } 327 | 328 | /** 329 | * Gson TypeAdapter for java.util.Date type 330 | * If the dateFormat is null, ISO8601Utils will be used. 331 | */ 332 | public static class DateTypeAdapter extends TypeAdapter { 333 | 334 | private DateFormat dateFormat; 335 | 336 | public DateTypeAdapter() {} 337 | 338 | public DateTypeAdapter(DateFormat dateFormat) { 339 | this.dateFormat = dateFormat; 340 | } 341 | 342 | public void setFormat(DateFormat dateFormat) { 343 | this.dateFormat = dateFormat; 344 | } 345 | 346 | @Override 347 | public void write(JsonWriter out, Date date) throws IOException { 348 | if (date == null) { 349 | out.nullValue(); 350 | } else { 351 | String value; 352 | if (dateFormat != null) { 353 | value = dateFormat.format(date); 354 | } else { 355 | value = ISO8601Utils.format(date, true); 356 | } 357 | out.value(value); 358 | } 359 | } 360 | 361 | @Override 362 | public Date read(JsonReader in) throws IOException { 363 | try { 364 | switch (in.peek()) { 365 | case NULL: 366 | in.nextNull(); 367 | return null; 368 | default: 369 | String date = in.nextString(); 370 | try { 371 | if (dateFormat != null) { 372 | return dateFormat.parse(date); 373 | } 374 | return ISO8601Utils.parse(date, new ParsePosition(0)); 375 | } catch (ParseException e) { 376 | throw new JsonParseException(e); 377 | } 378 | } 379 | } catch (IllegalArgumentException e) { 380 | throw new JsonParseException(e); 381 | } 382 | } 383 | } 384 | 385 | public JSON setDateFormat(DateFormat dateFormat) { 386 | dateTypeAdapter.setFormat(dateFormat); 387 | return this; 388 | } 389 | 390 | public JSON setSqlDateFormat(DateFormat dateFormat) { 391 | sqlDateTypeAdapter.setFormat(dateFormat); 392 | return this; 393 | } 394 | 395 | } 396 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 17 | public class Pair { 18 | private String name = ""; 19 | private String value = ""; 20 | 21 | public Pair (String name, String value) { 22 | setName(name); 23 | setValue(value); 24 | } 25 | 26 | private void setName(String name) { 27 | if (!isValidString(name)) { 28 | return; 29 | } 30 | 31 | this.name = name; 32 | } 33 | 34 | private void setValue(String value) { 35 | if (!isValidString(value)) { 36 | return; 37 | } 38 | 39 | this.value = value; 40 | } 41 | 42 | public String getName() { 43 | return this.name; 44 | } 45 | 46 | public String getValue() { 47 | return this.value; 48 | } 49 | 50 | private boolean isValidString(String arg) { 51 | if (arg == null) { 52 | return false; 53 | } 54 | 55 | if (arg.trim().isEmpty()) { 56 | return false; 57 | } 58 | 59 | return true; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ProgressRequestBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import okhttp3.MediaType; 17 | import okhttp3.RequestBody; 18 | 19 | import java.io.IOException; 20 | 21 | import okio.Buffer; 22 | import okio.BufferedSink; 23 | import okio.ForwardingSink; 24 | import okio.Okio; 25 | import okio.Sink; 26 | 27 | public class ProgressRequestBody extends RequestBody { 28 | 29 | private final RequestBody requestBody; 30 | 31 | private final ApiCallback callback; 32 | 33 | public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { 34 | this.requestBody = requestBody; 35 | this.callback = callback; 36 | } 37 | 38 | @Override 39 | public MediaType contentType() { 40 | return requestBody.contentType(); 41 | } 42 | 43 | @Override 44 | public long contentLength() throws IOException { 45 | return requestBody.contentLength(); 46 | } 47 | 48 | @Override 49 | public void writeTo(BufferedSink sink) throws IOException { 50 | BufferedSink bufferedSink = Okio.buffer(sink(sink)); 51 | requestBody.writeTo(bufferedSink); 52 | bufferedSink.flush(); 53 | } 54 | 55 | private Sink sink(Sink sink) { 56 | return new ForwardingSink(sink) { 57 | 58 | long bytesWritten = 0L; 59 | long contentLength = 0L; 60 | 61 | @Override 62 | public void write(Buffer source, long byteCount) throws IOException { 63 | super.write(source, byteCount); 64 | if (contentLength == 0) { 65 | contentLength = contentLength(); 66 | } 67 | 68 | bytesWritten += byteCount; 69 | callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); 70 | } 71 | }; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ProgressResponseBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | import okhttp3.MediaType; 17 | import okhttp3.ResponseBody; 18 | 19 | import java.io.IOException; 20 | 21 | import okio.Buffer; 22 | import okio.BufferedSource; 23 | import okio.ForwardingSource; 24 | import okio.Okio; 25 | import okio.Source; 26 | 27 | public class ProgressResponseBody extends ResponseBody { 28 | 29 | private final ResponseBody responseBody; 30 | private final ApiCallback callback; 31 | private BufferedSource bufferedSource; 32 | 33 | public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { 34 | this.responseBody = responseBody; 35 | this.callback = callback; 36 | } 37 | 38 | @Override 39 | public MediaType contentType() { 40 | return responseBody.contentType(); 41 | } 42 | 43 | @Override 44 | public long contentLength() { 45 | return responseBody.contentLength(); 46 | } 47 | 48 | @Override 49 | public BufferedSource source() { 50 | if (bufferedSource == null) { 51 | bufferedSource = Okio.buffer(source(responseBody.source())); 52 | } 53 | return bufferedSource; 54 | } 55 | 56 | private Source source(Source source) { 57 | return new ForwardingSource(source) { 58 | long totalBytesRead = 0L; 59 | 60 | @Override 61 | public long read(Buffer sink, long byteCount) throws IOException { 62 | long bytesRead = super.read(sink, byteCount); 63 | // read() returns the number of bytes read, or -1 if this source is exhausted. 64 | totalBytesRead += bytesRead != -1 ? bytesRead : 0; 65 | callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); 66 | return bytesRead; 67 | } 68 | }; 69 | } 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ServerConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.openapitools.client; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * Representing a Server configuration. 7 | */ 8 | public class ServerConfiguration { 9 | public String URL; 10 | public String description; 11 | public Map variables; 12 | 13 | /** 14 | * @param URL A URL to the target host. 15 | * @param description A describtion of the host designated by the URL. 16 | * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. 17 | */ 18 | public ServerConfiguration(String URL, String description, Map variables) { 19 | this.URL = URL; 20 | this.description = description; 21 | this.variables = variables; 22 | } 23 | 24 | /** 25 | * Format URL template using given variables. 26 | * 27 | * @param variables A map between a variable name and its value. 28 | * @return Formatted URL. 29 | */ 30 | public String URL(Map variables) { 31 | String url = this.URL; 32 | 33 | // go through variables and replace placeholders 34 | for (Map.Entry variable: this.variables.entrySet()) { 35 | String name = variable.getKey(); 36 | ServerVariable serverVariable = variable.getValue(); 37 | String value = serverVariable.defaultValue; 38 | 39 | if (variables != null && variables.containsKey(name)) { 40 | value = variables.get(name); 41 | if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { 42 | throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); 43 | } 44 | } 45 | url = url.replaceAll("\\{" + name + "\\}", value); 46 | } 47 | return url; 48 | } 49 | 50 | /** 51 | * Format URL template using default server variables. 52 | * 53 | * @return Formatted URL. 54 | */ 55 | public String URL() { 56 | return URL(null); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/ServerVariable.java: -------------------------------------------------------------------------------- 1 | package org.openapitools.client; 2 | 3 | import java.util.HashSet; 4 | 5 | /** 6 | * Representing a Server Variable for server URL template substitution. 7 | */ 8 | public class ServerVariable { 9 | public String description; 10 | public String defaultValue; 11 | public HashSet enumValues = null; 12 | 13 | /** 14 | * @param description A description for the server variable. 15 | * @param defaultValue The default value to use for substitution. 16 | * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. 17 | */ 18 | public ServerVariable(String description, String defaultValue, HashSet enumValues) { 19 | this.description = description; 20 | this.defaultValue = defaultValue; 21 | this.enumValues = enumValues; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/StringUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client; 15 | 16 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 17 | public class StringUtil { 18 | /** 19 | * Check if the given array contains the given value (with case-insensitive comparison). 20 | * 21 | * @param array The array 22 | * @param value The value to search 23 | * @return true if the array contains the value 24 | */ 25 | public static boolean containsIgnoreCase(String[] array, String value) { 26 | for (String str : array) { 27 | if (value == null && str == null) { 28 | return true; 29 | } 30 | if (value != null && value.equalsIgnoreCase(str)) { 31 | return true; 32 | } 33 | } 34 | return false; 35 | } 36 | 37 | /** 38 | * Join an array of strings with the given separator. 39 | *

40 | * Note: This might be replaced by utility method from commons-lang or guava someday 41 | * if one of those libraries is added as dependency. 42 | *

43 | * 44 | * @param array The array of strings 45 | * @param separator The separator 46 | * @return the resulting string 47 | */ 48 | public static String join(String[] array, String separator) { 49 | int len = array.length; 50 | if (len == 0) { 51 | return ""; 52 | } 53 | 54 | StringBuilder out = new StringBuilder(); 55 | out.append(array[0]); 56 | for (int i = 1; i < len; i++) { 57 | out.append(separator).append(array[i]); 58 | } 59 | return out.toString(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/api/DefaultApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.api; 15 | 16 | import org.openapitools.client.ApiCallback; 17 | import org.openapitools.client.ApiClient; 18 | import org.openapitools.client.ApiException; 19 | import org.openapitools.client.ApiResponse; 20 | import org.openapitools.client.Configuration; 21 | import org.openapitools.client.Pair; 22 | import org.openapitools.client.ProgressRequestBody; 23 | import org.openapitools.client.ProgressResponseBody; 24 | 25 | import com.google.gson.reflect.TypeToken; 26 | 27 | import java.io.IOException; 28 | 29 | 30 | import org.openapitools.client.model.InlineObject; 31 | import org.openapitools.client.model.InlineObject1; 32 | import org.openapitools.client.model.InlineObject2; 33 | import org.openapitools.client.model.InlineResponse200; 34 | import org.openapitools.client.model.InlineResponse2001; 35 | 36 | import java.lang.reflect.Type; 37 | import java.util.ArrayList; 38 | import java.util.HashMap; 39 | import java.util.List; 40 | import java.util.Map; 41 | 42 | public class DefaultApi { 43 | private ApiClient localVarApiClient; 44 | 45 | public DefaultApi() { 46 | this(Configuration.getDefaultApiClient()); 47 | } 48 | 49 | public DefaultApi(ApiClient apiClient) { 50 | this.localVarApiClient = apiClient; 51 | } 52 | 53 | public ApiClient getApiClient() { 54 | return localVarApiClient; 55 | } 56 | 57 | public void setApiClient(ApiClient apiClient) { 58 | this.localVarApiClient = apiClient; 59 | } 60 | 61 | /** 62 | * Build call for isPhoneRegPost 63 | * @param inlineObject (optional) 64 | * @param _callback Callback for upload/download progress 65 | * @return Call to execute 66 | * @throws ApiException If fail to serialize the request body object 67 | * @http.response.details 68 | 69 | 70 | 71 |
Status Code Description Response Headers
200 成功 -
72 | */ 73 | public okhttp3.Call isPhoneRegPostCall(InlineObject inlineObject, final ApiCallback _callback) throws ApiException { 74 | Object localVarPostBody = inlineObject; 75 | 76 | // create path and map variables 77 | String localVarPath = "/IsPhoneReg"; 78 | 79 | List localVarQueryParams = new ArrayList(); 80 | List localVarCollectionQueryParams = new ArrayList(); 81 | Map localVarHeaderParams = new HashMap(); 82 | Map localVarCookieParams = new HashMap(); 83 | Map localVarFormParams = new HashMap(); 84 | final String[] localVarAccepts = { 85 | "*/*" 86 | }; 87 | final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); 88 | if (localVarAccept != null) { 89 | localVarHeaderParams.put("Accept", localVarAccept); 90 | } 91 | 92 | final String[] localVarContentTypes = { 93 | "application/json" 94 | }; 95 | final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); 96 | localVarHeaderParams.put("Content-Type", localVarContentType); 97 | 98 | String[] localVarAuthNames = new String[] { }; 99 | return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); 100 | } 101 | 102 | @SuppressWarnings("rawtypes") 103 | private okhttp3.Call isPhoneRegPostValidateBeforeCall(InlineObject inlineObject, final ApiCallback _callback) throws ApiException { 104 | 105 | 106 | okhttp3.Call localVarCall = isPhoneRegPostCall(inlineObject, _callback); 107 | return localVarCall; 108 | 109 | } 110 | 111 | /** 112 | * 检查手机号是否注册 113 | * 检查手机号是否注册,返回“true”和“false”字符串 114 | * @param inlineObject (optional) 115 | * @return InlineResponse200 116 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 117 | * @http.response.details 118 | 119 | 120 | 121 |
Status Code Description Response Headers
200 成功 -
122 | */ 123 | public InlineResponse200 isPhoneRegPost(InlineObject inlineObject) throws ApiException { 124 | ApiResponse localVarResp = isPhoneRegPostWithHttpInfo(inlineObject); 125 | return localVarResp.getData(); 126 | } 127 | 128 | /** 129 | * 检查手机号是否注册 130 | * 检查手机号是否注册,返回“true”和“false”字符串 131 | * @param inlineObject (optional) 132 | * @return ApiResponse<InlineResponse200> 133 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 134 | * @http.response.details 135 | 136 | 137 | 138 |
Status Code Description Response Headers
200 成功 -
139 | */ 140 | public ApiResponse isPhoneRegPostWithHttpInfo(InlineObject inlineObject) throws ApiException { 141 | okhttp3.Call localVarCall = isPhoneRegPostValidateBeforeCall(inlineObject, null); 142 | Type localVarReturnType = new TypeToken(){}.getType(); 143 | return localVarApiClient.execute(localVarCall, localVarReturnType); 144 | } 145 | 146 | /** 147 | * 检查手机号是否注册 (asynchronously) 148 | * 检查手机号是否注册,返回“true”和“false”字符串 149 | * @param inlineObject (optional) 150 | * @param _callback The callback to be executed when the API call finishes 151 | * @return The request call 152 | * @throws ApiException If fail to process the API call, e.g. serializing the request body object 153 | * @http.response.details 154 | 155 | 156 | 157 |
Status Code Description Response Headers
200 成功 -
158 | */ 159 | public okhttp3.Call isPhoneRegPostAsync(InlineObject inlineObject, final ApiCallback _callback) throws ApiException { 160 | 161 | okhttp3.Call localVarCall = isPhoneRegPostValidateBeforeCall(inlineObject, _callback); 162 | Type localVarReturnType = new TypeToken(){}.getType(); 163 | localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); 164 | return localVarCall; 165 | } 166 | /** 167 | * Build call for juguguLoginCodeandReturnInfoPost 168 | * @param inlineObject2 (optional) 169 | * @param _callback Callback for upload/download progress 170 | * @return Call to execute 171 | * @throws ApiException If fail to serialize the request body object 172 | * @http.response.details 173 | 174 | 175 | 176 |
Status Code Description Response Headers
200 成功 -
177 | */ 178 | public okhttp3.Call juguguLoginCodeandReturnInfoPostCall(InlineObject2 inlineObject2, final ApiCallback _callback) throws ApiException { 179 | Object localVarPostBody = inlineObject2; 180 | 181 | // create path and map variables 182 | String localVarPath = "/Jugugu_LoginCodeandReturnInfo"; 183 | 184 | List localVarQueryParams = new ArrayList(); 185 | List localVarCollectionQueryParams = new ArrayList(); 186 | Map localVarHeaderParams = new HashMap(); 187 | Map localVarCookieParams = new HashMap(); 188 | Map localVarFormParams = new HashMap(); 189 | final String[] localVarAccepts = { 190 | "application/json" 191 | }; 192 | final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); 193 | if (localVarAccept != null) { 194 | localVarHeaderParams.put("Accept", localVarAccept); 195 | } 196 | 197 | final String[] localVarContentTypes = { 198 | "application/json" 199 | }; 200 | final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); 201 | localVarHeaderParams.put("Content-Type", localVarContentType); 202 | 203 | String[] localVarAuthNames = new String[] { }; 204 | return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); 205 | } 206 | 207 | @SuppressWarnings("rawtypes") 208 | private okhttp3.Call juguguLoginCodeandReturnInfoPostValidateBeforeCall(InlineObject2 inlineObject2, final ApiCallback _callback) throws ApiException { 209 | 210 | 211 | okhttp3.Call localVarCall = juguguLoginCodeandReturnInfoPostCall(inlineObject2, _callback); 212 | return localVarCall; 213 | 214 | } 215 | 216 | /** 217 | * ①获取验证码图片 218 | * 获取用于防御机器人的验证码图片,phone的传参必须为空字符串 219 | * @param inlineObject2 (optional) 220 | * @return InlineResponse2001 221 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 222 | * @http.response.details 223 | 224 | 225 | 226 |
Status Code Description Response Headers
200 成功 -
227 | */ 228 | public InlineResponse2001 juguguLoginCodeandReturnInfoPost(InlineObject2 inlineObject2) throws ApiException { 229 | ApiResponse localVarResp = juguguLoginCodeandReturnInfoPostWithHttpInfo(inlineObject2); 230 | return localVarResp.getData(); 231 | } 232 | 233 | /** 234 | * ①获取验证码图片 235 | * 获取用于防御机器人的验证码图片,phone的传参必须为空字符串 236 | * @param inlineObject2 (optional) 237 | * @return ApiResponse<InlineResponse2001> 238 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 239 | * @http.response.details 240 | 241 | 242 | 243 |
Status Code Description Response Headers
200 成功 -
244 | */ 245 | public ApiResponse juguguLoginCodeandReturnInfoPostWithHttpInfo(InlineObject2 inlineObject2) throws ApiException { 246 | okhttp3.Call localVarCall = juguguLoginCodeandReturnInfoPostValidateBeforeCall(inlineObject2, null); 247 | Type localVarReturnType = new TypeToken(){}.getType(); 248 | return localVarApiClient.execute(localVarCall, localVarReturnType); 249 | } 250 | 251 | /** 252 | * ①获取验证码图片 (asynchronously) 253 | * 获取用于防御机器人的验证码图片,phone的传参必须为空字符串 254 | * @param inlineObject2 (optional) 255 | * @param _callback The callback to be executed when the API call finishes 256 | * @return The request call 257 | * @throws ApiException If fail to process the API call, e.g. serializing the request body object 258 | * @http.response.details 259 | 260 | 261 | 262 |
Status Code Description Response Headers
200 成功 -
263 | */ 264 | public okhttp3.Call juguguLoginCodeandReturnInfoPostAsync(InlineObject2 inlineObject2, final ApiCallback _callback) throws ApiException { 265 | 266 | okhttp3.Call localVarCall = juguguLoginCodeandReturnInfoPostValidateBeforeCall(inlineObject2, _callback); 267 | Type localVarReturnType = new TypeToken(){}.getType(); 268 | localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); 269 | return localVarCall; 270 | } 271 | /** 272 | * Build call for jugugugRegAndVerifyandReturnInfoPost 273 | * @param inlineObject1 (optional) 274 | * @param _callback Callback for upload/download progress 275 | * @return Call to execute 276 | * @throws ApiException If fail to serialize the request body object 277 | * @http.response.details 278 | 279 | 280 | 281 |
Status Code Description Response Headers
200 成功 -
282 | */ 283 | public okhttp3.Call jugugugRegAndVerifyandReturnInfoPostCall(InlineObject1 inlineObject1, final ApiCallback _callback) throws ApiException { 284 | Object localVarPostBody = inlineObject1; 285 | 286 | // create path and map variables 287 | String localVarPath = "/Jugugug_RegAndVerifyandReturnInfo"; 288 | 289 | List localVarQueryParams = new ArrayList(); 290 | List localVarCollectionQueryParams = new ArrayList(); 291 | Map localVarHeaderParams = new HashMap(); 292 | Map localVarCookieParams = new HashMap(); 293 | Map localVarFormParams = new HashMap(); 294 | final String[] localVarAccepts = { 295 | "application/json" 296 | }; 297 | final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); 298 | if (localVarAccept != null) { 299 | localVarHeaderParams.put("Accept", localVarAccept); 300 | } 301 | 302 | final String[] localVarContentTypes = { 303 | "application/json" 304 | }; 305 | final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); 306 | localVarHeaderParams.put("Content-Type", localVarContentType); 307 | 308 | String[] localVarAuthNames = new String[] { }; 309 | return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); 310 | } 311 | 312 | @SuppressWarnings("rawtypes") 313 | private okhttp3.Call jugugugRegAndVerifyandReturnInfoPostValidateBeforeCall(InlineObject1 inlineObject1, final ApiCallback _callback) throws ApiException { 314 | 315 | 316 | okhttp3.Call localVarCall = jugugugRegAndVerifyandReturnInfoPostCall(inlineObject1, _callback); 317 | return localVarCall; 318 | 319 | } 320 | 321 | /** 322 | * ③注册Jugugu 323 | * 注册jugugu,注意三点 1.phone的传参必须为11位的国内手机号。 2.robotcodeid和robotcode是通过【①】获得 3.code短信验证码通过【②】 4.paymentpassword区块链短密钥,该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 324 | * @param inlineObject1 (optional) 325 | * @return InlineResponse2001 326 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 327 | * @http.response.details 328 | 329 | 330 | 331 |
Status Code Description Response Headers
200 成功 -
332 | */ 333 | public InlineResponse2001 jugugugRegAndVerifyandReturnInfoPost(InlineObject1 inlineObject1) throws ApiException { 334 | ApiResponse localVarResp = jugugugRegAndVerifyandReturnInfoPostWithHttpInfo(inlineObject1); 335 | return localVarResp.getData(); 336 | } 337 | 338 | /** 339 | * ③注册Jugugu 340 | * 注册jugugu,注意三点 1.phone的传参必须为11位的国内手机号。 2.robotcodeid和robotcode是通过【①】获得 3.code短信验证码通过【②】 4.paymentpassword区块链短密钥,该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 341 | * @param inlineObject1 (optional) 342 | * @return ApiResponse<InlineResponse2001> 343 | * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body 344 | * @http.response.details 345 | 346 | 347 | 348 |
Status Code Description Response Headers
200 成功 -
349 | */ 350 | public ApiResponse jugugugRegAndVerifyandReturnInfoPostWithHttpInfo(InlineObject1 inlineObject1) throws ApiException { 351 | okhttp3.Call localVarCall = jugugugRegAndVerifyandReturnInfoPostValidateBeforeCall(inlineObject1, null); 352 | Type localVarReturnType = new TypeToken(){}.getType(); 353 | return localVarApiClient.execute(localVarCall, localVarReturnType); 354 | } 355 | 356 | /** 357 | * ③注册Jugugu (asynchronously) 358 | * 注册jugugu,注意三点 1.phone的传参必须为11位的国内手机号。 2.robotcodeid和robotcode是通过【①】获得 3.code短信验证码通过【②】 4.paymentpassword区块链短密钥,该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 359 | * @param inlineObject1 (optional) 360 | * @param _callback The callback to be executed when the API call finishes 361 | * @return The request call 362 | * @throws ApiException If fail to process the API call, e.g. serializing the request body object 363 | * @http.response.details 364 | 365 | 366 | 367 |
Status Code Description Response Headers
200 成功 -
368 | */ 369 | public okhttp3.Call jugugugRegAndVerifyandReturnInfoPostAsync(InlineObject1 inlineObject1, final ApiCallback _callback) throws ApiException { 370 | 371 | okhttp3.Call localVarCall = jugugugRegAndVerifyandReturnInfoPostValidateBeforeCall(inlineObject1, _callback); 372 | Type localVarReturnType = new TypeToken(){}.getType(); 373 | localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); 374 | return localVarCall; 375 | } 376 | } 377 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/auth/ApiKeyAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.auth; 15 | 16 | import org.openapitools.client.Pair; 17 | 18 | import java.util.Map; 19 | import java.util.List; 20 | 21 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 22 | public class ApiKeyAuth implements Authentication { 23 | private final String location; 24 | private final String paramName; 25 | 26 | private String apiKey; 27 | private String apiKeyPrefix; 28 | 29 | public ApiKeyAuth(String location, String paramName) { 30 | this.location = location; 31 | this.paramName = paramName; 32 | } 33 | 34 | public String getLocation() { 35 | return location; 36 | } 37 | 38 | public String getParamName() { 39 | return paramName; 40 | } 41 | 42 | public String getApiKey() { 43 | return apiKey; 44 | } 45 | 46 | public void setApiKey(String apiKey) { 47 | this.apiKey = apiKey; 48 | } 49 | 50 | public String getApiKeyPrefix() { 51 | return apiKeyPrefix; 52 | } 53 | 54 | public void setApiKeyPrefix(String apiKeyPrefix) { 55 | this.apiKeyPrefix = apiKeyPrefix; 56 | } 57 | 58 | @Override 59 | public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { 60 | if (apiKey == null) { 61 | return; 62 | } 63 | String value; 64 | if (apiKeyPrefix != null) { 65 | value = apiKeyPrefix + " " + apiKey; 66 | } else { 67 | value = apiKey; 68 | } 69 | if ("query".equals(location)) { 70 | queryParams.add(new Pair(paramName, value)); 71 | } else if ("header".equals(location)) { 72 | headerParams.put(paramName, value); 73 | } else if ("cookie".equals(location)) { 74 | cookieParams.put(paramName, value); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/auth/Authentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.auth; 15 | 16 | import org.openapitools.client.Pair; 17 | 18 | import java.util.Map; 19 | import java.util.List; 20 | 21 | public interface Authentication { 22 | /** 23 | * Apply authentication settings to header and query params. 24 | * 25 | * @param queryParams List of query parameters 26 | * @param headerParams Map of header parameters 27 | * @param cookieParams Map of cookie parameters 28 | */ 29 | void applyToParams(List queryParams, Map headerParams, Map cookieParams); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.auth; 15 | 16 | import org.openapitools.client.Pair; 17 | 18 | import okhttp3.Credentials; 19 | 20 | import java.util.Map; 21 | import java.util.List; 22 | 23 | import java.io.UnsupportedEncodingException; 24 | 25 | public class HttpBasicAuth implements Authentication { 26 | private String username; 27 | private String password; 28 | 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | public void setUsername(String username) { 34 | this.username = username; 35 | } 36 | 37 | public String getPassword() { 38 | return password; 39 | } 40 | 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | 45 | @Override 46 | public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { 47 | if (username == null && password == null) { 48 | return; 49 | } 50 | headerParams.put("Authorization", Credentials.basic( 51 | username == null ? "" : username, 52 | password == null ? "" : password)); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/auth/HttpBearerAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.auth; 15 | 16 | import org.openapitools.client.Pair; 17 | 18 | import java.util.Map; 19 | import java.util.List; 20 | 21 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 22 | public class HttpBearerAuth implements Authentication { 23 | private final String scheme; 24 | private String bearerToken; 25 | 26 | public HttpBearerAuth(String scheme) { 27 | this.scheme = scheme; 28 | } 29 | 30 | /** 31 | * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. 32 | * 33 | * @return The bearer token 34 | */ 35 | public String getBearerToken() { 36 | return bearerToken; 37 | } 38 | 39 | /** 40 | * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. 41 | * 42 | * @param bearerToken The bearer token to send in the Authorization header 43 | */ 44 | public void setBearerToken(String bearerToken) { 45 | this.bearerToken = bearerToken; 46 | } 47 | 48 | @Override 49 | public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { 50 | if(bearerToken == null) { 51 | return; 52 | } 53 | 54 | headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); 55 | } 56 | 57 | private static String upperCaseBearer(String scheme) { 58 | return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/model/InlineObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import com.google.gson.TypeAdapter; 19 | import com.google.gson.annotations.JsonAdapter; 20 | import com.google.gson.annotations.SerializedName; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import io.swagger.annotations.ApiModel; 24 | import io.swagger.annotations.ApiModelProperty; 25 | import java.io.IOException; 26 | 27 | /** 28 | * InlineObject 29 | */ 30 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 31 | public class InlineObject { 32 | public static final String SERIALIZED_NAME_PHONE = "phone"; 33 | @SerializedName(SERIALIZED_NAME_PHONE) 34 | private String phone; 35 | 36 | 37 | public InlineObject phone(String phone) { 38 | 39 | this.phone = phone; 40 | return this; 41 | } 42 | 43 | /** 44 | * 此处传参为空字符串 45 | * @return phone 46 | **/ 47 | @ApiModelProperty(required = true, value = "此处传参为空字符串") 48 | 49 | public String getPhone() { 50 | return phone; 51 | } 52 | 53 | 54 | public void setPhone(String phone) { 55 | this.phone = phone; 56 | } 57 | 58 | 59 | @Override 60 | public boolean equals(java.lang.Object o) { 61 | if (this == o) { 62 | return true; 63 | } 64 | if (o == null || getClass() != o.getClass()) { 65 | return false; 66 | } 67 | InlineObject inlineObject = (InlineObject) o; 68 | return Objects.equals(this.phone, inlineObject.phone); 69 | } 70 | 71 | @Override 72 | public int hashCode() { 73 | return Objects.hash(phone); 74 | } 75 | 76 | 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class InlineObject {\n"); 81 | sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); 82 | sb.append("}"); 83 | return sb.toString(); 84 | } 85 | 86 | /** 87 | * Convert the given object to string with each line indented by 4 spaces 88 | * (except the first line). 89 | */ 90 | private String toIndentedString(java.lang.Object o) { 91 | if (o == null) { 92 | return "null"; 93 | } 94 | return o.toString().replace("\n", "\n "); 95 | } 96 | 97 | } 98 | 99 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/model/InlineObject1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import com.google.gson.TypeAdapter; 19 | import com.google.gson.annotations.JsonAdapter; 20 | import com.google.gson.annotations.SerializedName; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import io.swagger.annotations.ApiModel; 24 | import io.swagger.annotations.ApiModelProperty; 25 | import java.io.IOException; 26 | 27 | /** 28 | * InlineObject1 29 | */ 30 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 31 | public class InlineObject1 { 32 | public static final String SERIALIZED_NAME_PHONE = "phone"; 33 | @SerializedName(SERIALIZED_NAME_PHONE) 34 | private String phone; 35 | 36 | public static final String SERIALIZED_NAME_ROBOTCODEID = "robotcodeid"; 37 | @SerializedName(SERIALIZED_NAME_ROBOTCODEID) 38 | private String robotcodeid; 39 | 40 | public static final String SERIALIZED_NAME_ROBOTCODE = "robotcode"; 41 | @SerializedName(SERIALIZED_NAME_ROBOTCODE) 42 | private String robotcode; 43 | 44 | public static final String SERIALIZED_NAME_CODE = "code"; 45 | @SerializedName(SERIALIZED_NAME_CODE) 46 | private String code; 47 | 48 | public static final String SERIALIZED_NAME_PAYMENTPASSWORD = "paymentpassword"; 49 | @SerializedName(SERIALIZED_NAME_PAYMENTPASSWORD) 50 | private String paymentpassword; 51 | 52 | 53 | public InlineObject1 phone(String phone) { 54 | 55 | this.phone = phone; 56 | return this; 57 | } 58 | 59 | /** 60 | * 此处传参为空字符串 61 | * @return phone 62 | **/ 63 | @ApiModelProperty(required = true, value = "此处传参为空字符串") 64 | 65 | public String getPhone() { 66 | return phone; 67 | } 68 | 69 | 70 | public void setPhone(String phone) { 71 | this.phone = phone; 72 | } 73 | 74 | 75 | public InlineObject1 robotcodeid(String robotcodeid) { 76 | 77 | this.robotcodeid = robotcodeid; 78 | return this; 79 | } 80 | 81 | /** 82 | * Get robotcodeid 83 | * @return robotcodeid 84 | **/ 85 | @ApiModelProperty(required = true, value = "") 86 | 87 | public String getRobotcodeid() { 88 | return robotcodeid; 89 | } 90 | 91 | 92 | public void setRobotcodeid(String robotcodeid) { 93 | this.robotcodeid = robotcodeid; 94 | } 95 | 96 | 97 | public InlineObject1 robotcode(String robotcode) { 98 | 99 | this.robotcode = robotcode; 100 | return this; 101 | } 102 | 103 | /** 104 | * Get robotcode 105 | * @return robotcode 106 | **/ 107 | @ApiModelProperty(required = true, value = "") 108 | 109 | public String getRobotcode() { 110 | return robotcode; 111 | } 112 | 113 | 114 | public void setRobotcode(String robotcode) { 115 | this.robotcode = robotcode; 116 | } 117 | 118 | 119 | public InlineObject1 code(String code) { 120 | 121 | this.code = code; 122 | return this; 123 | } 124 | 125 | /** 126 | * Get code 127 | * @return code 128 | **/ 129 | @ApiModelProperty(required = true, value = "") 130 | 131 | public String getCode() { 132 | return code; 133 | } 134 | 135 | 136 | public void setCode(String code) { 137 | this.code = code; 138 | } 139 | 140 | 141 | public InlineObject1 paymentpassword(String paymentpassword) { 142 | 143 | this.paymentpassword = paymentpassword; 144 | return this; 145 | } 146 | 147 | /** 148 | * 该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 149 | * @return paymentpassword 150 | **/ 151 | @ApiModelProperty(required = true, value = "该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+") 152 | 153 | public String getPaymentpassword() { 154 | return paymentpassword; 155 | } 156 | 157 | 158 | public void setPaymentpassword(String paymentpassword) { 159 | this.paymentpassword = paymentpassword; 160 | } 161 | 162 | 163 | @Override 164 | public boolean equals(java.lang.Object o) { 165 | if (this == o) { 166 | return true; 167 | } 168 | if (o == null || getClass() != o.getClass()) { 169 | return false; 170 | } 171 | InlineObject1 inlineObject1 = (InlineObject1) o; 172 | return Objects.equals(this.phone, inlineObject1.phone) && 173 | Objects.equals(this.robotcodeid, inlineObject1.robotcodeid) && 174 | Objects.equals(this.robotcode, inlineObject1.robotcode) && 175 | Objects.equals(this.code, inlineObject1.code) && 176 | Objects.equals(this.paymentpassword, inlineObject1.paymentpassword); 177 | } 178 | 179 | @Override 180 | public int hashCode() { 181 | return Objects.hash(phone, robotcodeid, robotcode, code, paymentpassword); 182 | } 183 | 184 | 185 | @Override 186 | public String toString() { 187 | StringBuilder sb = new StringBuilder(); 188 | sb.append("class InlineObject1 {\n"); 189 | sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); 190 | sb.append(" robotcodeid: ").append(toIndentedString(robotcodeid)).append("\n"); 191 | sb.append(" robotcode: ").append(toIndentedString(robotcode)).append("\n"); 192 | sb.append(" code: ").append(toIndentedString(code)).append("\n"); 193 | sb.append(" paymentpassword: ").append(toIndentedString(paymentpassword)).append("\n"); 194 | sb.append("}"); 195 | return sb.toString(); 196 | } 197 | 198 | /** 199 | * Convert the given object to string with each line indented by 4 spaces 200 | * (except the first line). 201 | */ 202 | private String toIndentedString(java.lang.Object o) { 203 | if (o == null) { 204 | return "null"; 205 | } 206 | return o.toString().replace("\n", "\n "); 207 | } 208 | 209 | } 210 | 211 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/model/InlineObject2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import com.google.gson.TypeAdapter; 19 | import com.google.gson.annotations.JsonAdapter; 20 | import com.google.gson.annotations.SerializedName; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import io.swagger.annotations.ApiModel; 24 | import io.swagger.annotations.ApiModelProperty; 25 | import java.io.IOException; 26 | 27 | /** 28 | * InlineObject2 29 | */ 30 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 31 | public class InlineObject2 { 32 | public static final String SERIALIZED_NAME_PHONE = "phone"; 33 | @SerializedName(SERIALIZED_NAME_PHONE) 34 | private String phone; 35 | 36 | 37 | public InlineObject2 phone(String phone) { 38 | 39 | this.phone = phone; 40 | return this; 41 | } 42 | 43 | /** 44 | * 此处传参为空字符串 45 | * @return phone 46 | **/ 47 | @ApiModelProperty(required = true, value = "此处传参为空字符串") 48 | 49 | public String getPhone() { 50 | return phone; 51 | } 52 | 53 | 54 | public void setPhone(String phone) { 55 | this.phone = phone; 56 | } 57 | 58 | 59 | @Override 60 | public boolean equals(java.lang.Object o) { 61 | if (this == o) { 62 | return true; 63 | } 64 | if (o == null || getClass() != o.getClass()) { 65 | return false; 66 | } 67 | InlineObject2 inlineObject2 = (InlineObject2) o; 68 | return Objects.equals(this.phone, inlineObject2.phone); 69 | } 70 | 71 | @Override 72 | public int hashCode() { 73 | return Objects.hash(phone); 74 | } 75 | 76 | 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class InlineObject2 {\n"); 81 | sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); 82 | sb.append("}"); 83 | return sb.toString(); 84 | } 85 | 86 | /** 87 | * Convert the given object to string with each line indented by 4 spaces 88 | * (except the first line). 89 | */ 90 | private String toIndentedString(java.lang.Object o) { 91 | if (o == null) { 92 | return "null"; 93 | } 94 | return o.toString().replace("\n", "\n "); 95 | } 96 | 97 | } 98 | 99 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/model/InlineResponse200.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import com.google.gson.TypeAdapter; 19 | import com.google.gson.annotations.JsonAdapter; 20 | import com.google.gson.annotations.SerializedName; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import io.swagger.annotations.ApiModel; 24 | import io.swagger.annotations.ApiModelProperty; 25 | import java.io.IOException; 26 | 27 | /** 28 | * InlineResponse200 29 | */ 30 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 31 | public class InlineResponse200 { 32 | public static final String SERIALIZED_NAME_TOKEN = "token"; 33 | @SerializedName(SERIALIZED_NAME_TOKEN) 34 | private String token; 35 | 36 | 37 | public InlineResponse200 token(String token) { 38 | 39 | this.token = token; 40 | return this; 41 | } 42 | 43 | /** 44 | * 用户登录识别令牌,用于后续多个函数的交互,作为输入参数 45 | * @return token 46 | **/ 47 | @ApiModelProperty(required = true, value = "用户登录识别令牌,用于后续多个函数的交互,作为输入参数") 48 | 49 | public String getToken() { 50 | return token; 51 | } 52 | 53 | 54 | public void setToken(String token) { 55 | this.token = token; 56 | } 57 | 58 | 59 | @Override 60 | public boolean equals(java.lang.Object o) { 61 | if (this == o) { 62 | return true; 63 | } 64 | if (o == null || getClass() != o.getClass()) { 65 | return false; 66 | } 67 | InlineResponse200 inlineResponse200 = (InlineResponse200) o; 68 | return Objects.equals(this.token, inlineResponse200.token); 69 | } 70 | 71 | @Override 72 | public int hashCode() { 73 | return Objects.hash(token); 74 | } 75 | 76 | 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class InlineResponse200 {\n"); 81 | sb.append(" token: ").append(toIndentedString(token)).append("\n"); 82 | sb.append("}"); 83 | return sb.toString(); 84 | } 85 | 86 | /** 87 | * Convert the given object to string with each line indented by 4 spaces 88 | * (except the first line). 89 | */ 90 | private String toIndentedString(java.lang.Object o) { 91 | if (o == null) { 92 | return "null"; 93 | } 94 | return o.toString().replace("\n", "\n "); 95 | } 96 | 97 | } 98 | 99 | -------------------------------------------------------------------------------- /src/main/java/org/openapitools/client/model/InlineResponse2001.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import com.google.gson.TypeAdapter; 19 | import com.google.gson.annotations.JsonAdapter; 20 | import com.google.gson.annotations.SerializedName; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import io.swagger.annotations.ApiModel; 24 | import io.swagger.annotations.ApiModelProperty; 25 | import java.io.IOException; 26 | 27 | /** 28 | * InlineResponse2001 29 | */ 30 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-01T20:54:45.948+08:00[Asia/Shanghai]") 31 | public class InlineResponse2001 { 32 | public static final String SERIALIZED_NAME_STATE = "state"; 33 | @SerializedName(SERIALIZED_NAME_STATE) 34 | private String state; 35 | 36 | public static final String SERIALIZED_NAME_MSG = "msg"; 37 | @SerializedName(SERIALIZED_NAME_MSG) 38 | private String msg; 39 | 40 | public static final String SERIALIZED_NAME_PHONE = "phone"; 41 | @SerializedName(SERIALIZED_NAME_PHONE) 42 | private String phone; 43 | 44 | public static final String SERIALIZED_NAME_VIRIFYCODEID = "virifycodeid"; 45 | @SerializedName(SERIALIZED_NAME_VIRIFYCODEID) 46 | private String virifycodeid; 47 | 48 | public static final String SERIALIZED_NAME_VIRIFYIMAGE = "virifyimage"; 49 | @SerializedName(SERIALIZED_NAME_VIRIFYIMAGE) 50 | private String virifyimage; 51 | 52 | public static final String SERIALIZED_NAME_CONFLUXADDRESS = "confluxaddress"; 53 | @SerializedName(SERIALIZED_NAME_CONFLUXADDRESS) 54 | private String confluxaddress; 55 | 56 | public static final String SERIALIZED_NAME_ETHADDRESS = "ethaddress"; 57 | @SerializedName(SERIALIZED_NAME_ETHADDRESS) 58 | private String ethaddress; 59 | 60 | public static final String SERIALIZED_NAME_TOKEN = "token"; 61 | @SerializedName(SERIALIZED_NAME_TOKEN) 62 | private String token; 63 | 64 | 65 | public InlineResponse2001 state(String state) { 66 | 67 | this.state = state; 68 | return this; 69 | } 70 | 71 | /** 72 | * 响应状态分为:-1,0,1 分别代表响应错误、响应提示、响应成功 73 | * @return state 74 | **/ 75 | @ApiModelProperty(required = true, value = "响应状态分为:-1,0,1 分别代表响应错误、响应提示、响应成功") 76 | 77 | public String getState() { 78 | return state; 79 | } 80 | 81 | 82 | public void setState(String state) { 83 | this.state = state; 84 | } 85 | 86 | 87 | public InlineResponse2001 msg(String msg) { 88 | 89 | this.msg = msg; 90 | return this; 91 | } 92 | 93 | /** 94 | * 响应状态为-1时该值为错误信息。响应状态为0时,该值为响应提示信息。响应状态为1时该值为空字符串 95 | * @return msg 96 | **/ 97 | @ApiModelProperty(required = true, value = "响应状态为-1时该值为错误信息。响应状态为0时,该值为响应提示信息。响应状态为1时该值为空字符串") 98 | 99 | public String getMsg() { 100 | return msg; 101 | } 102 | 103 | 104 | public void setMsg(String msg) { 105 | this.msg = msg; 106 | } 107 | 108 | 109 | public InlineResponse2001 phone(String phone) { 110 | 111 | this.phone = phone; 112 | return this; 113 | } 114 | 115 | /** 116 | * Get phone 117 | * @return phone 118 | **/ 119 | @ApiModelProperty(required = true, value = "") 120 | 121 | public String getPhone() { 122 | return phone; 123 | } 124 | 125 | 126 | public void setPhone(String phone) { 127 | this.phone = phone; 128 | } 129 | 130 | 131 | public InlineResponse2001 virifycodeid(String virifycodeid) { 132 | 133 | this.virifycodeid = virifycodeid; 134 | return this; 135 | } 136 | 137 | /** 138 | * 验证码图片的ID值 139 | * @return virifycodeid 140 | **/ 141 | @ApiModelProperty(required = true, value = "验证码图片的ID值") 142 | 143 | public String getVirifycodeid() { 144 | return virifycodeid; 145 | } 146 | 147 | 148 | public void setVirifycodeid(String virifycodeid) { 149 | this.virifycodeid = virifycodeid; 150 | } 151 | 152 | 153 | public InlineResponse2001 virifyimage(String virifyimage) { 154 | 155 | this.virifyimage = virifyimage; 156 | return this; 157 | } 158 | 159 | /** 160 | * data:image/png;base64 161 | * @return virifyimage 162 | **/ 163 | @ApiModelProperty(required = true, value = "data:image/png;base64") 164 | 165 | public String getVirifyimage() { 166 | return virifyimage; 167 | } 168 | 169 | 170 | public void setVirifyimage(String virifyimage) { 171 | this.virifyimage = virifyimage; 172 | } 173 | 174 | 175 | public InlineResponse2001 confluxaddress(String confluxaddress) { 176 | 177 | this.confluxaddress = confluxaddress; 178 | return this; 179 | } 180 | 181 | /** 182 | * 树图区块链地址 183 | * @return confluxaddress 184 | **/ 185 | @ApiModelProperty(required = true, value = "树图区块链地址") 186 | 187 | public String getConfluxaddress() { 188 | return confluxaddress; 189 | } 190 | 191 | 192 | public void setConfluxaddress(String confluxaddress) { 193 | this.confluxaddress = confluxaddress; 194 | } 195 | 196 | 197 | public InlineResponse2001 ethaddress(String ethaddress) { 198 | 199 | this.ethaddress = ethaddress; 200 | return this; 201 | } 202 | 203 | /** 204 | * 以太坊、Arbitrum、polygon、BSC等EVM链地址 205 | * @return ethaddress 206 | **/ 207 | @ApiModelProperty(required = true, value = "以太坊、Arbitrum、polygon、BSC等EVM链地址") 208 | 209 | public String getEthaddress() { 210 | return ethaddress; 211 | } 212 | 213 | 214 | public void setEthaddress(String ethaddress) { 215 | this.ethaddress = ethaddress; 216 | } 217 | 218 | 219 | public InlineResponse2001 token(String token) { 220 | 221 | this.token = token; 222 | return this; 223 | } 224 | 225 | /** 226 | * 用户登录识别令牌,用于后续多个函数的交互,作为输入参数 227 | * @return token 228 | **/ 229 | @ApiModelProperty(required = true, value = "用户登录识别令牌,用于后续多个函数的交互,作为输入参数") 230 | 231 | public String getToken() { 232 | return token; 233 | } 234 | 235 | 236 | public void setToken(String token) { 237 | this.token = token; 238 | } 239 | 240 | 241 | @Override 242 | public boolean equals(java.lang.Object o) { 243 | if (this == o) { 244 | return true; 245 | } 246 | if (o == null || getClass() != o.getClass()) { 247 | return false; 248 | } 249 | InlineResponse2001 inlineResponse2001 = (InlineResponse2001) o; 250 | return Objects.equals(this.state, inlineResponse2001.state) && 251 | Objects.equals(this.msg, inlineResponse2001.msg) && 252 | Objects.equals(this.phone, inlineResponse2001.phone) && 253 | Objects.equals(this.virifycodeid, inlineResponse2001.virifycodeid) && 254 | Objects.equals(this.virifyimage, inlineResponse2001.virifyimage) && 255 | Objects.equals(this.confluxaddress, inlineResponse2001.confluxaddress) && 256 | Objects.equals(this.ethaddress, inlineResponse2001.ethaddress) && 257 | Objects.equals(this.token, inlineResponse2001.token); 258 | } 259 | 260 | @Override 261 | public int hashCode() { 262 | return Objects.hash(state, msg, phone, virifycodeid, virifyimage, confluxaddress, ethaddress, token); 263 | } 264 | 265 | 266 | @Override 267 | public String toString() { 268 | StringBuilder sb = new StringBuilder(); 269 | sb.append("class InlineResponse2001 {\n"); 270 | sb.append(" state: ").append(toIndentedString(state)).append("\n"); 271 | sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); 272 | sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); 273 | sb.append(" virifycodeid: ").append(toIndentedString(virifycodeid)).append("\n"); 274 | sb.append(" virifyimage: ").append(toIndentedString(virifyimage)).append("\n"); 275 | sb.append(" confluxaddress: ").append(toIndentedString(confluxaddress)).append("\n"); 276 | sb.append(" ethaddress: ").append(toIndentedString(ethaddress)).append("\n"); 277 | sb.append(" token: ").append(toIndentedString(token)).append("\n"); 278 | sb.append("}"); 279 | return sb.toString(); 280 | } 281 | 282 | /** 283 | * Convert the given object to string with each line indented by 4 spaces 284 | * (except the first line). 285 | */ 286 | private String toIndentedString(java.lang.Object o) { 287 | if (o == null) { 288 | return "null"; 289 | } 290 | return o.toString().replace("\n", "\n "); 291 | } 292 | 293 | } 294 | 295 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/api/DefaultApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.api; 15 | 16 | import org.openapitools.client.ApiException; 17 | import org.openapitools.client.model.InlineObject; 18 | import org.openapitools.client.model.InlineObject1; 19 | import org.openapitools.client.model.InlineObject2; 20 | import org.openapitools.client.model.InlineResponse200; 21 | import org.openapitools.client.model.InlineResponse2001; 22 | import org.junit.Test; 23 | import org.junit.Ignore; 24 | 25 | import java.util.ArrayList; 26 | import java.util.HashMap; 27 | import java.util.List; 28 | import java.util.Map; 29 | 30 | /** 31 | * API tests for DefaultApi 32 | */ 33 | @Ignore 34 | public class DefaultApiTest { 35 | 36 | private final DefaultApi api = new DefaultApi(); 37 | 38 | 39 | /** 40 | * 检查手机号是否注册 41 | * 42 | * 检查手机号是否注册,返回“true”和“false”字符串 43 | * 44 | * @throws ApiException 45 | * if the Api call fails 46 | */ 47 | @Test 48 | public void isPhoneRegPostTest() throws ApiException { 49 | InlineObject inlineObject = null; 50 | InlineResponse200 response = api.isPhoneRegPost(inlineObject); 51 | 52 | // TODO: test validations 53 | } 54 | 55 | /** 56 | * ①获取验证码图片 57 | * 58 | * 获取用于防御机器人的验证码图片,phone的传参必须为空字符串 59 | * 60 | * @throws ApiException 61 | * if the Api call fails 62 | */ 63 | @Test 64 | public void juguguLoginCodeandReturnInfoPostTest() throws ApiException { 65 | InlineObject2 inlineObject2 = null; 66 | InlineResponse2001 response = api.juguguLoginCodeandReturnInfoPost(inlineObject2); 67 | 68 | // TODO: test validations 69 | } 70 | 71 | /** 72 | * ③注册Jugugu 73 | * 74 | * 注册jugugu,注意三点 1.phone的传参必须为11位的国内手机号。 2.robotcodeid和robotcode是通过【①】获得 3.code短信验证码通过【②】 4.paymentpassword区块链短密钥,该密钥为用户进行链上交互使用,密钥设置长度>9位,且包含0-1 A-B a-b 已经特殊字符[~!@#$%^&*?_+;',./\\|·!¥(){}:“《》?、,。;’”\"《》…-]+ 75 | * 76 | * @throws ApiException 77 | * if the Api call fails 78 | */ 79 | @Test 80 | public void jugugugRegAndVerifyandReturnInfoPostTest() throws ApiException { 81 | InlineObject1 inlineObject1 = null; 82 | InlineResponse2001 response = api.jugugugRegAndVerifyandReturnInfoPost(inlineObject1); 83 | 84 | // TODO: test validations 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/model/InlineObject1Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import com.google.gson.TypeAdapter; 17 | import com.google.gson.annotations.JsonAdapter; 18 | import com.google.gson.annotations.SerializedName; 19 | import com.google.gson.stream.JsonReader; 20 | import com.google.gson.stream.JsonWriter; 21 | import io.swagger.annotations.ApiModel; 22 | import io.swagger.annotations.ApiModelProperty; 23 | import java.io.IOException; 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | /** 30 | * Model tests for InlineObject1 31 | */ 32 | public class InlineObject1Test { 33 | private final InlineObject1 model = new InlineObject1(); 34 | 35 | /** 36 | * Model tests for InlineObject1 37 | */ 38 | @Test 39 | public void testInlineObject1() { 40 | // TODO: test InlineObject1 41 | } 42 | 43 | /** 44 | * Test the property 'phone' 45 | */ 46 | @Test 47 | public void phoneTest() { 48 | // TODO: test phone 49 | } 50 | 51 | /** 52 | * Test the property 'robotcodeid' 53 | */ 54 | @Test 55 | public void robotcodeidTest() { 56 | // TODO: test robotcodeid 57 | } 58 | 59 | /** 60 | * Test the property 'robotcode' 61 | */ 62 | @Test 63 | public void robotcodeTest() { 64 | // TODO: test robotcode 65 | } 66 | 67 | /** 68 | * Test the property 'code' 69 | */ 70 | @Test 71 | public void codeTest() { 72 | // TODO: test code 73 | } 74 | 75 | /** 76 | * Test the property 'paymentpassword' 77 | */ 78 | @Test 79 | public void paymentpasswordTest() { 80 | // TODO: test paymentpassword 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/model/InlineObject2Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import com.google.gson.TypeAdapter; 17 | import com.google.gson.annotations.JsonAdapter; 18 | import com.google.gson.annotations.SerializedName; 19 | import com.google.gson.stream.JsonReader; 20 | import com.google.gson.stream.JsonWriter; 21 | import io.swagger.annotations.ApiModel; 22 | import io.swagger.annotations.ApiModelProperty; 23 | import java.io.IOException; 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | /** 30 | * Model tests for InlineObject2 31 | */ 32 | public class InlineObject2Test { 33 | private final InlineObject2 model = new InlineObject2(); 34 | 35 | /** 36 | * Model tests for InlineObject2 37 | */ 38 | @Test 39 | public void testInlineObject2() { 40 | // TODO: test InlineObject2 41 | } 42 | 43 | /** 44 | * Test the property 'phone' 45 | */ 46 | @Test 47 | public void phoneTest() { 48 | // TODO: test phone 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/model/InlineObjectTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import com.google.gson.TypeAdapter; 17 | import com.google.gson.annotations.JsonAdapter; 18 | import com.google.gson.annotations.SerializedName; 19 | import com.google.gson.stream.JsonReader; 20 | import com.google.gson.stream.JsonWriter; 21 | import io.swagger.annotations.ApiModel; 22 | import io.swagger.annotations.ApiModelProperty; 23 | import java.io.IOException; 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | /** 30 | * Model tests for InlineObject 31 | */ 32 | public class InlineObjectTest { 33 | private final InlineObject model = new InlineObject(); 34 | 35 | /** 36 | * Model tests for InlineObject 37 | */ 38 | @Test 39 | public void testInlineObject() { 40 | // TODO: test InlineObject 41 | } 42 | 43 | /** 44 | * Test the property 'phone' 45 | */ 46 | @Test 47 | public void phoneTest() { 48 | // TODO: test phone 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/model/InlineResponse2001Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import com.google.gson.TypeAdapter; 17 | import com.google.gson.annotations.JsonAdapter; 18 | import com.google.gson.annotations.SerializedName; 19 | import com.google.gson.stream.JsonReader; 20 | import com.google.gson.stream.JsonWriter; 21 | import io.swagger.annotations.ApiModel; 22 | import io.swagger.annotations.ApiModelProperty; 23 | import java.io.IOException; 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | /** 30 | * Model tests for InlineResponse2001 31 | */ 32 | public class InlineResponse2001Test { 33 | private final InlineResponse2001 model = new InlineResponse2001(); 34 | 35 | /** 36 | * Model tests for InlineResponse2001 37 | */ 38 | @Test 39 | public void testInlineResponse2001() { 40 | // TODO: test InlineResponse2001 41 | } 42 | 43 | /** 44 | * Test the property 'state' 45 | */ 46 | @Test 47 | public void stateTest() { 48 | // TODO: test state 49 | } 50 | 51 | /** 52 | * Test the property 'msg' 53 | */ 54 | @Test 55 | public void msgTest() { 56 | // TODO: test msg 57 | } 58 | 59 | /** 60 | * Test the property 'phone' 61 | */ 62 | @Test 63 | public void phoneTest() { 64 | // TODO: test phone 65 | } 66 | 67 | /** 68 | * Test the property 'virifycodeid' 69 | */ 70 | @Test 71 | public void virifycodeidTest() { 72 | // TODO: test virifycodeid 73 | } 74 | 75 | /** 76 | * Test the property 'virifyimage' 77 | */ 78 | @Test 79 | public void virifyimageTest() { 80 | // TODO: test virifyimage 81 | } 82 | 83 | /** 84 | * Test the property 'confluxaddress' 85 | */ 86 | @Test 87 | public void confluxaddressTest() { 88 | // TODO: test confluxaddress 89 | } 90 | 91 | /** 92 | * Test the property 'ethaddress' 93 | */ 94 | @Test 95 | public void ethaddressTest() { 96 | // TODO: test ethaddress 97 | } 98 | 99 | /** 100 | * Test the property 'token' 101 | */ 102 | @Test 103 | public void tokenTest() { 104 | // TODO: test token 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/test/java/org/openapitools/client/model/InlineResponse200Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 直接模式 3 | * 接入jugugu区块链全包的全部接口,访问IP需要连续管理员,添加业务服务器IP 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package org.openapitools.client.model; 15 | 16 | import com.google.gson.TypeAdapter; 17 | import com.google.gson.annotations.JsonAdapter; 18 | import com.google.gson.annotations.SerializedName; 19 | import com.google.gson.stream.JsonReader; 20 | import com.google.gson.stream.JsonWriter; 21 | import io.swagger.annotations.ApiModel; 22 | import io.swagger.annotations.ApiModelProperty; 23 | import java.io.IOException; 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | /** 30 | * Model tests for InlineResponse200 31 | */ 32 | public class InlineResponse200Test { 33 | private final InlineResponse200 model = new InlineResponse200(); 34 | 35 | /** 36 | * Model tests for InlineResponse200 37 | */ 38 | @Test 39 | public void testInlineResponse200() { 40 | // TODO: test InlineResponse200 41 | } 42 | 43 | /** 44 | * Test the property 'token' 45 | */ 46 | @Test 47 | public void tokenTest() { 48 | // TODO: test token 49 | } 50 | 51 | } 52 | --------------------------------------------------------------------------------