增加钱包、变更信息,引荐信息相关接口

This commit is contained in:
2025-08-16 21:01:44 +08:00
parent fd1cd8d9b0
commit d1f849ba8d
41 changed files with 986 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.sczx.user.common.enums;
import lombok.Getter;
/**
* 小程序类型枚举
*/
@Getter
public enum WalletChangeTypeEnum {
REFERRAL("REFERRAL", "引荐"),
WITHDRAWAL("WITHDRAWAL", "提现");
private final String code;
private final String desc;
WalletChangeTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
}

View File

@ -0,0 +1,38 @@
package com.sczx.user.controller;
import com.sczx.user.common.Result;
import com.sczx.user.dto.BaseUserFeedbackDTO;
import com.sczx.user.service.IUserFeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户反馈记录 前端控制器
* </p>
*
* @author zhangli
* @since 2025-08-16 18:00:57
*/
@Api(value = "用户反馈", tags = "用户反馈")
@RestController
@RequestMapping("/feedback")
public class UserFeedbackController {
@Autowired
private IUserFeedbackService userService;
@ApiOperation(value = "提交反馈", notes = "提交反馈")
@PostMapping("/submitFeedback")
public Result<Boolean> submitFeedback(
@RequestBody BaseUserFeedbackDTO baseUserFeedbackDTO) {
userService.submitFeedback(baseUserFeedbackDTO);
return Result.ok(true);
}
}

View File

@ -0,0 +1,45 @@
package com.sczx.user.controller;
import com.sczx.user.common.Result;
import com.sczx.user.dto.BaseUserWithdrawalDTO;
import com.sczx.user.service.IUserWithdrawalService;
import com.sczx.user.util.JwtUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;
/**
* <p>
* 用户提现记录 前端控制器
* </p>
*
* @author zhangli
* @since 2025-08-16 20:22:19
*/
@Api(value = "提现", tags = "提现")
@RestController
@RequestMapping("/withdrawal")
public class UserWithdrawalController {
@Autowired
private JwtUtil jwtUtil;
@Autowired
private IUserWithdrawalService userWithdrawalService;
@ApiOperation(value = "获取提现列表", notes = "获取提现列表")
@GetMapping("/listWithdrawal")
public Result<List<BaseUserWithdrawalDTO>> listWithdrawal(@RequestParam(value = "userId", required = false) Long userId) {
if (userId == null) {
userId = (long) jwtUtil.getUserInfoFromToken().getUserId();
}
return Result.ok(userWithdrawalService.getUserWithdrawalList(userId));
}
}

View File

@ -0,0 +1,54 @@
package com.sczx.user.controller;
import com.sczx.user.common.Result;
import com.sczx.user.dto.BaseWalletChangeDTO;
import com.sczx.user.dto.BaseWalletDTO;
import com.sczx.user.dto.WalletChangeQueryReq;
import com.sczx.user.service.IWalletService;
import com.sczx.user.util.JwtUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 钱包信息 前端控制器
* </p>
*
* @author zhangli
* @since 2025-08-16 17:45:46
*/
@Api(value = "钱包控制器", tags = "钱包")
@RestController
@RequestMapping("/wallet")
public class WalletController {
@Autowired
private IWalletService walletService;
@Autowired
private JwtUtil jwtUtil;
@ApiOperation(value = "获取钱包信息", notes = "获取钱包信息")
@GetMapping("/walletInfo")
public Result<BaseWalletDTO> walletInfo(@RequestParam(value = "userId", required = false) Long userId) {
if (userId == null) {
userId = (long) jwtUtil.getUserInfoFromToken().getUserId();
}
return Result.ok(walletService.getWalletInfo(userId));
}
@ApiOperation(value = "获取钱包变更信息列表", notes = "获取钱包变更信息列表")
@PostMapping("/listWalletChange")
public Result<List<BaseWalletChangeDTO>> listWalletChange(@RequestBody WalletChangeQueryReq baseWalletChangeQueryReq) {
if (baseWalletChangeQueryReq.getUserId() == null) {
Long userId = (long) jwtUtil.getUserInfoFromToken().getUserId();
baseWalletChangeQueryReq.setUserId(userId);
}
return Result.ok(walletService.listWalletChange(baseWalletChangeQueryReq));
}
}

View File

