Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-04-11 18:03:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
744608a89634eb20155403784ce8a7220d6970a8
744608a8
1 parent
21c3c0d5
升级
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
28 deletions
build.gradle
gradle.properties
gradle/wrapper/gradle-wrapper.properties
src/main/java/com/infoloop/tianting/config/WebMvcConfig.java
src/main/java/com/infoloop/tianting/intercepter/LoginInterceptor.java
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
build.gradle
View file @
744608a
...
...
@@ -2,9 +2,9 @@ plugins {
id
'java'
id
'idea'
id
'application'
id
'org.springframework.boot'
version
'2.
3.3.RELEASE
'
id
'io.spring.dependency-management'
version
'1.
0.10.RELEASE
'
id
'com.google.protobuf'
version
'0.9.
3
'
id
'org.springframework.boot'
version
'2.
5.12
'
id
'io.spring.dependency-management'
version
'1.
1.6
'
id
'com.google.protobuf'
version
'0.9.
4
'
}
repositories
{
...
...
@@ -21,8 +21,8 @@ application {
}
ext
{
grpcVersion
=
'1.
39.0
'
protobufVersion
=
'3.
17.2
'
grpcVersion
=
'1.
62.2
'
protobufVersion
=
'3.
25.3
'
}
dependencies
{
...
...
@@ -67,20 +67,13 @@ dependencies {
testImplementation
'org.springframework.boot:spring-boot-starter-test'
}
static
def
isAppleSilicon
()
{
// 检测 macOS 并且使用的是 Apple Silicon 架构
return
System
.
getProperty
(
'os.name'
).
toLowerCase
().
contains
(
'mac'
)
&&
System
.
getProperty
(
'os.arch'
).
equals
(
'aarch64'
)
}
def
protocPlatform
=
isAppleSilicon
()
?
':osx-x86_64'
:
''
;
protobuf
{
protoc
{
artifact
=
"com.google.protobuf:protoc:${protobufVersion}
${protocPlatform}
"
artifact
=
"com.google.protobuf:protoc:${protobufVersion}"
}
plugins
{
grpc
{
artifact
=
"io.grpc:protoc-gen-grpc-java:${grpcVersion}
${protocPlatform}
"
artifact
=
"io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks
{
...
...
@@ -100,6 +93,13 @@ tasks.withType(JavaCompile).configureEach {
it
.
options
.
fork
=
true
}
tasks
{
compileJava
{
dependsOn
generateProto
source
fileTree
(
'build/generated/source/proto/main/java'
)
}
}
sourceSets
{
main
{
...
...
gradle.properties
View file @
744608a
org.gradle.daemon
=
true
org.gradle.parallel
=
true
org.gradle.caching
=
true
org.gradle.jvmargs
=
-Xmx3096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs
=
-Xmx8g -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.incremental
=
true
org.gradle.configureondemand
=
true
org.gradle.java.home
=
/usr/lib/jvm/java-11-openjdk-amd64
\ No newline at end of file
org.gradle.configuration-
cache
=
true
\ No newline at end of file
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
744608a
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https://mirrors.cloud.tencent.com/gradle/gradle-
6.9
-bin.zip
distributionUrl
=
https://mirrors.cloud.tencent.com/gradle/gradle-
8.11
-bin.zip
networkTimeout
=
10000
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
#
org.gradle.java.home
=
/usr/lib/jvm/java-17-openjdk-amd64
\ No newline at end of file
...
...
src/main/java/com/infoloop/tianting/config/WebMvcConfig.java
View file @
744608a
...
...
@@ -68,7 +68,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
// 跨域支持
registry
.
addMapping
(
"/**"
)
.
allowedOrigins
(
"*"
)
.
allowedOrigin
Pattern
s
(
"*"
)
.
allowedMethods
(
HttpMethod
.
GET
.
name
(),
HttpMethod
.
POST
.
name
(),
HttpMethod
.
PUT
.
name
(),
HttpMethod
.
DELETE
.
name
(),
HttpMethod
.
PATCH
.
name
(),
HttpMethod
.
OPTIONS
.
name
())
.
allowCredentials
(
true
);
}
...
...
src/main/java/com/infoloop/tianting/intercepter/LoginInterceptor.java
View file @
744608a
...
...
@@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.
handler.HandlerInterceptorAdapte
r
;
import
org.springframework.web.servlet.
HandlerIntercepto
r
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -33,7 +33,7 @@ import java.io.IOException;
@Component
@SuppressWarnings
(
"all"
)
@RequiredArgsConstructor
public
class
LoginInterceptor
extends
HandlerInterceptorAdapte
r
{
public
class
LoginInterceptor
implements
HandlerIntercepto
r
{
private
final
ClientCustomerServiceRpcClient
clientCustomerServiceRpcClient
;
private
final
MeiZhongYiHeServiceClient
meiZhongYiHeServiceClient
;
...
...
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
View file @
744608a
...
...
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.PropertyNamingStrateg
y
;
import
com.fasterxml.jackson.databind.PropertyNamingStrateg
ies
;
import
com.fasterxml.jackson.dataformat.xml.XmlMapper
;
import
com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderModification
;
import
com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum
;
...
...
@@ -36,7 +36,6 @@ import com.infoloop.tianting.utils.EncryptionUtil;
import
com.infoloop.tianting.utils.JsonUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.OkHttpClient
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -78,8 +77,6 @@ public class PayServiceClient {
private
final
XmlMapper
xmlMapper
=
new
XmlMapper
();
private
final
OkHttpClient
client
=
new
OkHttpClient
();
public
PayResponseDto
payInform
(
PayInformRequestDto
payRequestDto
)
{
final
var
orderById
=
orderServiceRpcClient
.
getOrderById
(
Integer
.
valueOf
(
payRequestDto
.
getOrderId
()));
...
...
@@ -97,7 +94,7 @@ public class PayServiceClient {
ObjectMapper
objectMapper
=
new
ObjectMapper
();
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
objectMapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
objectMapper
.
setPropertyNamingStrategy
(
PropertyNamingStrategy
.
UPPER_CAMEL_CASE
);
objectMapper
.
setPropertyNamingStrategy
(
new
PropertyNamingStrategies
.
UpperCamelCaseStrategy
()
);
jsonDataString
=
objectMapper
.
writeValueAsString
(
jsonData
);
}
catch
(
JsonProcessingException
e
)
{
log
.
error
(
"Failed to serialize request data"
,
e
);
...
...
@@ -354,7 +351,6 @@ public class PayServiceClient {
+
"^"
+
"01"
+
"^"
+
""
+
"^"
+
orderById
.
getOpenId
()
+
"^"
...
...
@@ -368,7 +364,6 @@ public class PayServiceClient {
+
"^"
+
payRefundRequestDto
.
getHospitalCode
()
+
"^"
+
""
+
"^"
+
LoginContextHolder
.
getId
()
+
"^"
...
...
@@ -384,7 +379,7 @@ public class PayServiceClient {
// 构建请求
try
{
String
url
=
businessConfig
.
getCancelPayUrl
()
+
"?"
+
"appid="
+
appId
+
"&paycontent="
+
payContent
+
"&signinfo="
+
signInfo
;
log
.
info
(
"cancel order pay url:"
+
url
);
log
.
info
(
"cancel order pay url:{}"
,
url
);
// Request request =
// new Request.Builder().url(url).get().build();
// Response payResponse = client.newCall(request).execute();
...
...
Please
register
or
login
to post a comment