Skip to content
Merged

Dev #159

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/example-app/example-app-cmd-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/example-app-cmd-meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/example-app-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/example-domain-leave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-domain</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/example-domain-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-domain</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion example/example-interface/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>

<artifactId>example-interface</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example/example-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>springboot-example</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</parent>

<artifactId>springboot-example</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>

<name>springboot-example</name>
<description>springboot-example project for Spring Boot</description>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>

<url>https://github.com/codingapi/springboot-framewrok</url>
<name>springboot-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-data-authorization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>

<name>springboot-starter-data-authorization</name>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-data-fast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>

<name>springboot-starter-flow</name>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>

<artifactId>springboot-starter-security</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.4.19</version>
<version>3.4.20</version>
</parent>
<artifactId>springboot-starter</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public String post(String url, HttpHeaders headers, JSON jsonObject) {
return httpRequest.getPostRequest(url, headers, jsonObject).execute();
}

public String post(String url, HttpHeaders headers, MultiValueMap<String, String> formData) {
public String post(String url, HttpHeaders headers, MultiValueMap<String, Object> formData) {
return httpRequest.getPostRequest(url, headers, formData).execute();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public Request getPostRequest(String url, HttpHeaders headers, JSON jsonObject)
};
}

public Request getPostRequest(String url, HttpHeaders headers, MultiValueMap<String, String> formData) {
HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(formData, headers);
public Request getPostRequest(String url, HttpHeaders headers, MultiValueMap<String, Object> formData) {
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(formData, headers);
String requestUrl = requestHandler.handler(this,url ,HttpMethod.POST,headers,httpEntity);
return () -> {
ResponseEntity<String> httpResponse = restTemplate.exchange(requestUrl, HttpMethod.POST, httpEntity, String.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public String get(String api, HttpHeaders headers, MultiValueMap<String, String>
}

public String get(String api, HttpHeaders headers, RestParam paramBuilder) {
return get(api, headers,paramBuilder!=null?paramBuilder.toFormRequest():null);
return get(api, headers,paramBuilder!=null?paramBuilder.toGetRequest():null);
}

public String get(String api, RestParam paramBuilder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public String getHtml(String url){

public String getHtml(String url, RestParam restParam){
httpHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
return httpClient.get(url,httpHeaders,restParam!=null?restParam.toFormRequest():null);
return httpClient.get(url,httpHeaders,restParam!=null?restParam.toGetRequest():null);
}

public String getJson(String url, RestParam restParam){
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
return httpClient.get(url,httpHeaders,restParam!=null?restParam.toFormRequest():null);
return httpClient.get(url,httpHeaders,restParam!=null?restParam.toGetRequest():null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

public class RestParam {

private final JSONObject jsonBody;
private final MultiValueMap<String, String> mapBody;
private final MultiValueMap<String, Object> mapBody;

private RestParam() {
this.jsonBody = new JSONObject();
Expand Down Expand Up @@ -42,10 +44,24 @@ public JSONObject toJsonRequest() {
return jsonBody;
}

public MultiValueMap<String, String> toFormRequest() {
public MultiValueMap<String, Object> toFormRequest() {
return mapBody;
}

public MultiValueMap<String,String> toGetRequest(){
MultiValueMap<String,String> request = new LinkedMultiValueMap<>();
for(String key: mapBody.keySet()){
List<Object> objectList = mapBody.get(key);
List<String> stringList = new ArrayList<>();
for (Object object:objectList){
stringList.add(object.toString());
}
request.put(key,stringList);
}
return request;
}


public RestParam add(String key, Object value) {
return add(key, value, true);
}
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
------------------------------------------------------
CodingApi SpringBoot-Starter 3.4.19
CodingApi SpringBoot-Starter 3.4.20
springboot version (${spring-boot.version})
------------------------------------------------------