feat:
1. 用户积分查询
This commit is contained in:
@@ -20,9 +20,11 @@ import org.springblade.modules.api.vo.*;
|
|||||||
import org.springblade.modules.common.service.ICommonUserAddressService;
|
import org.springblade.modules.common.service.ICommonUserAddressService;
|
||||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Hidden
|
@Hidden
|
||||||
@@ -40,6 +42,8 @@ public class APPUserController {
|
|||||||
|
|
||||||
private final ICommonUserAddressService addressService;
|
private final ICommonUserAddressService addressService;
|
||||||
|
|
||||||
|
private final ICommonUserPointService pointService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否修改过密码
|
* 是否修改过密码
|
||||||
@@ -170,5 +174,11 @@ public class APPUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/user-points")
|
||||||
|
@ApiOperationSupport(order = 14)
|
||||||
|
@Operation(summary = "用户积分查询")
|
||||||
|
public R<BigDecimal> userPoints() {
|
||||||
|
return R.data(pointService.queryPoint());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.springblade.core.mp.base.BaseService;
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户商城积分表 服务类
|
* 用户商城积分表 服务类
|
||||||
*
|
*
|
||||||
@@ -39,4 +41,7 @@ public interface ICommonUserPointService extends BaseService<CommonUserPointEnti
|
|||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
Boolean deductUserPoint(CommonUserPointApiDTO dto);
|
Boolean deductUserPoint(CommonUserPointApiDTO dto);
|
||||||
|
|
||||||
|
BigDecimal queryPoint();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.springblade.modules.common.service.impl;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
import org.springblade.modules.common.convert.AppCommonConvert;
|
import org.springblade.modules.common.convert.AppCommonConvert;
|
||||||
import org.springblade.modules.common.pojo.dto.CommonUserPointApiDTO;
|
import org.springblade.modules.common.pojo.dto.CommonUserPointApiDTO;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonCashCouponEntity;
|
import org.springblade.modules.common.pojo.entity.CommonCashCouponEntity;
|
||||||
@@ -84,6 +85,12 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal queryPoint() {
|
||||||
|
CommonUserPointEntity userPoint = getById(AuthUtil.getUserId());
|
||||||
|
return userPoint == null ? BigDecimal.ZERO : userPoint.getAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private CommonUserPointLogEntity saveBenefitPointLog(CommonUserPointApiDTO dto, Integer type) {
|
private CommonUserPointLogEntity saveBenefitPointLog(CommonUserPointApiDTO dto, Integer type) {
|
||||||
CommonUserPointLogEntity userPointLog = AppCommonConvert.INSTANCE.convertUserPointDTOToEntity(dto);
|
CommonUserPointLogEntity userPointLog = AppCommonConvert.INSTANCE.convertUserPointDTOToEntity(dto);
|
||||||
|
|||||||
Reference in New Issue
Block a user