Selaa lähdekoodia

AccountInfoRepo调整

master
huminghao 2 kuukautta sitten
vanhempi
commit
6ef3a8f2db

+ 4
- 3
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/user/AccountInfoRepo.java Näytä tiedosto

@@ -1,6 +1,7 @@
package cn.com.taiji.core.repo.jpa.user;

import cn.com.taiji.common.repo.jpa.AbstractJpaRepo;
import cn.com.taiji.core.entity.dict.basic.IdType;
import cn.com.taiji.core.entity.dict.basic.UserType;
import cn.com.taiji.core.entity.user.AccountInfo;
import org.springframework.data.jpa.repository.Query;
@@ -15,11 +16,11 @@ public interface AccountInfoRepo extends AbstractJpaRepo<AccountInfo, String> {
@Query("FROM AccountInfo WHERE openId=?1")
AccountInfo findByOpenId(String openId);

@Query("FROM AccountInfo WHERE idNum = ?1")
AccountInfo findByIdNumAndUserType(String idNum);
@Query("FROM AccountInfo WHERE idNum = ?1 and idType = ?2")
AccountInfo findByIdNumAndIdType(String idNum, IdType idType);

@Query("FROM AccountInfo WHERE mobile=?1 ")
AccountInfo findAllByMobile(String mobile);
AccountInfo findByMobile(String mobile);

@Query("FROM AccountInfo WHERE openId in ?1")
List<AccountInfo> findByOpenIdList(List<String> openIds);

+ 0
- 101
zhywpt-service-ias/src/main/java/cn/com/taiji/ias/tools/HttpClientUtil.java Näytä tiedosto

@@ -180,105 +180,4 @@ public class HttpClientUtil {
}
}


// /**
// * 发送 GET 请求
// * @param urlStr 请求 URL
// * @param headers 请求头(可选)
// * @return 响应内容
// * @throws IOException
// */
// public static String doGet(String urlStr, Map<String, String> headers) throws IOException {
// HttpURLConnection connection = null;
// try {
// // 创建 URL 对象
// URL url = new URL(urlStr);
// connection = (HttpURLConnection) url.openConnection();
// connection.setRequestMethod("GET");
// connection.setConnectTimeout(CONNECT_TIMEOUT);
// connection.setReadTimeout(CONNECT_TIMEOUT);
//
// // 设置请求头
// if (headers != null) {
// for (Map.Entry<String, String> entry : headers.entrySet()) {
// connection.setRequestProperty(entry.getKey(), entry.getValue());
// }
// }
//
// return getResponse(connection);
// } finally {
// if (connection != null) {
// connection.disconnect();
// }
// }
// }

// /**
// * 发送 POST 请求
// * @param urlStr 请求 URL
// * @param jsonBody JSON 格式的请求体
// * @param headers 请求头(可选)
// * @return 响应内容
// * @throws IOException
// */
// public static String doPost(String urlStr, String jsonBody, Map<String, String> headers) throws IOException {
// HttpURLConnection connection = null;
// try {
// // 创建 URL 对象
// URL url = new URL(urlStr);
// connection = (HttpURLConnection) url.openConnection();
// connection.setRequestMethod("POST");
// connection.setDoOutput(true);
// connection.setConnectTimeout(CONNECT_TIMEOUT);
// connection.setReadTimeout(CONNECT_TIMEOUT);
//
// // 设置请求头
// connection.setRequestProperty("Content-Type", "application/json");
// if (headers != null) {
// for (Map.Entry<String, String> entry : headers.entrySet()) {
// connection.setRequestProperty(entry.getKey(), entry.getValue());
// }
// }
//
// // 发送请求体
// if (jsonBody != null) {
// try (OutputStream os = connection.getOutputStream()) {
// byte[] input = jsonBody.getBytes(StandardCharsets.UTF_8);
// os.write(input, 0, input.length);
// }
// }
//
// return getResponse(connection);
// } finally {
// if (connection != null) {
// connection.disconnect();
// }
// }
// }

// /**
// * 读取 HTTP 响应
// * @param connection HttpURLConnection 对象
// * @return 响应内容
// * @throws IOException
// */
// private static String getResponse(HttpURLConnection connection) throws IOException {
// int responseCode = connection.getResponseCode();
// InputStream inputStream = responseCode >= 200 && responseCode < 300
// ? connection.getInputStream()
// : connection.getErrorStream();
//
// if (inputStream == null) {
// return "";
// }
//
// try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
// StringBuilder response = new StringBuilder();
// String line;
// while ((line = reader.readLine()) != null) {
// response.append(line);
// }
// return response.toString();
// }
// }
}

Loading…
Peruuta
Tallenna