|
@@ -3,24 +3,30 @@ package cn.iocoder.yudao.module.pay.controller.app.wallet;
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionSummaryRespVO;
|
|
|
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionRespVO;
|
|
|
-import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert;
|
|
|
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO;
|
|
|
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.validation.Valid;
|
|
|
+
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
|
|
|
@Tag(name = "用户 APP - 钱包余额明细")
|
|
@@ -37,16 +43,19 @@ public class AppPayWalletTransactionController {
|
|
|
@Operation(summary = "获得钱包流水分页")
|
|
|
public CommonResult<PageResult<AppPayWalletTransactionRespVO>> getWalletTransactionPage(
|
|
|
@Valid AppPayWalletTransactionPageReqVO pageReqVO) {
|
|
|
- if (true) {
|
|
|
- PageResult<AppPayWalletTransactionRespVO> result = new PageResult<>(10L);
|
|
|
- result.getList().add(new AppPayWalletTransactionRespVO().setPrice(1L)
|
|
|
- .setTitle("测试").setCreateTime(LocalDateTime.now()));
|
|
|
- result.getList().add(new AppPayWalletTransactionRespVO().setPrice(-1L)
|
|
|
- .setTitle("测试2").setCreateTime(LocalDateTime.now()));
|
|
|
- return success(result);
|
|
|
- }
|
|
|
- PageResult<PayWalletTransactionDO> result = payWalletTransactionService.getWalletTransactionPage(getLoginUserId(),
|
|
|
- UserTypeEnum.MEMBER.getValue(), pageReqVO);
|
|
|
- return success(PayWalletTransactionConvert.INSTANCE.convertPage(result));
|
|
|
+ PageResult<PayWalletTransactionDO> pageResult = payWalletTransactionService.getWalletTransactionPage(
|
|
|
+ getLoginUserId(), UserTypeEnum.MEMBER.getValue(), pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, AppPayWalletTransactionRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get-summary")
|
|
|
+ @Operation(summary = "获得钱包流水统计")
|
|
|
+ @Parameter(name = "times", description = "时间段", required = true)
|
|
|
+ public CommonResult<AppPayWalletTransactionSummaryRespVO> getWalletTransactionSummary(
|
|
|
+ @RequestParam("createTime") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) LocalDateTime[] createTime) {
|
|
|
+ AppPayWalletTransactionSummaryRespVO summary = payWalletTransactionService.getWalletTransactionSummary(
|
|
|
+ getLoginUserId(), UserTypeEnum.MEMBER.getValue(), createTime);
|
|
|
+ return success(summary);
|
|
|
}
|
|
|
+
|
|
|
}
|