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
Show 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
;
package
share
.
web
.
controller
.
system
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -8,6 +9,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -8,6 +9,8 @@ import org.springframework.web.bind.annotation.RestController;
import
share.common.core.domain.R
;
import
share.common.core.domain.R
;
import
share.system.service.QPService
;
import
share.system.service.QPService
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
"/front/chessCards"
)
@RequestMapping
(
"/front/chessCards"
)
@Api
(
tags
=
"首页-验券"
)
@Api
(
tags
=
"首页-验券"
)
...
@@ -17,37 +20,49 @@ public class QPController {
...
@@ -17,37 +20,49 @@ public class QPController {
//输码验券校验接口
//输码验券校验接口
@GetMapping
(
"/prepare"
)
@GetMapping
(
"/prepare"
)
public
R
prepare
(
String
code
)
{
public
R
<
TuangouReceiptPrepareResponseEntity
>
prepare
(
String
code
)
{
return
R
.
ok
(
qpService
.
prepare
(
code
));
return
R
.
ok
(
qpService
.
prepare
(
code
));
}
}
//验券接口
//验券接口
@GetMapping
(
"/consume"
)
@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
));
return
R
.
ok
(
qpService
.
consume
(
code
,
count
));
}
}
//撤销验券接口
//撤销验券接口
@GetMapping
(
"/reverseconsume"
)
@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
));
return
R
.
ok
(
qpService
.
reverseconsume
(
code
,
appDealId
));
}
}
//查询已验券信息接口
//查询已验券信息接口
@GetMapping
(
"/getconsumed"
)
@GetMapping
(
"/getconsumed"
)
public
R
getconsumed
(
String
code
)
{
public
R
<
TuangouReceiptGetConsumedReponseEntity
>
getconsumed
(
String
code
)
{
return
R
.
ok
(
qpService
.
getconsumed
(
code
));
return
R
.
ok
(
qpService
.
getconsumed
(
code
));
}
}
//用户验券接口
//用户验券接口
@GetMapping
(
"/consumeByUser"
)
@GetMapping
(
"/consumeByUser"
)
public
R
consumeByUser
(
String
code
,
int
count
)
{
public
R
<
String
>
consumeByUser
(
String
code
,
int
count
)
{
return
R
.
ok
(
qpService
.
consumeByUser
(
code
,
count
));
return
R
.
ok
(
qpService
.
consumeByUser
(
code
,
count
));
}
}
//用户销券接口
//用户销券接口
@GetMapping
(
"/reverseconsumeByUser"
)
@GetMapping
(
"/reverseconsumeByUser"
)
public
R
reverseconsumeByUser
(
Long
id
)
{
public
R
<
String
>
reverseconsumeByUser
(
Long
id
)
{
return
R
.
ok
(
qpService
.
reverseconsumeByUser
(
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
;
package
share
.
system
.
service
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptConsumeResponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
share.common.core.domain.R
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptPrepareResponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptReverseConsumeResponseEntity
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,4 +17,8 @@ public interface QPService {
...
@@ -19,4 +17,8 @@ public interface QPService {
String
consumeByUser
(
String
code
,
int
count
);
String
consumeByUser
(
String
code
,
int
count
);
String
reverseconsumeByUser
(
Long
id
);
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 {
...
@@ -126,9 +126,14 @@ public class QPServiceImpl implements QPService {
*/
*/
@Override
@Override
public
List
<
TuangouReceiptConsumeResponseEntity
>
consume
(
String
code
,
int
count
)
{
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"
,
TuangouReceiptConsumeRequest
request
=
new
TuangouReceiptConsumeRequest
(
APP_KEY
,
APP_SECRET
,
"session"
,
"requestid"
,
code
,
count
,
"open_shop_uuid"
,
requestid
,
code
,
count
,
OPEN_SHOP_UUID
,
"app_shop_account"
,
"app_shop_accountname"
);
app_shop_account
,
app_shop_accountname
);
DefaultOpenAPIClient
openAPIClient
=
new
DefaultOpenAPIClient
();
DefaultOpenAPIClient
openAPIClient
=
new
DefaultOpenAPIClient
();
TuangouReceiptConsume
tuangouReceiptConsume
=
new
TuangouReceiptConsume
(
request
);
TuangouReceiptConsume
tuangouReceiptConsume
=
new
TuangouReceiptConsume
(
request
);
TuangouReceiptConsumeResponse
invoke
=
openAPIClient
.
invoke
(
tuangouReceiptConsume
);
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