release- 苹果支付和微信支付

release-2024-04-25
huangyw 2 months ago
parent 29e3a04615
commit 51b380824a

@ -18,6 +18,15 @@ public enum MembershipEnums {
DISCARD(4, "已废弃"), DISCARD(4, "已废弃"),
WX_PAY(1, "微信支付"),
ALI_PAY(2, "支付宝支付"),
MEMBERSHIP_CODE(3, "会员码兑换"),
APPLE_PAY(4, "苹果支付"),
WAIT_PAY(0, "待支付"),
PAY_SUCCESS(1, "支付成功"),
PAY_FAIL(2, "支付失败"),

@ -5,6 +5,7 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.luoo.user.pojo.AppleOrder; import com.luoo.user.pojo.AppleOrder;
import com.luoo.user.pojo.AppleResponse; import com.luoo.user.pojo.AppleResponse;
import com.luoo.user.service.MemberShipService;
import com.luoo.user.util.IosVerifyUtil; import com.luoo.user.util.IosVerifyUtil;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -62,6 +63,9 @@ public class ApplePayController {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
} }
}; };
@Autowired
private MemberShipService memberShipService;
/** /**
* APP * APP
* *
@ -153,26 +157,7 @@ public class ApplePayController {
String quantity = appleOrder.getQuantity(); String quantity = appleOrder.getQuantity();
// 获取用户购买的产品Id // 获取用户购买的产品Id
String product_id = appleOrder.getProduct_id(); String product_id = appleOrder.getProduct_id();
switch (product_id) { memberShipService.applePayMembershipOrder(product_id, userId);
case "cn.luoo.IndieMusic.annual": {
// 年度会员 逻辑从这开始
System.out.println("appleIAP 年度会员 逻辑从这开始,userid___" +userId);
//这里拿到userId,在我们自己的订单逻辑里插一条订单记录,给用户开通相应的会员
userId="";
break;
}
case "cn.luoo.IndieMusic.monthly": {
// 月度会员逻辑从这开始
System.out.println("appleIAP 月度会员 逻辑从这开始,userid___"+userId);;
break;
}
case "cn.luoo.IndieMusic.lifetime": {
// 终身会员逻辑从这开始
System.out.println("appleIAP 终身会员 逻辑从这开始,userid___"+userId);
break;
}
}
log.info("{}发送奖励成功喽!",userId); log.info("{}发送奖励成功喽!",userId);
} }
} }

@ -5,6 +5,7 @@ import api.PageResult;
import api.Result; import api.Result;
import com.luoo.user.dto.memberShip.MembershipCodeSearchDto; import com.luoo.user.dto.memberShip.MembershipCodeSearchDto;
import com.luoo.user.pojo.MembershipCode; import com.luoo.user.pojo.MembershipCode;
import com.luoo.user.service.MemberShipService;
import com.luoo.user.service.MembershipCodeService; import com.luoo.user.service.MembershipCodeService;
import controller.BaseController; import controller.BaseController;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ -37,6 +38,9 @@ public class MembershipController extends BaseController {
@Autowired @Autowired
private MembershipCodeService membershipCodeService; private MembershipCodeService membershipCodeService;
@Autowired
private MemberShipService memberShipService;
@ApiOperation(value = "1.生成会员码", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.生成会员码", notes = "仅限admin权限用户调用")
@GetMapping("/code/generate") @GetMapping("/code/generate")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ -119,4 +123,16 @@ public class MembershipController extends BaseController {
return Result.success(); return Result.success();
} }
@ApiOperation(value = "6.会员购买", notes = "仅限app用户调用-获取微信预支付id")
@PostMapping("/prepay")
@GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "skuId", value = "会员skuId", required = true, dataType = "String", paramType = "query")
})
public Result<Object> prepay(
@RequestHeader(value = "Authorization", required = true) String authorization,
@NotNull String skuId) {
return Result.success(memberShipService.prepay(skuId));
}
} }

@ -6,6 +6,7 @@ import com.ijpay.core.kit.WxPayKit;
import com.luoo.user.config.WxPayConfig; import com.luoo.user.config.WxPayConfig;
import com.luoo.user.config.WxPayNotificationConfig; import com.luoo.user.config.WxPayNotificationConfig;
import com.luoo.user.config.WxPayPublicKeyConfig; import com.luoo.user.config.WxPayPublicKeyConfig;
import com.luoo.user.service.MemberShipService;
import com.luoo.user.service.WxPayApiV3Service; import com.luoo.user.service.WxPayApiV3Service;
import com.wechat.pay.java.core.Config; import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAAutoCertificateConfig; import com.wechat.pay.java.core.RSAAutoCertificateConfig;
@ -41,7 +42,6 @@ public class WeChatApiV3PayController extends BaseController {
// public static AppService service; // public static AppService service;
@Autowired @Autowired
private WxPayNotificationConfig wxPayNotificationConfig; private WxPayNotificationConfig wxPayNotificationConfig;
@ -52,36 +52,39 @@ public class WeChatApiV3PayController extends BaseController {
@Autowired @Autowired
private WxPayApiV3Service wxPayApiV3Service; private WxPayApiV3Service wxPayApiV3Service;
// 下单接口 @Autowired
@GetMapping("/appPay") private MemberShipService memberShipService;
public Result<Object> appPay() {
try {
PrepayResponse response = wxPayApiV3Service.prepay();
Map<String, String> map = WxPayKit.appCreateSign(wxPayConfig.getAppId(), wxPayConfig.getMchId(), response.getPrepayId(), wxPayConfig.getPrivateKeyPath());
return Result.success(map);
} catch (HttpException e) { // 发送HTTP请求失败
// 调用e.getHttpRequest()获取请求打印日志或上报监控更多方法见HttpException定义
e.getHttpRequest();
System.out.println( e.getHttpRequest());
} catch (ServiceException e) { // 服务返回状态小于200或大于等于300例如500
// 调用e.getResponseBody()获取返回体打印日志或上报监控更多方法见ServiceException定义
e.getResponseBody();
System.out.println(e.getResponseBody());
} catch (MalformedMessageException e) { // 服务返回成功,返回体类型不合法,或者解析返回体失败
// 调用e.getMessage()获取信息打印日志或上报监控更多方法见MalformedMessageException定义
e.getMessage();
System.out.println(e.getMessage());
} catch (Exception e) {
throw new RuntimeException(e);
}
return Result.success(""); // 下单接口
} // @GetMapping("/appPay")
// public Result<Object> appPay() {
//
//
// try {
//
// PrepayResponse response = wxPayApiV3Service.prepay();
//
//
// Map<String, String> map = WxPayKit.appCreateSign(wxPayConfig.getAppId(), wxPayConfig.getMchId(), response.getPrepayId(), wxPayConfig.getPrivateKeyPath());
// return Result.success(map);
// } catch (HttpException e) { // 发送HTTP请求失败
// // 调用e.getHttpRequest()获取请求打印日志或上报监控更多方法见HttpException定义
// e.getHttpRequest();
// System.out.println(e.getHttpRequest());
// } catch (ServiceException e) { // 服务返回状态小于200或大于等于300例如500
// // 调用e.getResponseBody()获取返回体打印日志或上报监控更多方法见ServiceException定义
// e.getResponseBody();
// System.out.println(e.getResponseBody());
// } catch (MalformedMessageException e) { // 服务返回成功,返回体类型不合法,或者解析返回体失败
// // 调用e.getMessage()获取信息打印日志或上报监控更多方法见MalformedMessageException定义
// e.getMessage();
// System.out.println(e.getMessage());
// } catch (Exception e) {
// throw new RuntimeException(e);
// }
//
// return Result.success("");
// }
@PostMapping("/payNotify") @PostMapping("/payNotify")
@ -90,27 +93,22 @@ public class WeChatApiV3PayController extends BaseController {
String wechatpayNonce = request.getHeader("Wechatpay-Nonce"); String wechatpayNonce = request.getHeader("Wechatpay-Nonce");
String wechatPaySerial = request.getHeader("Wechatpay-Serial"); String wechatPaySerial = request.getHeader("Wechatpay-Serial");
String wechatSignature = request.getHeader("Wechatpay-Signature"); String wechatSignature = request.getHeader("Wechatpay-Signature");
// request. // request.
System.out.println("body:_____" + requestBody); System.out.println("body:_____" + requestBody);
// 构造 RequestParam // 构造 RequestParam
RequestParam requestParam = new RequestParam.Builder().serialNumber(wechatPaySerial).nonce(wechatpayNonce).signature(wechatSignature).timestamp(wechatTimestamp).body(requestBody).build(); RequestParam requestParam = new RequestParam.Builder().serialNumber(wechatPaySerial).nonce(wechatpayNonce).signature(wechatSignature).timestamp(wechatTimestamp).body(requestBody).build();
// 如果已经初始化了 RSAAutoCertificateConfig可直接使用
// 没有的话,则构造一个
// 如果已经初始化了 RSAAutoCertificateConfig可直接使用 // 初始化 NotificationParser
// 没有的话,则构造一个
// 初始化 NotificationParser
NotificationParser parser = new NotificationParser(wxPayNotificationConfig.config()); NotificationParser parser = new NotificationParser(wxPayNotificationConfig.config());
try { try {
// 以支付通知回调为例,验签、解密并转换成 Transaction // 以支付通知回调为例,验签、解密并转换成 Transaction
Transaction transaction = parser.parse(requestParam, Transaction.class); Transaction transaction = parser.parse(requestParam, Transaction.class);
System.out.println("transaction:_____" + transaction.toString()); System.out.println("transaction:_____" + transaction.toString());
memberShipService.updateOrderStatus(transaction);
} catch (ValidationException e) { } catch (ValidationException e) {
// 签名验证失败,返回 401 UNAUTHORIZED 状态码 // 签名验证失败,返回 401 UNAUTHORIZED 状态码
// logger.error("sign verification failed", e); // logger.error("sign verification failed", e);

@ -0,0 +1,8 @@
package com.luoo.user.dao;
import com.luoo.user.pojo.MembershipOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface MembershipOrderDao extends JpaRepository<MembershipOrder, String>, JpaSpecificationExecutor<MembershipOrder> {
}

@ -0,0 +1,8 @@
package com.luoo.user.dao;
import com.luoo.user.pojo.VipSku;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface VipSkuDao extends JpaRepository<VipSku, String>, JpaSpecificationExecutor<VipSku> {
}

@ -0,0 +1,71 @@
package com.luoo.user.pojo;
import com.luoo.user.config.JPABasePojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.time.LocalDate;
/**
* @program: luoo_parent
* @description:
* @author: yawei.huang
* @create: 2024-11-14 20:48
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@DynamicUpdate
@Where(clause = "del_flag = 0")
@Table(name = "tb_membership_order")
public class MembershipOrder extends JPABasePojo {
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "商品id")
private String skuId;
@ApiModelProperty(value = "会员码id")
private String membershipCodeId;
@ApiModelProperty(value = "会员码")
private String membershipCode;
@ApiModelProperty(value = "支付方式 1-微信支付 2-支付宝支付 3-会员码兑换")
private Integer payType;
@ApiModelProperty(value = "订单号")
private String orderCode;
@ApiModelProperty(value = "天数")
private Integer duration;
@ApiModelProperty(value = "是否永久会员 1-是 2-否")
private Integer life;
@ApiModelProperty(value = "价格,单位(分)")
private Integer amount;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "开始时间")
private LocalDate vipStartDate;
@ApiModelProperty(value = "结束时间")
private LocalDate vipStopDate;
@ApiModelProperty(value = "支付状态 0-待支付 1-支付成功 2-支付失败")
private Integer status;
}

@ -0,0 +1,43 @@
package com.luoo.user.pojo;
import com.luoo.user.config.JPABasePojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
* @program: luoo_parent
* @description: vip_sku
* @author: yawei.huang
* @create: 2024-11-14 19:59
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@DynamicUpdate
@Where(clause = "del_flag = 0")
@Table(name = "tb_vip_sku")
public class VipSku extends JPABasePojo {
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "天数")
private Integer days;
@ApiModelProperty(value = "是否永久会员 1-是 2-否")
private Integer lifeFlag;
@ApiModelProperty(value = "价格,单位(分)")
private Integer amount;
}

@ -0,0 +1,271 @@
package com.luoo.user.service;
import api.Result;
import com.ijpay.core.kit.WxPayKit;
import com.luoo.user.config.WxPayConfig;
import com.luoo.user.config.WxPayPublicKeyConfig;
import com.luoo.user.dao.MembershipOrderDao;
import com.luoo.user.dao.UserInfoDao;
import com.luoo.user.dao.VipSkuDao;
import com.luoo.user.pojo.MembershipOrder;
import com.luoo.user.pojo.QMembershipOrder;
import com.luoo.user.pojo.UserInfo;
import com.luoo.user.pojo.VipSku;
import com.luoo.user.vo.membership.VipSkuVO;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.wechat.pay.java.service.payments.app.AppService;
import com.wechat.pay.java.service.payments.app.model.Amount;
import com.wechat.pay.java.service.payments.app.model.PrepayRequest;
import com.wechat.pay.java.service.payments.app.model.PrepayResponse;
import com.wechat.pay.java.service.payments.model.Transaction;
import constants.TaskPointIdConstants;
import dto.UserLoginDto;
import enums.MembershipEnums;
import enums.PointEnums;
import enums.UserVipStatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import util.IdWorker;
import util.JwtUtil;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @program: luoo_parent
* @description:
* @author: yawei.huang
* @create: 2024-11-14 20:10
**/
@Service
@Slf4j
public class MemberShipService {
private final VipSkuDao vipSkuDao;
private final WxPayConfig wxPayConfig;
private final IdWorker idWorker;
private final WxPayPublicKeyConfig wxPayPublicKeyConfig;
public static AppService wxPayAppService;
private final MembershipOrderDao membershipOrderDao;
private final JwtUtil jwtUtil;
private final JPAQueryFactory jpaQueryFactory;
private final UserInfoDao userInfoDao;
private final UserPointLogService userPointLogService;
private final UserInfoService userInfoService;
public MemberShipService(VipSkuDao vipSkuDao, WxPayConfig wxPayConfig, IdWorker idWorker, WxPayPublicKeyConfig wxPayPublicKeyConfig, MembershipOrderDao membershipOrderDao, JwtUtil jwtUtil, JPAQueryFactory jpaQueryFactory, UserInfoDao userInfoDao, UserPointLogService userPointLogService, UserInfoService userInfoService) {
this.vipSkuDao = vipSkuDao;
this.wxPayConfig = wxPayConfig;
this.idWorker = idWorker;
this.wxPayPublicKeyConfig = wxPayPublicKeyConfig;
this.membershipOrderDao = membershipOrderDao;
this.jwtUtil = jwtUtil;
this.jpaQueryFactory = jpaQueryFactory;
this.userInfoDao = userInfoDao;
this.userPointLogService = userPointLogService;
this.userInfoService = userInfoService;
}
/**
* SKU
*
* @return
*/
public List<VipSkuVO> getVipSkuList() {
List<VipSku> all = vipSkuDao.findAll();
return all.stream().map(item -> VipSkuVO.builder()
.id(item.getId())
.description(item.getDescription())
.days(item.getDays())
.lifeFlag(item.getLifeFlag())
.amount(item.getAmount())
.build()).collect(Collectors.toList());
}
/**
* id
*
* @param skuId id
* @return
*/
@Transactional(rollbackFor = Exception.class)
public Object prepay(String skuId) {
VipSku one = vipSkuDao.getOne(skuId);
PrepayRequest request = new PrepayRequest();
// 初始化服务
wxPayAppService = new AppService.Builder().config(wxPayPublicKeyConfig.config()).build();
// 内部订单号
String outTradeNo = idWorker.nextId() + "";
UserLoginDto user = jwtUtil.getUser();
// 创建订单
MembershipOrder membershipOrder = MembershipOrder.builder()
.orderCode(outTradeNo)
.skuId(skuId)
.payType(MembershipEnums.WX_PAY.getCode())
.amount(one.getAmount())
.duration(one.getDays())
.life(one.getLifeFlag())
.userId(user.getUserId())
.nickName(user.getNickName())
.status(MembershipEnums.WAIT_PAY.getCode())
.build();
membershipOrder.setId(String.valueOf(idWorker.nextId()));
membershipOrderDao.save(membershipOrder);
// 调用request.setXxx(val)设置所需参数具体参数可见Request定义
Amount amount = new Amount();
amount.setTotal(one.getAmount());
request.setAmount(amount);
request.setAppid(wxPayConfig.getAppId());
request.setMchid(wxPayConfig.getMchId());
request.setDescription(one.getDescription());
request.setNotifyUrl(wxPayConfig.getNotifyUrl());
request.setOutTradeNo(outTradeNo);
// 调用接口
PrepayResponse response = wxPayAppService.prepay(request);
Map<String, String> map = null;
try {
map = WxPayKit.appCreateSign(wxPayConfig.getAppId(), wxPayConfig.getMchId(), response.getPrepayId(), wxPayConfig.getPrivateKeyPath());
} catch (Exception e) {
throw new RuntimeException(e);
}
return map;
}
@Transactional(rollbackFor = Exception.class)
public void updateOrderStatus(Transaction transaction) {
String outTradeNo = transaction.getOutTradeNo();
QMembershipOrder qMembershipOrder = QMembershipOrder.membershipOrder;
MembershipOrder one = jpaQueryFactory.selectFrom(qMembershipOrder)
.where(qMembershipOrder.orderCode.eq(outTradeNo))
.fetchOne();
if ("SUCCESS".equals(transaction.getTradeState().toString())) {
one.setStatus(MembershipEnums.PAY_SUCCESS.getCode());
dealUserVipCalc(one);
} else {
one.setStatus(MembershipEnums.PAY_FAIL.getCode());
}
membershipOrderDao.save(one);
}
/**
* vip
*
* @param one
*/
private void dealUserVipCalc(MembershipOrder one) {
// 处理用户表
UserInfo userInfo = userInfoDao.findById(one.getUserId()).get();
if (Objects.equals(userInfo.getVipStatus(), UserVipStatusEnum.INITIAL.getCode())) {
// 首次开通会员
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.BUY_MEMBER, one.getUserId());
}
// 永久会员码
if (Objects.equals(one.getLife(), PointEnums.MEMBERSHIP_LIFE.getCode())) {
userInfo.setVipStatus(UserVipStatusEnum.LIFE.getCode());
} else {
// 非永久会员码
// 计算会员到期时间
LocalDate vipExpireTime;
if (Objects.equals(UserVipStatusEnum.ACTIVE.getCode(), userInfo.getVipStatus())) {
// 如果是当前正是会员以到期时间为基准再增加membershipCode的duration天
vipExpireTime = (userInfo.getVipExpireTime() == null ? LocalDate.now() : userInfo.getVipExpireTime()).plusDays(one.getDuration());
} else {
// 如果是当前不是会员从今天开始增加membershipCode的duration天
userInfo.setVipStatus(UserVipStatusEnum.INITIAL.getCode());
vipExpireTime = LocalDate.now().plusDays(one.getDuration());
}
userInfo.setVipExpireTime(vipExpireTime);
// 无论如何当即设置为会员生效状态
userInfo.setVipStatus(UserVipStatusEnum.ACTIVE.getCode());
}
userInfoDao.save(userInfo);
}
/**
*
*
* @param type
* @param userId id
*/
@Transactional(rollbackFor = Exception.class)
public void applePayMembershipOrder(String type, String userId) {
// 内部订单号
String outTradeNo = idWorker.nextId() + "";
UserInfo userInfo = userInfoService.findById(userId);
// 创建订单
// 苹果支付只有成功
MembershipOrder membershipOrder = MembershipOrder.builder()
.orderCode(outTradeNo)
.payType(MembershipEnums.APPLE_PAY.getCode())
.userId(userInfo.getId())
.nickName(userInfo.getNickName())
.status(MembershipEnums.PAY_SUCCESS.getCode())
.build();
String skuId = "";
switch (type) {
case "cn.luoo.IndieMusic.annual": {
// 年度会员 逻辑从这开始
System.out.println("appleIAP 年度会员 逻辑从这开始,userid___" + userId);
// todo 这边会员种类是写死的,最好苹果支付有个字段能对应,否则每次都要改代码后发布
skuId = "2";
//这里拿到userId,在我们自己的订单逻辑里插一条订单记录,给用户开通相应的会员
userId = "";
break;
}
case "cn.luoo.IndieMusic.monthly": {
// 月度会员逻辑从这开始
System.out.println("appleIAP 月度会员 逻辑从这开始,userid___" + userId);
;
skuId = "1";
break;
}
case "cn.luoo.IndieMusic.lifetime": {
// 终身会员逻辑从这开始
System.out.println("appleIAP 终身会员 逻辑从这开始,userid___" + userId);
skuId = "3";
break;
}
}
if (StringUtils.isNotBlank(skuId)) {
membershipOrder.setId(String.valueOf(idWorker.nextId()));
membershipOrder.setSkuId(skuId);
VipSku vipSku = vipSkuDao.getOne(skuId);
membershipOrder.setAmount(vipSku.getAmount());
membershipOrder.setLife(vipSku.getLifeFlag());
membershipOrder.setDuration(vipSku.getDays());
dealUserVipCalc(membershipOrder);
membershipOrderDao.save(membershipOrder);
}
}
}

