add
Helius
2022-03-22 32b3653d7abcf029d1c7f8bc5efc30569dd22d2f
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -1,6 +1,8 @@
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;
@@ -101,4 +103,49 @@
    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);
    }
}