Skip to content

Commit 7cf9e7b

Browse files
committed
🎨 格式化代码
1 parent 17fb4ee commit 7cf9e7b

File tree

2 files changed

+7
-57
lines changed

2 files changed

+7
-57
lines changed
Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package com.xkcoding.http.support;
22

3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
37
import java.util.List;
48
import java.util.Map;
59

@@ -11,65 +15,12 @@
1115
* @author zhihai.yu
1216
* @date Created in 2021/09/10 20:24
1317
*/
18+
@Data
19+
@NoArgsConstructor
20+
@AllArgsConstructor
1421
public class SimpleHttpResponse {
1522
private boolean success;
1623
private int code;
1724
private Map<String, List<String>> headers;
1825
private String body;
19-
20-
public SimpleHttpResponse() {
21-
}
22-
23-
public SimpleHttpResponse(boolean success, int code, Map<String, List<String>> headers, String body) {
24-
this.success = success;
25-
this.code = code;
26-
this.headers = headers;
27-
this.body = body;
28-
}
29-
30-
public Map<String, List<String>> getHeaders() {
31-
return headers;
32-
}
33-
34-
public SimpleHttpResponse setHeaders(Map<String, List<String>> headers) {
35-
this.headers = headers;
36-
return this;
37-
}
38-
39-
public String getBody() {
40-
return body;
41-
}
42-
43-
public SimpleHttpResponse setBody(String body) {
44-
this.body = body;
45-
return this;
46-
}
47-
48-
public boolean isSuccess() {
49-
return success;
50-
}
51-
52-
public SimpleHttpResponse setSuccess(boolean success) {
53-
this.success = success;
54-
return this;
55-
}
56-
57-
public int getCode() {
58-
return code;
59-
}
60-
61-
public SimpleHttpResponse setCode(int code) {
62-
this.code = code;
63-
return this;
64-
}
65-
66-
@Override
67-
public String toString() {
68-
return "SimpleHttpResponse{" +
69-
"success=" + success +
70-
", code=" + code +
71-
", headers=" + headers +
72-
", body='" + body + '\'' +
73-
'}';
74-
}
7526
}

src/main/java/com/xkcoding/http/support/hutool/HutoolImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ private SimpleHttpResponse exec(HttpRequest request) {
5757
}
5858

5959
try (HttpResponse response = request.execute()) {
60-
6160
int code = response.getStatus();
6261
boolean successful = response.isOk();
6362
String body = response.body();

0 commit comments

Comments
 (0)