@ -164,7 +164,7 @@ public class MembershipCodeService {
// 非永久会员码 // 非永久会员码
// 计算会员到期时间 // 计算会员到期时间
LocalDate vipExpireTime; LocalDate vipExpireTime;
if (!Objects.equals(UserVipStatusEnum.INITIAL.getCode(), userInfo.getVipStatus())) { if (Objects.equals(UserVipStatusEnum.ACTIVE.getCode(), userInfo.getVipStatus())) {
vipExpireTime = (userInfo.getVipExpireTime() == null ? LocalDate.now() : userInfo.getVipExpireTime()).plusDays(membershipCode.getDuration()); vipExpireTime = (userInfo.getVipExpireTime() == null ? LocalDate.now() : userInfo.getVipExpireTime()).plusDays(membershipCode.getDuration());
} else { } else {
// 从今天开始增加membershipCode的duration天 // 从今天开始增加membershipCode的duration天

@ -0,0 +1,36 @@
package com.luoo.user.vo.membership;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @program: luoo_parent
* @description: SKU
* @author: yawei.huang
* @create: 2024-11-14 20:20
**/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class VipSkuVO implements Serializable {
private String id;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "天数")
private Integer days;
@ApiModelProperty(value = "是否永久会员 1-是 2-否")
private Integer lifeFlag;
@ApiModelProperty(value = "价格,单位(分)")
private Integer amount;
}
Loading…
Cancel
Save