Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
b2b6fa28
Commit
b2b6fa28
authored
May 09, 2019
by
Junling Bu
Browse files
chore[litemall-wx, litemall-wx-api]: 优惠券API调整及文档
parent
c9efb0de
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
doc/api.md
View file @
b2b6fa28
This diff is collapsed.
Click to expand it.
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponService.java
View file @
b2b6fa28
...
...
@@ -56,12 +56,6 @@ public class LitemallCouponService {
return
couponMapper
.
selectByExampleSelective
(
criteria
.
example
(),
result
);
}
public
int
queryTotal
()
{
LitemallCouponExample
example
=
new
LitemallCouponExample
();
example
.
or
().
andTypeEqualTo
(
CouponConstant
.
TYPE_COMMON
).
andStatusEqualTo
(
CouponConstant
.
STATUS_NORMAL
).
andDeletedEqualTo
(
false
);
return
(
int
)
couponMapper
.
countByExample
(
example
);
}
public
List
<
LitemallCoupon
>
queryAvailableList
(
Integer
userId
,
int
offset
,
int
limit
)
{
assert
userId
!=
null
;
// 过滤掉登录账号已经领取过的coupon
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java
View file @
b2b6fa28
...
...
@@ -63,11 +63,7 @@ public class WxCouponController {
@Order
@RequestParam
(
defaultValue
=
"desc"
)
String
order
)
{
List
<
LitemallCoupon
>
couponList
=
couponService
.
queryList
(
page
,
limit
,
sort
,
order
);
int
total
=
couponService
.
queryTotal
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"data"
,
couponList
);
data
.
put
(
"count"
,
total
);
return
ResponseUtil
.
ok
(
data
);
return
ResponseUtil
.
okList
(
couponList
);
}
/**
...
...
@@ -94,11 +90,7 @@ public class WxCouponController {
List
<
LitemallCouponUser
>
couponUserList
=
couponUserService
.
queryList
(
userId
,
null
,
status
,
page
,
limit
,
sort
,
order
);
List
<
CouponVo
>
couponVoList
=
change
(
couponUserList
);
int
total
=
couponService
.
queryTotal
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"data"
,
couponVoList
);
data
.
put
(
"count"
,
total
);
return
ResponseUtil
.
ok
(
data
);
return
ResponseUtil
.
okList
(
couponVoList
,
couponUserList
);
}
private
List
<
CouponVo
>
change
(
List
<
LitemallCouponUser
>
couponList
)
{
...
...
@@ -179,7 +171,7 @@ public class WxCouponController {
List
<
CouponVo
>
couponVoList
=
change
(
availableCouponUserList
);
return
ResponseUtil
.
ok
(
couponVoList
);
return
ResponseUtil
.
ok
List
(
couponVoList
);
}
/**
...
...
litemall-wx/pages/coupon/coupon.js
View file @
b2b6fa28
...
...
@@ -92,9 +92,9 @@ Page({
that
.
setData
({
scrollTop
:
0
,
couponList
:
res
.
data
.
data
,
couponList
:
res
.
data
.
list
,
showPage
:
true
,
count
:
res
.
data
.
count
count
:
res
.
data
.
total
});
}
wx
.
hideToast
();
...
...
litemall-wx/pages/ucenter/couponList/couponList.js
View file @
b2b6fa28
...
...
@@ -88,9 +88,9 @@ Page({
that
.
setData
({
scrollTop
:
0
,
couponList
:
res
.
data
.
data
,
couponList
:
res
.
data
.
list
,
showPage
:
true
,
count
:
res
.
data
.
count
count
:
res
.
data
.
total
});
}
});
...
...
litemall-wx/pages/ucenter/couponSelect/couponSelect.js
View file @
b2b6fa28
...
...
@@ -117,7 +117,7 @@ Page({
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
couponList
:
res
.
data
couponList
:
res
.
data
.
list
});
}
wx
.
hideToast
();
...
...
Write
Preview
Supports
Markdown
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