删除排序
parent
915f788103
commit
a2af7b9caa
|
@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
|
|||
public class IdCard {
|
||||
private String idcard;
|
||||
private String realname;
|
||||
private String orderid;
|
||||
private Integer orderid;
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
|
@ -36,11 +36,11 @@ public class IdCard {
|
|||
this.realname = realname;
|
||||
}
|
||||
|
||||
public String getOrderid() {
|
||||
public Integer getOrderid() {
|
||||
return orderid;
|
||||
}
|
||||
|
||||
public void setOrderid(String orderid) {
|
||||
public void setOrderid(Integer orderid) {
|
||||
this.orderid = orderid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
|
@ -33,18 +34,24 @@ public class IdCard {
|
|||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("key", apiKey);
|
||||
map.put("idcard", idCard.getIdcard());
|
||||
map.put("realname",idCard.getRealname());
|
||||
map.put("orderid", idCard.getOrderid());
|
||||
map.put("realname", idCard.getRealname());
|
||||
map.put("orderid", "");
|
||||
|
||||
URL url = new URL(String.format(apiUrl + "?" + params(map)));
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
|
||||
String queryString = params(map);
|
||||
URL url = new URL(apiUrl + "?" + queryString);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuffer response = new StringBuffer();
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
return Result.success(response);
|
||||
|
||||
// 假设Result.success能够处理字符串并返回适当的Result对象
|
||||
return Result.success(response.toString());
|
||||
}
|
||||
|
||||
public static String params(Map<String, String> map) {
|
||||
|
|
Loading…
Reference in New Issue