@ -0,0 +1,13 @@
package com.sczx.user.convert;
import com.sczx.user.dto.BaseUserFeedbackDTO;
import com.sczx.user.po.BaseUserFeedbackPO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface BaseUserFeedbackConvert {
BaseUserFeedbackConvert INSTANCE = Mappers.getMapper(BaseUserFeedbackConvert.class);
BaseUserFeedbackDTO po2Dto(BaseUserFeedbackPO po);
BaseUserFeedbackPO dto2Po(BaseUserFeedbackDTO dto);
}

View File

@ -0,0 +1,17 @@
package com.sczx.user.convert;
import com.sczx.user.dto.BaseUserWithdrawalDTO;
import com.sczx.user.po.BaseUserWithdrawalPO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface BaseUserWithdrawalConvert {
BaseUserWithdrawalConvert INSTANCE = Mappers.getMapper(BaseUserWithdrawalConvert.class);
BaseUserWithdrawalDTO po2Dto(BaseUserWithdrawalPO po);
BaseUserWithdrawalPO dto2Po(BaseUserWithdrawalDTO dto);
List<BaseUserWithdrawalDTO> pos2Dtos(List<BaseUserWithdrawalPO> pos);
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.convert;
import com.sczx.user.dto.BaseWalletChangeDTO;
import com.sczx.user.po.BaseWalletChangePO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface BaseWalletChangeConvert {
BaseWalletChangeConvert INSTANCE = Mappers.getMapper(BaseWalletChangeConvert.class);
BaseWalletChangeDTO po2Dto(BaseWalletChangePO baseWalletPO);
BaseWalletChangePO dto2Po(BaseWalletChangeDTO baseWalletDTO);
List<BaseWalletChangeDTO> pos2Dtos(List<BaseWalletChangePO> baseWalletPOs);
}

View File

@ -0,0 +1,12 @@
package com.sczx.user.convert;
import com.sczx.user.dto.BaseWalletDTO;
import com.sczx.user.po.BaseWalletPO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface BaseWalletConvert {
BaseWalletConvert INSTANCE = Mappers.getMapper(BaseWalletConvert.class);
BaseWalletDTO po2Dto(BaseWalletPO baseWalletPO);
}

View File

@ -0,0 +1,24 @@
package com.sczx.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "BaseUserFeedbackDTO对象", description = "用户反馈记录")
@Data
public class BaseUserFeedbackDTO {
@ApiModelProperty("id主键")
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("反馈内容")
private String feedbackContent;
}

View File

@ -0,0 +1,37 @@
package com.sczx.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ApiModel(value = "BaseUserWithdrawalDTO对象", description = "用户提现记录")
@Data
public class BaseUserWithdrawalDTO {
@ApiModelProperty("id主键")
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("提现渠道")
private String withdrawalChannel;
@ApiModelProperty("提现金额(元)")
private BigDecimal withdrawalAmount;
@ApiModelProperty("提现时间")
private LocalDateTime withdrawalTime;
@ApiModelProperty("提现状态")
private String withdrawalStatus;
}

View File

@ -0,0 +1,33 @@
package com.sczx.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ApiModel(value = "BaseWalletChangeDTO对象", description = "钱包变更记录")
@Data
public class BaseWalletChangeDTO {
@ApiModelProperty("id主键")
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("变更类型")
private String changeType;
@ApiModelProperty("支付类型")
private String payType;
@ApiModelProperty("变更时间")
private LocalDateTime changeTime;
@ApiModelProperty("变更金额(元)")
private BigDecimal changeAmount;
@ApiModelProperty("引荐订单")
private String referralOrderNo;
}

View File

@ -0,0 +1,30 @@
package com.sczx.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@ApiModel(value = "BaseWalletDTO对象", description = "钱包信息")
@Data
public class BaseWalletDTO {
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("余额(元)")
private BigDecimal balance;
@ApiModelProperty("可用金额(元)")
private BigDecimal availableAmount;
@ApiModelProperty("冻结金额(元)")
private BigDecimal freezeAmount;
}

View File

