diff --git a/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java b/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java index 11e5d208..836661bf 100644 --- a/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java +++ b/cash-api/account-server/src/main/java/com/czg/controller/user/UShopUserController.java @@ -2,10 +2,15 @@ package com.czg.controller.user; import com.czg.account.dto.shopuser.ShopUserAddDTO; import com.czg.account.dto.shopuser.ShopUserVipCardDTO; +import com.czg.account.entity.PointsExchangeRecord; import com.czg.account.entity.ShopUser; +import com.czg.account.entity.ShopUserFlow; +import com.czg.account.service.PointsExchangeRecordService; +import com.czg.account.service.ShopUserFlowService; import com.czg.account.service.ShopUserService; import com.czg.resp.CzgResult; import com.czg.sa.StpKit; +import com.czg.utils.PageUtil; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import jakarta.annotation.Resource; @@ -22,6 +27,10 @@ import org.springframework.web.bind.annotation.*; public class UShopUserController { @Resource private ShopUserService shopUserService; + @Resource + private ShopUserFlowService shopUserFlowService; + @Resource + private PointsExchangeRecordService pointsExchangeRecordService; /** * 获取当前店铺会员信息 @@ -64,4 +73,26 @@ public class UShopUserController { return CzgResult.success(shopUserService.join(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO)); } + + /** + * 获取余额余额明细 + * @return 分页数据 + */ + @GetMapping("/moneyRecord") + public CzgResult> getMoneyRecord() { + return CzgResult.success(shopUserFlowService.page(PageUtil.buildPage(), new QueryWrapper().eq(ShopUserFlow::getShopId, StpKit.USER.getShopId()) + .eq(ShopUserFlow::getUserId, StpKit.USER.getLoginIdAsLong()).orderBy(ShopUserFlow::getId, false))); + } + + /** + * 获取积分明细 + * @return 分页数据 + */ + @GetMapping("/pointsRecord") + public CzgResult> getPointsRecord() { + return CzgResult.success(pointsExchangeRecordService.page(PageUtil.buildPage(), new QueryWrapper().eq(PointsExchangeRecord::getShopId, StpKit.USER.getShopId()) + .eq(PointsExchangeRecord::getUserId, StpKit.USER.getLoginIdAsLong()).orderBy(PointsExchangeRecord::getId, false))); + } + + }