fix(优惠券管理):优化优惠券管理功能模块保持代码风格统一
This commit is contained in:
@@ -91,3 +91,36 @@ CREATE INDEX idx_wechat_config_serial_number_2 ON wechat_config(serial_number);
|
|||||||
-- - 在微信支付回调时,通过此字段可以快速定位对应的配置信息
|
-- - 在微信支付回调时,通过此字段可以快速定位对应的配置信息
|
||||||
-- - 与回调请求头中的 Wechatpay-Serial 字段对应
|
-- - 与回调请求头中的 Wechatpay-Serial 字段对应
|
||||||
-- - 支持一个商户配置多个平台证书,通过序列号区分
|
-- - 支持一个商户配置多个平台证书,通过序列号区分
|
||||||
|
|
||||||
|
-- 创建优惠券表
|
||||||
|
CREATE TABLE IF NOT EXISTS `t_coupon` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||||
|
`coupon_no` varchar(64) NOT NULL COMMENT '优惠券编号',
|
||||||
|
`coupon_name` varchar(128) NOT NULL COMMENT '优惠券名称',
|
||||||
|
`coupon_type` int(11) NOT NULL COMMENT '优惠券类型:1-满减券,2-折扣券,3-免费券',
|
||||||
|
`amount` decimal(10,2) DEFAULT NULL COMMENT '优惠券面额',
|
||||||
|
`min_amount` decimal(10,2) DEFAULT NULL COMMENT '使用门槛金额',
|
||||||
|
`discount_rate` int(11) DEFAULT NULL COMMENT '折扣率(0-100,折扣券时使用)',
|
||||||
|
`status` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券状态:0-未使用,1-已使用,2-已过期,3-已作废',
|
||||||
|
`user_phone` varchar(20) NOT NULL COMMENT '用户手机号',
|
||||||
|
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||||
|
`source` int(11) NOT NULL DEFAULT '2' COMMENT '来源:1-携程,2-高飞自建',
|
||||||
|
`ctrip_coupon_id` varchar(64) DEFAULT NULL COMMENT '携程优惠券ID(来源为携程时使用)',
|
||||||
|
`valid_start_time` datetime NOT NULL COMMENT '有效期开始时间',
|
||||||
|
`valid_end_time` datetime NOT NULL COMMENT '有效期结束时间',
|
||||||
|
`used_time` datetime DEFAULT NULL COMMENT '使用时间',
|
||||||
|
`used_order_no` varchar(64) DEFAULT NULL COMMENT '使用订单号',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
|
||||||
|
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||||
|
`tenant_id` varchar(64) DEFAULT NULL COMMENT '租户ID',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_coupon_no` (`coupon_no`),
|
||||||
|
UNIQUE KEY `uk_ctrip_coupon_id` (`ctrip_coupon_id`),
|
||||||
|
KEY `idx_user_phone` (`user_phone`),
|
||||||
|
KEY `idx_status` (`status`),
|
||||||
|
KEY `idx_valid_end_time` (`valid_end_time`),
|
||||||
|
KEY `idx_create_time` (`create_time`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='优惠券表';
|
||||||
+39
-52
@@ -3,10 +3,13 @@ package com.central.order.controller;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.central.common.model.Result;
|
import com.central.common.model.Result;
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
import com.central.order.entity.Coupon;
|
import com.central.order.entity.Coupon;
|
||||||
import com.central.order.service.ICouponService;
|
import com.central.order.service.ICouponService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券管理控制器
|
* 优惠券管理控制器
|
||||||
@@ -29,37 +33,24 @@ public class CouponController {
|
|||||||
private ICouponService couponService;
|
private ICouponService couponService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询优惠券列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/page")
|
@Operation(summary = "查询列表")
|
||||||
@Operation(summary = "分页查询优惠券列表")
|
@Parameters({
|
||||||
public Result<IPage<Coupon>> getCouponPage(
|
@Parameter(name = "page",description = "分页起始位置",required = true,in=ParameterIn.QUERY),
|
||||||
@Parameter(description = "页码") @RequestParam(defaultValue = "1") Integer current,
|
@Parameter(name = "limit",description = "分页结束位置",required = true,in=ParameterIn.QUERY)
|
||||||
@Parameter(description = "每页大小") @RequestParam(defaultValue = "10") Integer size,
|
})
|
||||||
@Parameter(description = "优惠券名称") @RequestParam(required = false) String couponName,
|
@GetMapping
|
||||||
@Parameter(description = "优惠券类型") @RequestParam(required = false) Integer couponType,
|
public PageResult<Coupon> list(@RequestParam Map<String, Object> params) {
|
||||||
@Parameter(description = "状态") @RequestParam(required = false) Integer status,
|
return couponService.findList(params);
|
||||||
@Parameter(description = "用户手机号") @RequestParam(required = false) String userPhone,
|
|
||||||
@Parameter(description = "来源") @RequestParam(required = false) Integer source) {
|
|
||||||
|
|
||||||
Page<Coupon> page = new Page<>(current, size);
|
|
||||||
Coupon coupon = new Coupon();
|
|
||||||
coupon.setCouponName(couponName);
|
|
||||||
coupon.setCouponType(couponType);
|
|
||||||
coupon.setStatus(status);
|
|
||||||
coupon.setUserPhone(userPhone);
|
|
||||||
coupon.setSource(source);
|
|
||||||
|
|
||||||
IPage<Coupon> result = couponService.getCouponPage(page, coupon);
|
|
||||||
return Result.succeed(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询优惠券
|
* 根据ID查询优惠券
|
||||||
*/
|
*/
|
||||||
@GetMapping("/{id}")
|
|
||||||
@Operation(summary = "根据ID查询优惠券")
|
@Operation(summary = "根据ID查询优惠券")
|
||||||
public Result<Coupon> getCouponById(@Parameter(description = "优惠券ID") @PathVariable Long id) {
|
@GetMapping("/{id}")
|
||||||
|
public Result<Coupon> getCouponById(@PathVariable Long id) {
|
||||||
Coupon coupon = couponService.getById(id);
|
Coupon coupon = couponService.getById(id);
|
||||||
return Result.succeed(coupon);
|
return Result.succeed(coupon);
|
||||||
}
|
}
|
||||||
@@ -67,8 +58,8 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 创建优惠券
|
* 创建优惠券
|
||||||
*/
|
*/
|
||||||
@PostMapping
|
|
||||||
@Operation(summary = "创建优惠券")
|
@Operation(summary = "创建优惠券")
|
||||||
|
@PostMapping
|
||||||
public Result<Boolean> createCoupon(@RequestBody Coupon coupon) {
|
public Result<Boolean> createCoupon(@RequestBody Coupon coupon) {
|
||||||
boolean result = couponService.createCoupon(coupon);
|
boolean result = couponService.createCoupon(coupon);
|
||||||
return Result.succeed(result);
|
return Result.succeed(result);
|
||||||
@@ -77,9 +68,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 更新优惠券
|
* 更新优惠券
|
||||||
*/
|
*/
|
||||||
@PutMapping("/{id}")
|
|
||||||
@Operation(summary = "更新优惠券")
|
@Operation(summary = "更新优惠券")
|
||||||
public Result<Boolean> updateCoupon(@Parameter(description = "优惠券ID") @PathVariable Long id, @RequestBody Coupon coupon) {
|
@PutMapping("/{id}")
|
||||||
|
public Result<Boolean> updateCoupon(@PathVariable Long id, @RequestBody Coupon coupon) {
|
||||||
coupon.setId(id);
|
coupon.setId(id);
|
||||||
boolean result = couponService.updateCoupon(coupon);
|
boolean result = couponService.updateCoupon(coupon);
|
||||||
return Result.succeed(result);
|
return Result.succeed(result);
|
||||||
@@ -88,9 +79,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 删除优惠券
|
* 删除优惠券
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
@Operation(summary = "删除优惠券")
|
@Operation(summary = "删除优惠券")
|
||||||
public Result<Boolean> deleteCoupon(@Parameter(description = "优惠券ID") @PathVariable Long id) {
|
@DeleteMapping("/{id}")
|
||||||
|
public Result<Boolean> deleteCoupon(@PathVariable Long id) {
|
||||||
boolean result = couponService.deleteCoupon(id);
|
boolean result = couponService.deleteCoupon(id);
|
||||||
return Result.succeed(result);
|
return Result.succeed(result);
|
||||||
}
|
}
|
||||||
@@ -98,9 +89,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 根据手机号查询用户优惠券
|
* 根据手机号查询用户优惠券
|
||||||
*/
|
*/
|
||||||
@GetMapping("/user/{userPhone}")
|
|
||||||
@Operation(summary = "根据手机号查询用户优惠券")
|
@Operation(summary = "根据手机号查询用户优惠券")
|
||||||
public Result<List<Coupon>> getCouponsByUserPhone(@Parameter(description = "用户手机号") @PathVariable String userPhone) {
|
@GetMapping("/user/{userPhone}")
|
||||||
|
public Result<List<Coupon>> getCouponsByUserPhone(@PathVariable String userPhone) {
|
||||||
List<Coupon> coupons = couponService.getCouponsByUserPhone(userPhone);
|
List<Coupon> coupons = couponService.getCouponsByUserPhone(userPhone);
|
||||||
return Result.succeed(coupons);
|
return Result.succeed(coupons);
|
||||||
}
|
}
|
||||||
@@ -108,9 +99,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 根据手机号查询可用优惠券
|
* 根据手机号查询可用优惠券
|
||||||
*/
|
*/
|
||||||
@GetMapping("/user/{userPhone}/available")
|
|
||||||
@Operation(summary = "根据手机号查询可用优惠券")
|
@Operation(summary = "根据手机号查询可用优惠券")
|
||||||
public Result<List<Coupon>> getAvailableCouponsByUserPhone(@Parameter(description = "用户手机号") @PathVariable String userPhone) {
|
@GetMapping("/user/{userPhone}/available")
|
||||||
|
public Result<List<Coupon>> getAvailableCouponsByUserPhone(@PathVariable String userPhone) {
|
||||||
List<Coupon> coupons = couponService.getAvailableCouponsByUserPhone(userPhone);
|
List<Coupon> coupons = couponService.getAvailableCouponsByUserPhone(userPhone);
|
||||||
return Result.succeed(coupons);
|
return Result.succeed(coupons);
|
||||||
}
|
}
|
||||||
@@ -118,11 +109,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 使用优惠券
|
* 使用优惠券
|
||||||
*/
|
*/
|
||||||
@PostMapping("/{id}/use")
|
|
||||||
@Operation(summary = "使用优惠券")
|
@Operation(summary = "使用优惠券")
|
||||||
public Result<Boolean> useCoupon(
|
@PostMapping("/{id}/use")
|
||||||
@Parameter(description = "优惠券ID") @PathVariable Long id,
|
public Result<Boolean> useCoupon(@PathVariable Long id, @RequestParam String orderNo) {
|
||||||
@Parameter(description = "订单号") @RequestParam String orderNo) {
|
|
||||||
boolean result = couponService.useCoupon(id, orderNo);
|
boolean result = couponService.useCoupon(id, orderNo);
|
||||||
return Result.succeed(result);
|
return Result.succeed(result);
|
||||||
}
|
}
|
||||||
@@ -130,18 +119,18 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 携程创建优惠券接口
|
* 携程创建优惠券接口
|
||||||
*/
|
*/
|
||||||
@PostMapping("/ctrip/create")
|
|
||||||
@Operation(summary = "携程创建优惠券接口")
|
@Operation(summary = "携程创建优惠券接口")
|
||||||
|
@PostMapping("/ctrip/create")
|
||||||
public Result<Boolean> createCouponFromCtrip(
|
public Result<Boolean> createCouponFromCtrip(
|
||||||
@Parameter(description = "携程优惠券ID") @RequestParam String ctripCouponId,
|
@RequestParam String ctripCouponId,
|
||||||
@Parameter(description = "用户手机号") @RequestParam String userPhone,
|
@RequestParam String userPhone,
|
||||||
@Parameter(description = "优惠券名称") @RequestParam String couponName,
|
@RequestParam String couponName,
|
||||||
@Parameter(description = "优惠券类型") @RequestParam Integer couponType,
|
@RequestParam Integer couponType,
|
||||||
@Parameter(description = "优惠券面额") @RequestParam BigDecimal amount,
|
@RequestParam BigDecimal amount,
|
||||||
@Parameter(description = "使用门槛金额") @RequestParam(required = false) BigDecimal minAmount,
|
@RequestParam(required = false) BigDecimal minAmount,
|
||||||
@Parameter(description = "折扣率") @RequestParam(required = false) Integer discountRate,
|
@RequestParam(required = false) Integer discountRate,
|
||||||
@Parameter(description = "有效期开始时间") @RequestParam String validStartTime,
|
@RequestParam String validStartTime,
|
||||||
@Parameter(description = "有效期结束时间") @RequestParam String validEndTime) {
|
@RequestParam String validEndTime) {
|
||||||
|
|
||||||
// 这里需要根据实际的时间格式进行解析
|
// 这里需要根据实际的时间格式进行解析
|
||||||
// 暂时使用当前时间,实际应该解析传入的时间字符串
|
// 暂时使用当前时间,实际应该解析传入的时间字符串
|
||||||
@@ -157,11 +146,9 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 核销携程优惠券
|
* 核销携程优惠券
|
||||||
*/
|
*/
|
||||||
@PostMapping("/ctrip/verify")
|
|
||||||
@Operation(summary = "核销携程优惠券")
|
@Operation(summary = "核销携程优惠券")
|
||||||
public Result<Boolean> verifyCtripCoupon(
|
@PostMapping("/ctrip/verify")
|
||||||
@Parameter(description = "携程优惠券ID") @RequestParam String ctripCouponId,
|
public Result<Boolean> verifyCtripCoupon(@RequestParam String ctripCouponId, @RequestParam String orderNo) {
|
||||||
@Parameter(description = "订单号") @RequestParam String orderNo) {
|
|
||||||
boolean result = couponService.verifyCtripCoupon(ctripCouponId, orderNo);
|
boolean result = couponService.verifyCtripCoupon(ctripCouponId, orderNo);
|
||||||
return Result.succeed(result);
|
return Result.succeed(result);
|
||||||
}
|
}
|
||||||
@@ -169,8 +156,8 @@ public class CouponController {
|
|||||||
/**
|
/**
|
||||||
* 批量更新过期优惠券
|
* 批量更新过期优惠券
|
||||||
*/
|
*/
|
||||||
@PostMapping("/update-expired")
|
|
||||||
@Operation(summary = "批量更新过期优惠券")
|
@Operation(summary = "批量更新过期优惠券")
|
||||||
|
@PostMapping("/update-expired")
|
||||||
public Result<Void> updateExpiredCoupons() {
|
public Result<Void> updateExpiredCoupons() {
|
||||||
couponService.updateExpiredCoupons();
|
couponService.updateExpiredCoupons();
|
||||||
return Result.succeed("批量更新过期优惠券成功");
|
return Result.succeed("批量更新过期优惠券成功");
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.central.order.entity.Coupon;
|
import com.central.order.entity.Coupon;
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券服务接口
|
* 优惠券服务接口
|
||||||
@@ -17,6 +19,11 @@ public interface ICouponService extends IService<Coupon> {
|
|||||||
*/
|
*/
|
||||||
IPage<Coupon> getCouponPage(Page<Coupon> page, Coupon coupon);
|
IPage<Coupon> getCouponPage(Page<Coupon> page, Coupon coupon);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询优惠券列表(统一风格)
|
||||||
|
*/
|
||||||
|
PageResult<Coupon> findList(Map<String, Object> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建优惠券
|
* 创建优惠券
|
||||||
*/
|
*/
|
||||||
|
|||||||
+41
@@ -8,6 +8,7 @@ import com.central.order.entity.Coupon;
|
|||||||
import com.central.order.mapper.CouponMapper;
|
import com.central.order.mapper.CouponMapper;
|
||||||
import com.central.order.service.ICouponService;
|
import com.central.order.service.ICouponService;
|
||||||
import com.central.order.service.ICtripApiService;
|
import com.central.order.service.ICtripApiService;
|
||||||
|
import com.central.common.model.PageResult;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -16,6 +17,7 @@ import org.springframework.util.StringUtils;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,6 +35,45 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|||||||
return baseMapper.selectCouponPage(page, coupon);
|
return baseMapper.selectCouponPage(page, coupon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Coupon> findList(Map<String, Object> params) {
|
||||||
|
// 获取分页参数
|
||||||
|
Integer page = Integer.parseInt(params.getOrDefault("page", "1").toString());
|
||||||
|
Integer limit = Integer.parseInt(params.getOrDefault("limit", "10").toString());
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
Coupon queryCoupon = new Coupon();
|
||||||
|
if (params.get("couponName") != null) {
|
||||||
|
queryCoupon.setCouponName(params.get("couponName").toString());
|
||||||
|
}
|
||||||
|
if (params.get("couponType") != null) {
|
||||||
|
queryCoupon.setCouponType(Integer.parseInt(params.get("couponType").toString()));
|
||||||
|
}
|
||||||
|
if (params.get("status") != null) {
|
||||||
|
queryCoupon.setStatus(Integer.parseInt(params.get("status").toString()));
|
||||||
|
}
|
||||||
|
if (params.get("userPhone") != null) {
|
||||||
|
queryCoupon.setUserPhone(params.get("userPhone").toString());
|
||||||
|
}
|
||||||
|
if (params.get("source") != null) {
|
||||||
|
queryCoupon.setSource(Integer.parseInt(params.get("source").toString()));
|
||||||
|
}
|
||||||
|
if (params.get("ctripCouponId") != null) {
|
||||||
|
queryCoupon.setCtripCouponId(params.get("ctripCouponId").toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行分页查询
|
||||||
|
Page<Coupon> pageParam = new Page<>(page, limit);
|
||||||
|
IPage<Coupon> pageResult = baseMapper.selectCouponPage(pageParam, queryCoupon);
|
||||||
|
|
||||||
|
// 构建返回结果
|
||||||
|
return PageResult.<Coupon>builder()
|
||||||
|
.count(pageResult.getTotal())
|
||||||
|
.resp_code(0)
|
||||||
|
.data(pageResult.getRecords())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean createCoupon(Coupon coupon) {
|
public boolean createCoupon(Coupon coupon) {
|
||||||
|
|||||||
@@ -342,11 +342,11 @@ export async function getWxMessageStatistics(params: {
|
|||||||
// 优惠券相关接口
|
// 优惠券相关接口
|
||||||
export async function getCouponList(params?: { [key: string]: string | number }) {
|
export async function getCouponList(params?: { [key: string]: string | number }) {
|
||||||
const { current, pageSize, ...rest } = params ?? {};
|
const { current, pageSize, ...rest } = params ?? {};
|
||||||
const result = await request<SYSTEM.Page<ORDERS.Coupon>>('/api-order/coupon/page', {
|
const result = await request<SYSTEM.Page<ORDERS.Coupon>>('/api-order/coupon', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { current, size: pageSize, ...rest },
|
params: { page: current, limit: pageSize, ...rest },
|
||||||
});
|
});
|
||||||
return { data: result.data, total: result.total };
|
return { data: result.data, total: result.count };
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCouponById(id: number) {
|
export async function getCouponById(id: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user