package com.ichangzuo.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ichangzuo.core.security.util.SecurityUtils;
import com.ichangzuo.system.mapper.UserBankMapper;
import com.ichangzuo.system.model.entity.Account;
import com.ichangzuo.system.model.entity.UserBank;
import org.mapstruct.control.MappingControl;
import org.springframework.stereotype.Service;

@Service
public class UserBankServiceImpl extends ServiceImpl<UserBankMapper, UserBank> {
    public UserBank getCurrentBankInfo(){
        Long uid = SecurityUtils.getUserId();
        if(uid==null)
            return null;

        return getOne(new LambdaQueryWrapper<UserBank>()
                .eq(UserBank::getUserId, uid));
    }
}