@ -25,4 +25,8 @@ public class SimpleUserInfoDTO {
@ApiModelProperty("头像")
private String avatarUrl;
@ApiModelProperty("是否认证0未认证1已认证")
private Integer authed;
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "钱包变更记录查询请求对象")
@Data
public class WalletChangeQueryReq {
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("变更类型")
private String changeType;
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.mapper;
import com.sczx.user.po.BaseUserFeedbackPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 用户反馈记录 Mapper 接口
* </p>
*
* @author zhangli
* @since 2025-08-16 18:00:57
*/
public interface BaseUserFeedbackMapper extends BaseMapper<BaseUserFeedbackPO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.mapper;
import com.sczx.user.po.BaseUserWithdrawalPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 用户提现记录 Mapper 接口
* </p>
*
* @author zhangli
* @since 2025-08-16 20:22:19
*/
public interface BaseUserWithdrawalMapper extends BaseMapper<BaseUserWithdrawalPO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.mapper;
import com.sczx.user.po.BaseWalletChangePO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 钱包变更记录 Mapper 接口
* </p>
*
* @author zhangli
* @since 2025-08-16 20:36:42
*/
public interface BaseWalletChangeMapper extends BaseMapper<BaseWalletChangePO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.mapper;
import com.sczx.user.po.BaseWalletPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 钱包信息 Mapper 接口
* </p>
*
* @author zhangli
* @since 2025-08-16 17:45:46
*/
public interface BaseWalletMapper extends BaseMapper<BaseWalletPO> {
}

View File

@ -0,0 +1,56 @@
package com.sczx.user.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 用户反馈记录
* </p>
*
* @author zhangli
* @since 2025-08-16 18:00:57
*/
@Getter
@Setter
@TableName("zc_base_user_feedback")
@ApiModel(value = "BaseUserFeedbackPO对象", description = "用户反馈记录")
public class BaseUserFeedbackPO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("反馈内容")
private String feedbackContent;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
}

View File

