Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_vip
Commits
bdd06ccf
Commit
bdd06ccf
authored
Apr 12, 2018
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加对卡券核销请求的分发处理
parent
f821c854
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
14 deletions
+54
-14
fmp_vip_server.cpp
+0
-1
fmvipdispatcher.cpp
+36
-1
global.h
+18
-12
No files found.
fmp_vip_server.cpp
View file @
bdd06ccf
...
...
@@ -56,7 +56,6 @@ void FMPVipServer::onReadyRead()
dispatcher
->
doTask
(
recvData
,
rspData
);
if
(
socket
->
isValid
()){
rspData
;
Write
(
rspData
);
}
else
{
...
...
fmvipdispatcher.cpp
View file @
bdd06ccf
...
...
@@ -14,7 +14,7 @@
#include "taskfinal.h"
#undef StartService
#include <fmp_epay_i.h>
#include "fmp_coupon_i.h"
FMVipDispatcher
::
FMVipDispatcher
(
QObject
*
parent
)
:
QObject
(
parent
),
...
...
@@ -78,6 +78,41 @@ void FMVipDispatcher::doTask(const QByteArray &reqData, QByteArray &rspData)
rspData
=
taskFinal
.
doTask
();
break
;
}
case
FM_Update_Store_Info
:{
FMPCouponInterface
*
coupon
=
FMP
::
GetService
<
FMPCouponInterface
>
();
coupon
->
StartService
();
QJsonObject
obj
=
coupon
->
UpdateStoreInfo
(
jsonObj
);
rspData
=
QJsonDocument
(
obj
).
toJson
(
QJsonDocument
::
Compact
);
break
;
}
case
FM_Coupon_Check
:{
FMPCouponInterface
*
coupon
=
FMP
::
GetService
<
FMPCouponInterface
>
();
coupon
->
StartService
();
QJsonObject
obj
=
coupon
->
VoucherCheck
(
jsonObj
);
rspData
=
QJsonDocument
(
obj
).
toJson
(
QJsonDocument
::
Compact
);
break
;
}
case
FM_Favors_Calculate
:{
FMPCouponInterface
*
coupon
=
FMP
::
GetService
<
FMPCouponInterface
>
();
coupon
->
StartService
();
QJsonObject
obj
=
coupon
->
VoucherFavorsCalculate
(
jsonObj
);
rspData
=
QJsonDocument
(
obj
).
toJson
(
QJsonDocument
::
Compact
);
break
;
}
case
FM_Voucher_Verification
:{
FMPCouponInterface
*
coupon
=
FMP
::
GetService
<
FMPCouponInterface
>
();
coupon
->
StartService
();
QJsonObject
obj
=
coupon
->
VoucherVerification
(
jsonObj
);
rspData
=
QJsonDocument
(
obj
).
toJson
(
QJsonDocument
::
Compact
);
break
;
}
case
FM_Voucher_Cancel
:{
FMPCouponInterface
*
coupon
=
FMP
::
GetService
<
FMPCouponInterface
>
();
coupon
->
StartService
();
QJsonObject
obj
=
coupon
->
VoucherCancel
(
jsonObj
);
rspData
=
QJsonDocument
(
obj
).
toJson
(
QJsonDocument
::
Compact
);
break
;
}
default
:
rspData
=
QString
::
fromLocal8Bit
(
"{
\"
msg:
\"
:
\"
未知的请求类型
\"
}"
).
toUtf8
();
break
;
...
...
global.h
View file @
bdd06ccf
...
...
@@ -11,6 +11,11 @@
// 请求类型的枚举值
enum
FM_TYPE
{
FM_Update_Store_Info
=
1000
,
FM_Coupon_Check
=
10039
,
FM_Favors_Calculate
=
10040
,
FM_Voucher_Verification
=
10032
,
FM_Voucher_Cancel
=
10033
,
FM_Login
=
1001
,
FM_Pay
=
1003
,
FM_Order_Refund
,
...
...
@@ -203,20 +208,21 @@ const PropsMap::value_type PropsMapPairs[] =
};
static
PropsMap
PosToServerProps
(
PropsMapPairs
,
PropsMapPairs
+
(
sizeof
(
PropsMapPairs
)
/
sizeof
(
PropsMapPairs
[
0
])));
class
FMPropsMap
{
public
:
static
QString
get
(
QString
posProp
)
{
PropsMap
::
iterator
it
=
PosToServerProps
.
find
(
posProp
);
if
(
it
!=
PosToServerProps
.
end
())
{
return
it
->
second
;
}
return
posProp
;
}
};
//
class FMPropsMap
//
{
//
public:
//
static QString get(QString posProp) {
//
PropsMap::iterator it = PosToServerProps.find(posProp);
//
if(it != PosToServerProps.end()) {
//
return it->second;
//
}
//
return posProp;
//
}
//
};
#endif
#define ServerProps(posProp) FMPropsMap::get(posProp)
// #define ServerProps(posProp) FMPropsMap::get(posProp)
#define ServerProps(posProp) PosToServerProps.find(posProp) == PosToServerProps.end() ? posProp : PosToServerProps[posProp]
// 签名字段
const
static
QString
SignProps
[]
=
{
...
...
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