| | |
| | | package cc.mrbird.febs.dapp.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.ShareCodeUtil; |
| | | import cc.mrbird.febs.dapp.dto.ApproveDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | |
| | | import cc.mrbird.febs.dapp.mapper.DappWalletMineDao; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DappMemberEntity> selectInPage(DappMemberEntity member, QueryRequest request) { |
| | | Page<DappMemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return dappMemberDao.selectInPage(member, page); |
| | | } |
| | | |
| | | @Override |
| | | public DappMemberEntity findByAddress(String address) { |
| | | return dappMemberDao.selectByAddress(address); |
| | | } |
| | | |
| | | @Override |
| | | public void accountStatus(Long id) { |
| | | DappMemberEntity member = dappMemberDao.selectById(id); |
| | | if (member == null) { |
| | | throw new FebsException("用户不存在"); |
| | | } |
| | | |
| | | if (member.getAccountStatus() == AppContants.INT_FLAG_Y) { |
| | | member.setAccountStatus(AppContants.INT_FLAG_N); |
| | | } else { |
| | | member.setAccountStatus(AppContants.INT_FLAG_Y); |
| | | } |
| | | dappMemberDao.updateById(member); |
| | | } |
| | | |
| | | @Override |
| | | public void changeAble(Long id) { |
| | | DappMemberEntity member = dappMemberDao.selectById(id); |
| | | if (member == null) { |
| | | throw new FebsException("用户不存在"); |
| | | } |
| | | |
| | | if (member.getChangeAble() == AppContants.INT_FLAG_Y) { |
| | | member.setChangeAble(AppContants.INT_FLAG_N); |
| | | } else { |
| | | member.setChangeAble(AppContants.INT_FLAG_Y); |
| | | } |
| | | dappMemberDao.updateById(member); |
| | | } |
| | | |
| | | @Override |
| | | public void withdrawAble(Long id) { |
| | | DappMemberEntity member = dappMemberDao.selectById(id); |
| | | if (member == null) { |
| | | throw new FebsException("用户不存在"); |
| | | } |
| | | |
| | | if (member.getWithdrawAble() == AppContants.INT_FLAG_Y) { |
| | | member.setWithdrawAble(AppContants.INT_FLAG_N); |
| | | } else { |
| | | member.setWithdrawAble(AppContants.INT_FLAG_Y); |
| | | } |
| | | dappMemberDao.updateById(member); |
| | | } |
| | | } |