package com.ningdatech.kqapi.user.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.kqapi.user.model.entity.UserAuth;
import com.ningdatech.kqapi.user.mapper.UserAuthMapper;
import com.ningdatech.kqapi.user.service.IUserAuthService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Liuxinxin
 * @since 2022-11-23
 */
@Service
public class UserAuthServiceImpl extends ServiceImpl<UserAuthMapper, UserAuth> implements IUserAuthService {

    @Override
    public List<UserAuth> listByUserId(Long userId) {
        return list(Wrappers.lambdaQuery(UserAuth.class).eq(UserAuth::getUserId, userId));
    }

    @Override
    public void removeByUserId(Long userId) {
        baseMapper.delete(Wrappers.lambdaQuery(UserAuth.class).eq(UserAuth::getUserId, userId));
    }

}
