Showing
5 changed files
with
24 additions
and
27 deletions
| ... | @@ -2,9 +2,9 @@ plugins { | ... | @@ -2,9 +2,9 @@ plugins { |
| 2 | id 'java' | 2 | id 'java' |
| 3 | id 'idea' | 3 | id 'idea' |
| 4 | id 'application' | 4 | id 'application' |
| 5 | - id 'org.springframework.boot' version '2.3.3.RELEASE' | 5 | + id 'org.springframework.boot' version '2.5.12' |
| 6 | - id 'io.spring.dependency-management' version '1.0.10.RELEASE' | 6 | + id 'io.spring.dependency-management' version '1.1.6' |
| 7 | - id 'com.google.protobuf' version '0.9.3' | 7 | + id 'com.google.protobuf' version '0.9.4' |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | repositories { | 10 | repositories { |
| ... | @@ -21,8 +21,8 @@ application { | ... | @@ -21,8 +21,8 @@ application { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | ext { | 23 | ext { |
| 24 | - grpcVersion = '1.39.0' | 24 | + grpcVersion = '1.62.2' |
| 25 | - protobufVersion = '3.17.2' | 25 | + protobufVersion = '3.25.3' |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | dependencies { | 28 | dependencies { |
| ... | @@ -67,20 +67,13 @@ dependencies { | ... | @@ -67,20 +67,13 @@ dependencies { |
| 67 | testImplementation 'org.springframework.boot:spring-boot-starter-test' | 67 | testImplementation 'org.springframework.boot:spring-boot-starter-test' |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | -static def isAppleSilicon() { | ||
| 71 | - // 检测 macOS 并且使用的是 Apple Silicon 架构 | ||
| 72 | - return System.getProperty('os.name').toLowerCase().contains('mac') && System.getProperty('os.arch').equals('aarch64') | ||
| 73 | -} | ||
| 74 | - | ||
| 75 | -def protocPlatform = isAppleSilicon() ? ':osx-x86_64' : ''; | ||
| 76 | - | ||
| 77 | protobuf { | 70 | protobuf { |
| 78 | protoc { | 71 | protoc { |
| 79 | - artifact = "com.google.protobuf:protoc:${protobufVersion}${protocPlatform}" | 72 | + artifact = "com.google.protobuf:protoc:${protobufVersion}" |
| 80 | } | 73 | } |
| 81 | plugins { | 74 | plugins { |
| 82 | grpc { | 75 | grpc { |
| 83 | - artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}${protocPlatform}" | 76 | + artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" |
| 84 | } | 77 | } |
| 85 | } | 78 | } |
| 86 | generateProtoTasks { | 79 | generateProtoTasks { |
| ... | @@ -100,6 +93,13 @@ tasks.withType(JavaCompile).configureEach { | ... | @@ -100,6 +93,13 @@ tasks.withType(JavaCompile).configureEach { |
| 100 | it.options.fork = true | 93 | it.options.fork = true |
| 101 | } | 94 | } |
| 102 | 95 | ||
| 96 | +tasks { | ||
| 97 | + compileJava { | ||
| 98 | + dependsOn generateProto | ||
| 99 | + source fileTree('build/generated/source/proto/main/java') | ||
| 100 | + } | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | 103 | ||
| 104 | sourceSets { | 104 | sourceSets { |
| 105 | main { | 105 | main { | ... | ... |
| 1 | org.gradle.daemon=true | 1 | org.gradle.daemon=true |
| 2 | org.gradle.parallel=true | 2 | org.gradle.parallel=true |
| 3 | org.gradle.caching=true | 3 | org.gradle.caching=true |
| 4 | -org.gradle.jvmargs=-Xmx3096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | 4 | +org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 |
| 5 | +org.gradle.incremental=true | ||
| 5 | org.gradle.configureondemand=true | 6 | org.gradle.configureondemand=true |
| 6 | -org.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 7 | +org.gradle.configuration-cache=true | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | distributionBase=GRADLE_USER_HOME | 1 | distributionBase=GRADLE_USER_HOME |
| 2 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
| 3 | -distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.9-bin.zip | 3 | +distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.11-bin.zip |
| 4 | networkTimeout=10000 | 4 | networkTimeout=10000 |
| 5 | zipStoreBase=GRADLE_USER_HOME | 5 | zipStoreBase=GRADLE_USER_HOME |
| 6 | zipStorePath=wrapper/dists | 6 | zipStorePath=wrapper/dists |
| 7 | +#org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j; | ... | @@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j; |
| 23 | import org.springframework.http.HttpStatus; | 23 | import org.springframework.http.HttpStatus; |
| 24 | import org.springframework.stereotype.Component; | 24 | import org.springframework.stereotype.Component; |
| 25 | import org.springframework.web.method.HandlerMethod; | 25 | import org.springframework.web.method.HandlerMethod; |
| 26 | -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | 26 | +import org.springframework.web.servlet.HandlerInterceptor; |
| 27 | 27 | ||
| 28 | import javax.servlet.http.HttpServletRequest; | 28 | import javax.servlet.http.HttpServletRequest; |
| 29 | import javax.servlet.http.HttpServletResponse; | 29 | import javax.servlet.http.HttpServletResponse; |
| ... | @@ -33,7 +33,7 @@ import java.io.IOException; | ... | @@ -33,7 +33,7 @@ import java.io.IOException; |
| 33 | @Component | 33 | @Component |
| 34 | @SuppressWarnings("all") | 34 | @SuppressWarnings("all") |
| 35 | @RequiredArgsConstructor | 35 | @RequiredArgsConstructor |
| 36 | -public class LoginInterceptor extends HandlerInterceptorAdapter { | 36 | +public class LoginInterceptor implements HandlerInterceptor { |
| 37 | 37 | ||
| 38 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; | 38 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; |
| 39 | private final MeiZhongYiHeServiceClient meiZhongYiHeServiceClient; | 39 | private final MeiZhongYiHeServiceClient meiZhongYiHeServiceClient; | ... | ... |
| ... | @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; | ... | @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; |
| 5 | import com.fasterxml.jackson.core.JsonProcessingException; | 5 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 6 | import com.fasterxml.jackson.databind.DeserializationFeature; | 6 | import com.fasterxml.jackson.databind.DeserializationFeature; |
| 7 | import com.fasterxml.jackson.databind.ObjectMapper; | 7 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | -import com.fasterxml.jackson.databind.PropertyNamingStrategy; | 8 | +import com.fasterxml.jackson.databind.PropertyNamingStrategies; |
| 9 | import com.fasterxml.jackson.dataformat.xml.XmlMapper; | 9 | import com.fasterxml.jackson.dataformat.xml.XmlMapper; |
| 10 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderModification; | 10 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderModification; |
| 11 | import com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum; | 11 | import com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum; |
| ... | @@ -36,7 +36,6 @@ import com.infoloop.tianting.utils.EncryptionUtil; | ... | @@ -36,7 +36,6 @@ import com.infoloop.tianting.utils.EncryptionUtil; |
| 36 | import com.infoloop.tianting.utils.JsonUtil; | 36 | import com.infoloop.tianting.utils.JsonUtil; |
| 37 | import lombok.RequiredArgsConstructor; | 37 | import lombok.RequiredArgsConstructor; |
| 38 | import lombok.extern.slf4j.Slf4j; | 38 | import lombok.extern.slf4j.Slf4j; |
| 39 | -import okhttp3.OkHttpClient; | ||
| 40 | import org.apache.commons.codec.binary.Base64; | 39 | import org.apache.commons.codec.binary.Base64; |
| 41 | import org.apache.commons.codec.digest.DigestUtils; | 40 | import org.apache.commons.codec.digest.DigestUtils; |
| 42 | import org.springframework.beans.factory.annotation.Autowired; | 41 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -78,8 +77,6 @@ public class PayServiceClient { | ... | @@ -78,8 +77,6 @@ public class PayServiceClient { |
| 78 | 77 | ||
| 79 | private final XmlMapper xmlMapper = new XmlMapper(); | 78 | private final XmlMapper xmlMapper = new XmlMapper(); |
| 80 | 79 | ||
| 81 | - private final OkHttpClient client = new OkHttpClient(); | ||
| 82 | - | ||
| 83 | public PayResponseDto payInform(PayInformRequestDto payRequestDto) { | 80 | public PayResponseDto payInform(PayInformRequestDto payRequestDto) { |
| 84 | final var orderById = | 81 | final var orderById = |
| 85 | orderServiceRpcClient.getOrderById(Integer.valueOf(payRequestDto.getOrderId())); | 82 | orderServiceRpcClient.getOrderById(Integer.valueOf(payRequestDto.getOrderId())); |
| ... | @@ -97,7 +94,7 @@ public class PayServiceClient { | ... | @@ -97,7 +94,7 @@ public class PayServiceClient { |
| 97 | ObjectMapper objectMapper = new ObjectMapper(); | 94 | ObjectMapper objectMapper = new ObjectMapper(); |
| 98 | objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | 95 | objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| 99 | objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | 96 | objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); |
| 100 | - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE); | 97 | + objectMapper.setPropertyNamingStrategy(new PropertyNamingStrategies.UpperCamelCaseStrategy()); |
| 101 | jsonDataString = objectMapper.writeValueAsString(jsonData); | 98 | jsonDataString = objectMapper.writeValueAsString(jsonData); |
| 102 | } catch (JsonProcessingException e) { | 99 | } catch (JsonProcessingException e) { |
| 103 | log.error("Failed to serialize request data", e); | 100 | log.error("Failed to serialize request data", e); |
| ... | @@ -354,7 +351,6 @@ public class PayServiceClient { | ... | @@ -354,7 +351,6 @@ public class PayServiceClient { |
| 354 | + "^" | 351 | + "^" |
| 355 | + "01" | 352 | + "01" |
| 356 | + "^" | 353 | + "^" |
| 357 | - + "" | ||
| 358 | + "^" | 354 | + "^" |
| 359 | + orderById.getOpenId() | 355 | + orderById.getOpenId() |
| 360 | + "^" | 356 | + "^" |
| ... | @@ -368,7 +364,6 @@ public class PayServiceClient { | ... | @@ -368,7 +364,6 @@ public class PayServiceClient { |
| 368 | + "^" | 364 | + "^" |
| 369 | + payRefundRequestDto.getHospitalCode() | 365 | + payRefundRequestDto.getHospitalCode() |
| 370 | + "^" | 366 | + "^" |
| 371 | - + "" | ||
| 372 | + "^" | 367 | + "^" |
| 373 | + LoginContextHolder.getId() | 368 | + LoginContextHolder.getId() |
| 374 | + "^" | 369 | + "^" |
| ... | @@ -384,7 +379,7 @@ public class PayServiceClient { | ... | @@ -384,7 +379,7 @@ public class PayServiceClient { |
| 384 | // 构建请求 | 379 | // 构建请求 |
| 385 | try { | 380 | try { |
| 386 | String url = businessConfig.getCancelPayUrl() + "?" + "appid=" + appId + "&paycontent=" + payContent + "&signinfo=" + signInfo; | 381 | String url = businessConfig.getCancelPayUrl() + "?" + "appid=" + appId + "&paycontent=" + payContent + "&signinfo=" + signInfo; |
| 387 | - log.info("cancel order pay url:" + url); | 382 | + log.info("cancel order pay url:{}", url); |
| 388 | // Request request = | 383 | // Request request = |
| 389 | // new Request.Builder().url(url).get().build(); | 384 | // new Request.Builder().url(url).get().build(); |
| 390 | // Response payResponse = client.newCall(request).execute(); | 385 | // Response payResponse = client.newCall(request).execute(); | ... | ... |
-
Please register or login to post a comment