余额记录和积分记录接口

This commit is contained in:
张松 2025-02-27 17:48:31 +08:00
parent 8ecadc4241
commit 7218bc928b
1 changed files with 31 additions and 0 deletions

View File

@ -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<Page<ShopUserFlow>> 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<Page<PointsExchangeRecord>> 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)));
}
}