@ -55,6 +55,9 @@ public class BaseUserPO implements Serializable {
@ApiModelProperty("支付宝小程序 userid")
private String alipayUserid;
@ApiModelProperty("是否认证0未认证1已认证")
private Integer authed;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;

View File

@ -0,0 +1,66 @@
package com.sczx.user.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 用户提现记录
* </p>
*
* @author zhangli
* @since 2025-08-16 20:22:19
*/
@Getter
@Setter
@TableName("zc_base_user_withdrawal")
@ApiModel(value = "BaseUserWithdrawalPO对象", description = "用户提现记录")
public class BaseUserWithdrawalPO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("提现渠道")
private String withdrawalChannel;
@ApiModelProperty("提现金额(元)")
private BigDecimal withdrawalAmount;
@ApiModelProperty("提现时间")
private LocalDateTime withdrawalTime;
@ApiModelProperty("提现状态")
private String withdrawalStatus;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,63 @@
package com.sczx.user.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 钱包变更记录
* </p>
*
* @author zhangli
* @since 2025-08-16 20:36:42
*/
@Getter
@Setter
@TableName("zc_base_wallet_change")
@ApiModel(value = "BaseWalletChangePO对象", description = "钱包变更记录")
public class BaseWalletChangePO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("变更类型")
private String changeType;
@ApiModelProperty("支付类型")
private String payType;
@ApiModelProperty("变更时间")
private LocalDateTime changeTime;
@ApiModelProperty("变更金额(元)")
private BigDecimal changeAmount;
@ApiModelProperty("引荐订单")
private String referralOrderNo;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,60 @@
package com.sczx.user.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 钱包信息
* </p>
*
* @author zhangli
* @since 2025-08-16 17:45:46
*/
@Getter
@Setter
@TableName("zc_base_wallet")
@ApiModel(value = "BaseWalletPO对象", description = "钱包信息")
public class BaseWalletPO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("用户id主键")
@TableId(value = "user_id", type = IdType.AUTO)
private Long userId;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("手机号")
private String phoneNumber;
@ApiModelProperty("余额(元)")
private BigDecimal balance;
@ApiModelProperty("可用金额(元)")
private BigDecimal availableAmount;
@ApiModelProperty("冻结金额(元)")
private BigDecimal freezeAmount;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.repository;
import com.sczx.user.po.BaseUserFeedbackPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 用户反馈记录 服务类
* </p>
*
* @author zhangli
* @since 2025-08-16 18:00:57
*/
public interface BaseUserFeedbackRepo extends IService<BaseUserFeedbackPO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.repository;
import com.sczx.user.po.BaseUserWithdrawalPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 用户提现记录 服务类
* </p>
*
* @author zhangli
* @since 2025-08-16 20:22:19
*/
public interface BaseUserWithdrawalRepo extends IService<BaseUserWithdrawalPO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.repository;
import com.sczx.user.po.BaseWalletChangePO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 钱包变更记录 服务类
* </p>
*
* @author zhangli
* @since 2025-08-16 20:36:42
*/
public interface BaseWalletChangeRepo extends IService<BaseWalletChangePO> {
}

View File

@ -0,0 +1,16 @@
package com.sczx.user.repository;
import com.sczx.user.po.BaseWalletPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 钱包信息 服务类
* </p>
*
* @author zhangli
* @since 2025-08-16 17:45:46
*/
public interface BaseWalletRepo extends IService<BaseWalletPO> {
}

View File

@ -0,0 +1,20 @@
package com.sczx.user.repository.impl;
import com.sczx.user.po.BaseUserFeedbackPO;
import com.sczx.user.mapper.BaseUserFeedbackMapper;
import com.sczx.user.repository.BaseUserFeedbackRepo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 用户反馈记录 服务实现类
* </p>
*
* @author zhangli
* @since 2025-08-16 18:00:57
*/
@Service
public class BaseUserFeedbackRepoImpl extends ServiceImpl<BaseUserFeedbackMapper, BaseUserFeedbackPO> implements BaseUserFeedbackRepo {
}

View File

@ -0,0 +1,20 @@
package com.sczx.user.repository.impl;
import com.sczx.user.po.BaseUserWithdrawalPO;
import com.sczx.user.mapper.BaseUserWithdrawalMapper;
import com.sczx.user.repository.BaseUserWithdrawalRepo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 用户提现记录 服务实现类
* </p>
*
* @author zhangli
* @since 2025-08-16 20:22:19
*/
@Service
public class BaseUserWithdrawalRepoImpl extends ServiceImpl<BaseUserWithdrawalMapper, BaseUserWithdrawalPO> implements BaseUserWithdrawalRepo {
}

View File

@ -0,0 +1,20 @@
package com.sczx.user.repository.impl;
import com.sczx.user.po.BaseWalletChangePO;
import com.sczx.user.mapper.BaseWalletChangeMapper;
import com.sczx.user.repository.BaseWalletChangeRepo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 钱包变更记录 服务实现类
* </p>
*
* @author zhangli
* @since 2025-08-16 20:36:42
*/
@Service
public class BaseWalletChangeRepoImpl extends ServiceImpl<BaseWalletChangeMapper, BaseWalletChangePO> implements BaseWalletChangeRepo {
}

View File

@ -0,0 +1,20 @@
package com.sczx.user.repository.impl;
import com.sczx.user.po.BaseWalletPO;
import com.sczx.user.mapper.BaseWalletMapper;
import com.sczx.user.repository.BaseWalletRepo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 钱包信息 服务实现类
* </p>
*
* @author zhangli
* @since 2025-08-16 17:45:46
*/
@Service
public class BaseWalletRepoImpl extends ServiceImpl<BaseWalletMapper, BaseWalletPO> implements BaseWalletRepo {
}

View File

@ -0,0 +1,12 @@
package com.sczx.user.service;
import com.sczx.user.dto.BaseUserFeedbackDTO;
public interface IUserFeedbackService {
/**
* 提交反馈
* @param baseUserFeedbackDTO
*/
void submitFeedback(BaseUserFeedbackDTO baseUserFeedbackDTO);
}

View File

@ -0,0 +1,14 @@
package com.sczx.user.service;
import com.sczx.user.dto.BaseUserWithdrawalDTO;
import java.util.List;
public interface IUserWithdrawalService {
/**
* 根据用户id获取提现记录
* @param userId
* @return
*/
List<BaseUserWithdrawalDTO> getUserWithdrawalList(Long userId);
}

View File

@ -0,0 +1,25 @@
package com.sczx.user.service;
import com.sczx.user.dto.BaseWalletChangeDTO;
import com.sczx.user.dto.BaseWalletDTO;
import com.sczx.user.dto.WalletChangeQueryReq;
import java.util.List;
public interface IWalletService {
/**
* 根据用户id获取钱包信息
*
* @param userId
* @return
*/
BaseWalletDTO getWalletInfo(Long userId);
/**
* 根据条件获取钱包变更记录
* @param baseWalletChangeQueryReq
* @return
*/
List<BaseWalletChangeDTO> listWalletChange(WalletChangeQueryReq baseWalletChangeQueryReq);
}

View File

@ -0,0 +1,24 @@
package com.sczx.user.service.impl;
import com.sczx.user.convert.BaseUserFeedbackConvert;
import com.sczx.user.dto.BaseUserFeedbackDTO;
import com.sczx.user.po.BaseUserFeedbackPO;
import com.sczx.user.repository.BaseUserFeedbackRepo;
import com.sczx.user.service.IUserFeedbackService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class UserFeedbackServiceImpl implements IUserFeedbackService {
@Autowired
private BaseUserFeedbackRepo baseUserFeedbackRepo;
@Override
public void submitFeedback(BaseUserFeedbackDTO baseUserFeedbackDTO) {
BaseUserFeedbackPO baseUserFeedbackPO = BaseUserFeedbackConvert.INSTANCE.dto2Po(baseUserFeedbackDTO);
baseUserFeedbackRepo.save(baseUserFeedbackPO);
}
}

View File

@ -0,0 +1,29 @@
package com.sczx.user.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sczx.user.convert.BaseUserWithdrawalConvert;
import com.sczx.user.dto.BaseUserWithdrawalDTO;
import com.sczx.user.po.BaseUserWithdrawalPO;
import com.sczx.user.repository.BaseUserWithdrawalRepo;
import com.sczx.user.service.IUserWithdrawalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class UserWithdrawalServiceImpl implements IUserWithdrawalService {
@Autowired
private BaseUserWithdrawalRepo baseUserWithdrawalRepo;
@Override
public List<BaseUserWithdrawalDTO> getUserWithdrawalList(Long userId) {
LambdaQueryWrapper<BaseUserWithdrawalPO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseUserWithdrawalPO::getUserId, userId).orderByDesc(BaseUserWithdrawalPO::getWithdrawalTime);
List<BaseUserWithdrawalPO> baseUserWithdrawalPOList = baseUserWithdrawalRepo.list(queryWrapper);
return BaseUserWithdrawalConvert.INSTANCE.pos2Dtos(baseUserWithdrawalPOList);
}
}

