后端:优惠劵 rpc api 的设计
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package cn.iocoder.mall.promotion.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCardBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCardTemplatePageBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCodeTemplateBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCodeTemplatePageBO;
|
||||
import cn.iocoder.mall.promotion.api.dto.*;
|
||||
|
||||
public interface CouponService {
|
||||
|
||||
// ========== 优惠劵(码)模板 ==========
|
||||
|
||||
CommonResult<CouponCodeTemplatePageBO> getCouponCodeTemplatePage(CouponCodeTemplatePageDTO couponCodeTemplatePageDTO);
|
||||
|
||||
CommonResult<CouponCardTemplatePageBO> getCouponCardTemplatePage(CouponCardTemplatePageDTO couponCardTemplatePageDTO);
|
||||
|
||||
/**
|
||||
* 创建优惠码模板
|
||||
*
|
||||
* @param couponCodeTemplateAddDTO 优惠码模板添加 DTO
|
||||
* @return 优惠码模板
|
||||
*/
|
||||
CommonResult<CouponCodeTemplateBO> addCouponCodeTemplate(CouponCodeTemplateAddDTO couponCodeTemplateAddDTO);
|
||||
|
||||
/**
|
||||
* 创建优惠劵模板
|
||||
*
|
||||
* @param couponCardTemplateAddDTO 优惠码模板添加 DTO
|
||||
* @return 优惠劵模板
|
||||
*/
|
||||
CommonResult<CouponCodeTemplateBO> addCouponCardTemplate(CouponCardTemplateAddDTO couponCardTemplateAddDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠码模板
|
||||
*
|
||||
* @param couponCodeTemplateUpdateDTO 优惠码模板修改 DTO
|
||||
* @return 是否成功
|
||||
*/
|
||||
CommonResult<Boolean> updateCouponCodeTemplate(CouponCodeTemplateUpdateDTO couponCodeTemplateUpdateDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠劵模板
|
||||
*
|
||||
* @param couponCardTemplateUpdateDTO 优惠劵模板修改 DTO
|
||||
* @return 是否成功
|
||||
*/
|
||||
CommonResult<Boolean> updateCouponCardTemplate(CouponCardTemplateUpdateDTO couponCardTemplateUpdateDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠劵(码)模板的状态
|
||||
*
|
||||
* @param adminId 操作管理员编号
|
||||
* @param couponTemplateId 模板编号
|
||||
* @param status 状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
CommonResult<Boolean> updateCouponTemplateStatus(Integer adminId, Integer couponTemplateId, Integer status);
|
||||
|
||||
// ========== 优惠劵 ==========
|
||||
|
||||
/**
|
||||
* 基于优惠劵模板,领取优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponTemplateId 优惠劵模板
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CommonResult<CouponCardBO> addCouponCard(Integer userId, Integer couponTemplateId);
|
||||
|
||||
/**
|
||||
* 使用优惠劵下单
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponCardId 优惠劵编号
|
||||
* @param usedOrderId 下单的编号
|
||||
* @param usedPrice 下单的价格
|
||||
* @return 是否成功
|
||||
*/
|
||||
CommonResult<Boolean> useCouponCard(Integer userId, Integer couponCardId, Integer usedOrderId, Integer usedPrice);
|
||||
|
||||
/**
|
||||
* 取消优惠劵的使用
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param couponCardId 优惠劵编号
|
||||
* @return 是否成功
|
||||
*/
|
||||
CommonResult<Boolean> cancelUseCouponCard(Integer userId, Integer couponCardId);
|
||||
|
||||
// ========== 优惠码 ==========
|
||||
|
||||
/**
|
||||
* 使用优惠码,兑换优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param code 优惠码
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CommonResult<CouponCardBO> useCouponCode(Integer userId, String code);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardBO {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardTemplateBO {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardTemplatePageBO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCodeTemplateBO {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCodeTemplatePageBO {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCardTemplateAddDTO {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
/**
|
||||
* 优惠劵模板分页 DTO
|
||||
*/
|
||||
public class CouponCardTemplatePageDTO {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCardTemplateUpdateDTO {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCodeTemplateAddDTO {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
/**
|
||||
* 优惠码模板分页 DTO
|
||||
*/
|
||||
public class CouponCodeTemplatePageDTO {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCodeTemplateUpdateDTO {
|
||||
}
|
||||
Reference in New Issue
Block a user