商品模块代码提交
This commit is contained in:
parent
23f4e36bda
commit
8048afc145
|
|
@ -23,7 +23,7 @@ import java.math.BigDecimal;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/points/member-points")
|
@RequestMapping("/admin/points/memberPoints")
|
||||||
public class MemberPointsController {
|
public class MemberPointsController {
|
||||||
|
|
||||||
private final MemberPointsService memberPointsService;
|
private final MemberPointsService memberPointsService;
|
||||||
|
|
@ -42,7 +42,7 @@ public class MemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 001-会员积分账户信息
|
* 001-会员积分账户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("user-points")
|
@GetMapping("userPoints")
|
||||||
public CzgResult<MemberPoints> getMemberPoints(@RequestParam Long userId) {
|
public CzgResult<MemberPoints> getMemberPoints(@RequestParam Long userId) {
|
||||||
MemberPoints data = memberPointsService.getMemberPoints(userId);
|
MemberPoints data = memberPointsService.getMemberPoints(userId);
|
||||||
return CzgResult.success(data);
|
return CzgResult.success(data);
|
||||||
|
|
@ -54,7 +54,7 @@ public class MemberPointsController {
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
* @param orderAmount 订单金额
|
* @param orderAmount 订单金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-usable-points")
|
@GetMapping("calcUsablePoints")
|
||||||
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount) {
|
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount) {
|
||||||
OrderDeductionPointsDTO usablePoints = memberPointsService.getMemberUsablePoints(userId, orderAmount);
|
OrderDeductionPointsDTO usablePoints = memberPointsService.getMemberUsablePoints(userId, orderAmount);
|
||||||
return CzgResult.success(usablePoints);
|
return CzgResult.success(usablePoints);
|
||||||
|
|
@ -67,7 +67,7 @@ public class MemberPointsController {
|
||||||
* @param orderAmount 订单金额
|
* @param orderAmount 订单金额
|
||||||
* @param deductionAmount 抵扣金额
|
* @param deductionAmount 抵扣金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-used-points")
|
@GetMapping("calcUsedPoints")
|
||||||
public CzgResult<Integer> calcUsedPoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
public CzgResult<Integer> calcUsedPoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
||||||
int points = memberPointsService.calcUsedPoints(userId, orderAmount, deductionAmount);
|
int points = memberPointsService.calcUsedPoints(userId, orderAmount, deductionAmount);
|
||||||
return CzgResult.success(points);
|
return CzgResult.success(points);
|
||||||
|
|
@ -76,7 +76,7 @@ public class MemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 003-根据积分计算可抵扣金额
|
* 003-根据积分计算可抵扣金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-deduction-amount")
|
@GetMapping("calcDeductionAmount")
|
||||||
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
||||||
BigDecimal deductionAmount = memberPointsService.calcDeductionAmount(userId, orderAmount, points);
|
BigDecimal deductionAmount = memberPointsService.calcDeductionAmount(userId, orderAmount, points);
|
||||||
return CzgResult.success(deductionAmount);
|
return CzgResult.success(deductionAmount);
|
||||||
|
|
@ -85,7 +85,7 @@ public class MemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 005-支付完成扣减积分(支付成功回调中使用)
|
* 005-支付完成扣减积分(支付成功回调中使用)
|
||||||
*/
|
*/
|
||||||
@PostMapping("payed-deduct-points")
|
@PostMapping("payedDeductPoints")
|
||||||
public CzgResult<Boolean> deductPoints(@RequestBody PayedDeductPointsParam param) {
|
public CzgResult<Boolean> deductPoints(@RequestBody PayedDeductPointsParam param) {
|
||||||
boolean ret = memberPointsService.deductPoints(param.getUserId(), param.getPoints(), param.getContent(), param.getOrderId());
|
boolean ret = memberPointsService.deductPoints(param.getUserId(), param.getPoints(), param.getContent(), param.getOrderId());
|
||||||
return CzgResult.success(ret);
|
return CzgResult.success(ret);
|
||||||
|
|
@ -94,7 +94,7 @@ public class MemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 006-消费赠送积分(支付成功回调中使用)
|
* 006-消费赠送积分(支付成功回调中使用)
|
||||||
*/
|
*/
|
||||||
@PostMapping("consume-award-points")
|
@PostMapping("consumeAwardPoints")
|
||||||
public CzgResult<Void> consumeAwardPoints(@RequestBody ConsumeAwardPointsParam param) {
|
public CzgResult<Void> consumeAwardPoints(@RequestBody ConsumeAwardPointsParam param) {
|
||||||
memberPointsService.consumeAwardPoints(param.getUserId(), param.getOrderId());
|
memberPointsService.consumeAwardPoints(param.getUserId(), param.getOrderId());
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/points/member-points-log")
|
@RequestMapping("/admin/points/memberPointsLog")
|
||||||
public class MemberPointsLogController {
|
public class MemberPointsLogController {
|
||||||
|
|
||||||
private final MemberPointsLogService memberPointsLogService;
|
private final MemberPointsLogService memberPointsLogService;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/points/basic-setting")
|
@RequestMapping("/admin/points/basicSetting")
|
||||||
public class PointsBasicSettingController {
|
public class PointsBasicSettingController {
|
||||||
|
|
||||||
private final PointsBasicSettingService pointsBasicSettingService;
|
private final PointsBasicSettingService pointsBasicSettingService;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/points/exchange-record")
|
@RequestMapping("/admin/points/exchangeRecord")
|
||||||
public class PointsExchangeRecordController {
|
public class PointsExchangeRecordController {
|
||||||
|
|
||||||
private final PointsExchangeRecordService pointsExchangeRecordService;
|
private final PointsExchangeRecordService pointsExchangeRecordService;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/points/goods-setting")
|
@RequestMapping("/admin/points/goodsSetting")
|
||||||
public class PointsGoodsSettingController {
|
public class PointsGoodsSettingController {
|
||||||
|
|
||||||
private final PointsGoodsSettingService pointsGoodsSettingService;
|
private final PointsGoodsSettingService pointsGoodsSettingService;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import java.math.BigDecimal;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user/points/member-points")
|
@RequestMapping("/user/points/memberPoints")
|
||||||
public class UMemberPointsController {
|
public class UMemberPointsController {
|
||||||
|
|
||||||
private final MemberPointsService memberPointsService;
|
private final MemberPointsService memberPointsService;
|
||||||
|
|
@ -28,7 +28,7 @@ public class UMemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 001-会员积分账户信息
|
* 001-会员积分账户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("my-points")
|
@GetMapping("myPoints")
|
||||||
public CzgResult<MemberPoints> getMemberPoints() {
|
public CzgResult<MemberPoints> getMemberPoints() {
|
||||||
long userId = StpKit.USER.getLoginIdAsLong();
|
long userId = StpKit.USER.getLoginIdAsLong();
|
||||||
MemberPoints data = memberPointsService.getMemberPoints(userId);
|
MemberPoints data = memberPointsService.getMemberPoints(userId);
|
||||||
|
|
@ -41,7 +41,7 @@ public class UMemberPointsController {
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
* @param orderAmount 订单金额
|
* @param orderAmount 订单金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-usable-points")
|
@GetMapping("calcUsablePoints")
|
||||||
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount) {
|
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount) {
|
||||||
OrderDeductionPointsDTO usablePoints = memberPointsService.getMemberUsablePoints(userId, orderAmount);
|
OrderDeductionPointsDTO usablePoints = memberPointsService.getMemberUsablePoints(userId, orderAmount);
|
||||||
return CzgResult.success(usablePoints);
|
return CzgResult.success(usablePoints);
|
||||||
|
|
@ -54,7 +54,7 @@ public class UMemberPointsController {
|
||||||
* @param orderAmount 订单金额
|
* @param orderAmount 订单金额
|
||||||
* @param deductionAmount 抵扣金额
|
* @param deductionAmount 抵扣金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-used-points")
|
@GetMapping("calcUsedPoints")
|
||||||
public CzgResult<Integer> calcUsedPoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
public CzgResult<Integer> calcUsedPoints(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
||||||
int points = memberPointsService.calcUsedPoints(userId, orderAmount, deductionAmount);
|
int points = memberPointsService.calcUsedPoints(userId, orderAmount, deductionAmount);
|
||||||
return CzgResult.success(points);
|
return CzgResult.success(points);
|
||||||
|
|
@ -66,7 +66,7 @@ public class UMemberPointsController {
|
||||||
* @param orderAmount 订单金额
|
* @param orderAmount 订单金额
|
||||||
* @param points 使用积分
|
* @param points 使用积分
|
||||||
*/
|
*/
|
||||||
@GetMapping("calc-deduction-amount")
|
@GetMapping("calcDeductionAmount")
|
||||||
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam Long userId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
||||||
BigDecimal deductionAmount = memberPointsService.calcDeductionAmount(userId, orderAmount, points);
|
BigDecimal deductionAmount = memberPointsService.calcDeductionAmount(userId, orderAmount, points);
|
||||||
return CzgResult.success(deductionAmount);
|
return CzgResult.success(deductionAmount);
|
||||||
|
|
@ -75,7 +75,7 @@ public class UMemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 005-支付完成扣减积分(支付成功回调中使用)
|
* 005-支付完成扣减积分(支付成功回调中使用)
|
||||||
*/
|
*/
|
||||||
@PostMapping("payed-deduct-points")
|
@PostMapping("payedDeductPoints")
|
||||||
public CzgResult<Boolean> deductPoints(@RequestBody PayedDeductPointsParam param) {
|
public CzgResult<Boolean> deductPoints(@RequestBody PayedDeductPointsParam param) {
|
||||||
boolean ret = memberPointsService.deductPoints(param.getUserId(), param.getPoints(), param.getContent(), param.getOrderId());
|
boolean ret = memberPointsService.deductPoints(param.getUserId(), param.getPoints(), param.getContent(), param.getOrderId());
|
||||||
return CzgResult.success(ret);
|
return CzgResult.success(ret);
|
||||||
|
|
@ -84,7 +84,7 @@ public class UMemberPointsController {
|
||||||
/**
|
/**
|
||||||
* 006-消费赠送积分(支付成功回调中使用)
|
* 006-消费赠送积分(支付成功回调中使用)
|
||||||
*/
|
*/
|
||||||
@PostMapping("consume-award-points")
|
@PostMapping("consumeAwardPoints")
|
||||||
public CzgResult<Void> consumeAwardPoints(@RequestBody ConsumeAwardPointsParam param) {
|
public CzgResult<Void> consumeAwardPoints(@RequestBody ConsumeAwardPointsParam param) {
|
||||||
memberPointsService.consumeAwardPoints(param.getUserId(), param.getOrderId());
|
memberPointsService.consumeAwardPoints(param.getUserId(), param.getOrderId());
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue