|
@@ -1,6 +1,5 @@
|
|
|
package org.linlinjava.litemall.admin.web;
|
|
package org.linlinjava.litemall.admin.web;
|
|
|
|
|
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
@@ -19,9 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/admin/coupon")
|
|
@RequestMapping("/admin/coupon")
|
|
@@ -43,12 +40,7 @@ public class AdminCouponController {
|
|
|
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
|
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
|
|
@Order @RequestParam(defaultValue = "desc") String order) {
|
|
@Order @RequestParam(defaultValue = "desc") String order) {
|
|
|
List<LitemallCoupon> couponList = couponService.querySelective(name, type, status, page, limit, sort, order);
|
|
List<LitemallCoupon> couponList = couponService.querySelective(name, type, status, page, limit, sort, order);
|
|
|
- long total = PageInfo.of(couponList).getTotal();
|
|
|
|
|
- Map<String, Object> data = new HashMap<>();
|
|
|
|
|
- data.put("total", total);
|
|
|
|
|
- data.put("items", couponList);
|
|
|
|
|
-
|
|
|
|
|
- return ResponseUtil.ok(data);
|
|
|
|
|
|
|
+ return ResponseUtil.okList(couponList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequiresPermissions("admin:coupon:listuser")
|
|
@RequiresPermissions("admin:coupon:listuser")
|
|
@@ -60,12 +52,7 @@ public class AdminCouponController {
|
|
|
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
|
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
|
|
@Order @RequestParam(defaultValue = "desc") String order) {
|
|
@Order @RequestParam(defaultValue = "desc") String order) {
|
|
|
List<LitemallCouponUser> couponList = couponUserService.queryList(userId, couponId, status, page, limit, sort, order);
|
|
List<LitemallCouponUser> couponList = couponUserService.queryList(userId, couponId, status, page, limit, sort, order);
|
|
|
- long total = PageInfo.of(couponList).getTotal();
|
|
|
|
|
- Map<String, Object> data = new HashMap<>();
|
|
|
|
|
- data.put("total", total);
|
|
|
|
|
- data.put("items", couponList);
|
|
|
|
|
-
|
|
|
|
|
- return ResponseUtil.ok(data);
|
|
|
|
|
|
|
+ return ResponseUtil.okList(couponList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Object validate(LitemallCoupon coupon) {
|
|
private Object validate(LitemallCoupon coupon) {
|