View File

@ -0,0 +1,44 @@
package com.sczx.user.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sczx.user.convert.BaseWalletChangeConvert;
import com.sczx.user.convert.BaseWalletConvert;
import com.sczx.user.dto.BaseWalletChangeDTO;
import com.sczx.user.dto.BaseWalletDTO;
import com.sczx.user.dto.WalletChangeQueryReq;
import com.sczx.user.po.BaseWalletChangePO;
import com.sczx.user.po.BaseWalletPO;
import com.sczx.user.repository.BaseWalletChangeRepo;
import com.sczx.user.repository.BaseWalletRepo;
import com.sczx.user.service.IWalletService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class WalletServiceImpl implements IWalletService {
@Autowired
private BaseWalletRepo baseWalletRepo;
@Autowired
private BaseWalletChangeRepo baseWalletChangeRepo;
@Override
public BaseWalletDTO getWalletInfo(Long userId) {
BaseWalletPO baseWalletPO = baseWalletRepo.getById(userId);
return BaseWalletConvert.INSTANCE.po2Dto(baseWalletPO);
}
@Override
public List<BaseWalletChangeDTO> listWalletChange(WalletChangeQueryReq baseWalletChangeQueryReq) {
LambdaQueryWrapper<BaseWalletChangePO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseWalletChangePO::getUserId, baseWalletChangeQueryReq.getUserId())
.eq(StringUtils.isNotBlank(baseWalletChangeQueryReq.getChangeType()),BaseWalletChangePO::getChangeType, baseWalletChangeQueryReq.getChangeType())
.orderByDesc(BaseWalletChangePO::getChangeTime);
List<BaseWalletChangePO> baseWalletChangePOList = baseWalletChangeRepo.list(queryWrapper);
return BaseWalletChangeConvert.INSTANCE.pos2Dtos(baseWalletChangePOList);
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sczx.user.mapper.BaseUserFeedbackMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sczx.user.mapper.BaseUserWithdrawalMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sczx.user.mapper.BaseWalletChangeMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sczx.user.mapper.BaseWalletMapper">
</mapper>