xiaoyong931011
2021-11-24 f39e494173dfb8789d97beee4fc53123b8a6b21d
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
@@ -21,6 +21,8 @@
import com.xcong.excoin.modules.fish.entity.*;
import com.xcong.excoin.modules.fish.service.MemberCannonService;
import com.xcong.excoin.modules.fish.vo.CannonSettingVo;
import com.xcong.excoin.modules.fish.vo.GoldAccountVo;
import com.xcong.excoin.modules.fish.vo.OwnCannonVo;
import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao;
import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
import com.xcong.excoin.utils.RedisUtils;
@@ -191,6 +193,29 @@
        return Result.ok("兑换成功");
    }
    @Override
    public Result getGoldAccount() {
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        MemberAccountGold memberAccountGold = memberAccountGoldDao.selectAccountGoldByMemberId(memberId);
        if(ObjectUtil.isEmpty(memberAccountGold)){
            MemberAccountGold memberAccountGoldNew = new MemberAccountGold();
            memberAccountGoldNew.setMemberId(memberId);
            memberAccountGoldNew.setTotalBalance(BigDecimal.ZERO);
            memberAccountGoldNew.setAvailableBalance(BigDecimal.ZERO);
            memberAccountGoldNew.setFrozenBalance(BigDecimal.ZERO);
            memberAccountGoldDao.insert(memberAccountGoldNew);
        }
        GoldAccountVo goldAccountVo = memberAccountGoldDao.selectAccountGoldVoByMemberId(memberId);
        return Result.ok(goldAccountVo);
    }
    @Override
    public Result getOwnCannon() {
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        List<OwnCannonVo> cannonOwnRecords = cannonOwnRecordDao.selectCannonOwnRecordsByMemberId(memberId);
        return Result.ok(cannonOwnRecords);
    }
    public static void main(String[] args) {
        System.out.println(UUID.randomUUID().toString());
    }