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
971f0d8c
Commit
971f0d8c
authored
Nov 06, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美团增加接口
parent
0d7b2ce3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
QPController.java
...c/main/java/share/web/controller/system/QPController.java
+21
-6
QPService.java
...-system/src/main/java/share/system/service/QPService.java
+6
-4
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+7
-2
No files found.
share-front/src/main/java/share/web/controller/system/QPController.java
View file @
971f0d8c
package
share
.
web
.
controller
.
system
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -8,6 +9,8 @@ import org.springframework.web.bind.annotation.RestController;
import
share.common.core.domain.R
;
import
share.system.service.QPService
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/front/chessCards"
)
@Api
(
tags
=
"首页-验券"
)
...
...
@@ -17,37 +20,49 @@ public class QPController {
//输码验券校验接口
@GetMapping
(
"/prepare"
)
public
R
prepare
(
String
code
)
{
public
R
<
TuangouReceiptPrepareResponseEntity
>
prepare
(
String
code
)
{
return
R
.
ok
(
qpService
.
prepare
(
code
));
}
//验券接口
@GetMapping
(
"/consume"
)
public
R
consume
(
String
code
,
int
count
)
{
public
R
<
List
<
TuangouReceiptConsumeResponseEntity
>>
consume
(
String
code
,
int
count
)
{
return
R
.
ok
(
qpService
.
consume
(
code
,
count
));
}
//撤销验券接口
@GetMapping
(
"/reverseconsume"
)
public
R
reverseconsume
(
String
code
,
String
appDealId
)
{
public
R
<
List
<
TuangouReceiptReverseConsumeResponseEntity
>>
reverseconsume
(
String
code
,
String
appDealId
)
{
return
R
.
ok
(
qpService
.
reverseconsume
(
code
,
appDealId
));
}
//查询已验券信息接口
@GetMapping
(
"/getconsumed"
)
public
R
getconsumed
(
String
code
)
{
public
R
<
TuangouReceiptGetConsumedReponseEntity
>
getconsumed
(
String
code
)
{
return
R
.
ok
(
qpService
.
getconsumed
(
code
));
}
//用户验券接口
@GetMapping
(
"/consumeByUser"
)
public
R
consumeByUser
(
String
code
,
int
count
)
{
public
R
<
String
>
consumeByUser
(
String
code
,
int
count
)
{
return
R
.
ok
(
qpService
.
consumeByUser
(
code
,
count
));
}
//用户销券接口
@GetMapping
(
"/reverseconsumeByUser"
)
public
R
reverseconsumeByUser
(
Long
id
)
{
public
R
<
String
>
reverseconsumeByUser
(
Long
id
)
{
return
R
.
ok
(
qpService
.
reverseconsumeByUser
(
id
));
}
//通过authCode,获取授权的session
@GetMapping
(
"/oauthToken"
)
public
R
<
String
>
oauthToken
(
String
authCode
)
{
return
R
.
ok
(
qpService
.
oauthToken
(
authCode
));
}
//获取商家所有的团购信息
@GetMapping
(
"/queryshopdeal"
)
public
R
<
List
<
TuangouDealQueryShopDealResponseEntity
>>
queryshopdeal
()
{
return
R
.
ok
(
qpService
.
queryshopdeal
());
}
}
share-system/src/main/java/share/system/service/QPService.java
View file @
971f0d8c
package
share
.
system
.
service
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptConsumeResponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptPrepareResponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptReverseConsumeResponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
share.common.core.domain.R
;
import
java.util.List
;
...
...
@@ -19,4 +17,8 @@ public interface QPService {
String
consumeByUser
(
String
code
,
int
count
);
String
reverseconsumeByUser
(
Long
id
);
String
oauthToken
(
String
authCode
);
List
<
TuangouDealQueryShopDealResponseEntity
>
queryshopdeal
();
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
971f0d8c
...
...
@@ -126,9 +126,14 @@ public class QPServiceImpl implements QPService {
*/
@Override
public
List
<
TuangouReceiptConsumeResponseEntity
>
consume
(
String
code
,
int
count
)
{
//商家在自研系统或第三方服务商系统内登录的帐号
String
app_shop_account
=
"app_shop_account"
;
//自研系统或第三方服务商系统内登陆的用户名
String
app_shop_accountname
=
"app_shop_accountname"
;
String
requestid
=
UUID
.
randomUUID
().
toString
();
TuangouReceiptConsumeRequest
request
=
new
TuangouReceiptConsumeRequest
(
APP_KEY
,
APP_SECRET
,
"session"
,
"requestid"
,
code
,
count
,
"open_shop_uuid"
,
"app_shop_account"
,
"app_shop_accountname"
);
requestid
,
code
,
count
,
OPEN_SHOP_UUID
,
app_shop_account
,
app_shop_accountname
);
DefaultOpenAPIClient
openAPIClient
=
new
DefaultOpenAPIClient
();
TuangouReceiptConsume
tuangouReceiptConsume
=
new
TuangouReceiptConsume
(
request
);
TuangouReceiptConsumeResponse
invoke
=
openAPIClient
.
invoke
(
tuangouReceiptConsume
);
...
...
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