Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
f193fbd9
Commit
f193fbd9
authored
Oct 19, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/main'
parents
464a76a2
860f749c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
application-dev.yml
share-front/src/main/resources/application-dev.yml
+4
-0
MTService.java
...-system/src/main/java/share/system/service/MTService.java
+5
-1
MTServiceImpl.java
...rc/main/java/share/system/service/impl/MTServiceImpl.java
+51
-1
No files found.
share-front/src/main/resources/application-dev.yml
View file @
f193fbd9
...
...
@@ -174,3 +174,7 @@ xss:
excludes
:
/system/notice
# 匹配链接
urlPatterns
:
/system/*,/monitor/*,/tool/*
meituan
:
developerId
:
123456
signKey
:
abcdefghijklmnopqrstuvwxyz
appAuthToken
:
abcdefghijklmnopqrstuvwxyz
share-system/src/main/java/share/system/service/MTService.java
View file @
f193fbd9
package
share
.
system
.
service
;
public
interface
MTService
{
public
String
V
erificationVouchers
(
String
code
,
int
num
);
public
String
v
erificationVouchers
(
String
code
,
int
num
);
public
String
revoke
(
String
ERPId
,
String
ERPName
,
String
couponCode
);
String
preparation
(
String
code
);
String
Verified
(
String
code
);
}
share-system/src/main/java/share/system/service/impl/MTServiceImpl.java
View file @
f193fbd9
...
...
@@ -8,6 +8,10 @@ import com.meituan.sdk.model.tuangouNg.coupon.couponCancel.CouponCancelRequest;
import
com.meituan.sdk.model.tuangouNg.coupon.couponCancel.CouponCancelResponse
;
import
com.meituan.sdk.model.tuangouNg.coupon.msSuperConsume.MsSuperConsumeRequest
;
import
com.meituan.sdk.model.tuangouNg.coupon.msSuperConsume.MsSuperConsumeResponse
;
import
com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareRequest
;
import
com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareResponse
;
import
com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdRequest
;
import
com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdResponse
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
share.system.service.MTService
;
...
...
@@ -20,8 +24,9 @@ public class MTServiceImpl implements MTService {
private
String
appAuthToken
;
@Value
(
"${meituan.developerId}"
)
private
Long
developerId
;
//执行验券
@Override
public
String
V
erificationVouchers
(
String
code
,
int
num
)
{
public
String
v
erificationVouchers
(
String
code
,
int
num
)
{
//developerId 服务商身份标识 signKey 服务商签名密钥
MeituanClient
meituanClient
=
DefaultMeituanClient
.
builder
(
developerId
,
signKey
).
build
();
MsSuperConsumeRequest
msSuperConsumeRequest
=
new
MsSuperConsumeRequest
();
...
...
@@ -44,6 +49,7 @@ public class MTServiceImpl implements MTService {
return
null
;
}
//撤销验券
@Override
public
String
revoke
(
String
ERPId
,
String
ERPName
,
String
couponCode
)
{
MeituanClient
meituanClient
=
DefaultMeituanClient
.
builder
(
developerId
,
signKey
).
build
();
...
...
@@ -66,4 +72,48 @@ public class MTServiceImpl implements MTService {
}
return
null
;
}
//验券准备
@Override
public
String
preparation
(
String
code
)
{
MeituanClient
meituanClient
=
DefaultMeituanClient
.
builder
(
developerId
,
signKey
).
build
();
MsSuperPrepareRequest
msSuperPrepareRequest
=
new
MsSuperPrepareRequest
();
msSuperPrepareRequest
.
setCode
(
code
);
MeituanResponse
<
MsSuperPrepareResponse
>
response
=
null
;
try
{
response
=
meituanClient
.
invokeApi
(
msSuperPrepareRequest
,
appAuthToken
);
}
catch
(
MtSdkException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
response
.
isSuccess
())
{
MsSuperPrepareResponse
resp
=
response
.
getData
();
return
resp
.
toString
();
}
else
{
System
.
out
.
println
(
"调用失败"
);
}
return
null
;
}
//已验券码查询
@Override
public
String
Verified
(
String
code
)
{
MeituanClient
meituanClient
=
DefaultMeituanClient
.
builder
(
developerId
,
signKey
).
build
();
QueryCouponByIdRequest
queryCouponByIdRequest
=
new
QueryCouponByIdRequest
();
queryCouponByIdRequest
.
setCouponCode
(
code
);
MeituanResponse
<
QueryCouponByIdResponse
>
response
=
null
;
try
{
response
=
meituanClient
.
invokeApi
(
queryCouponByIdRequest
,
appAuthToken
);
}
catch
(
MtSdkException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
response
.
isSuccess
())
{
QueryCouponByIdResponse
resp
=
response
.
getData
();
return
resp
.
toString
();
}
else
{
System
.
out
.
println
(
"调用失败"
);
}
return
null
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment