package com.game.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Collections;
import java.util.List;

import com.game.business.vo.AppAnchorStarVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.game.business.mapper.AppUsersAuthMapper;
import com.game.business.domain.AppUsersAuth;
import com.game.business.service.IAppUsersAuthService;
import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;

/**
 * 主播认证Service业务层处理
 *
 * @author game
 * @date 2024-08-11
 */
@Service
public class AppUsersAuthServiceImpl extends ServiceImpl<AppUsersAuthMapper, AppUsersAuth> implements IAppUsersAuthService {
    @Autowired
    private AppUsersAuthMapper appUsersAuthMapper;

    /**
     * 查询主播认证
     *
     * @param uid 主播认证主键
     * @return 主播认证
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public AppUsersAuth selectAppUsersAuthByUid(Long uid) {
        return appUsersAuthMapper.selectAppUsersAuthByUid(uid);
    }

    /**
     * 查询主播认证列表
     *
     * @param appUsersAuth 主播认证
     * @return 主播认证
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<AppUsersAuth> selectAppUsersAuthList(AppUsersAuth appUsersAuth) {
        return appUsersAuthMapper.selectAppUsersAuthList(appUsersAuth);
    }

    /**
     * 新增主播认证
     *
     * @param appUsersAuth 主播认证
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertAppUsersAuth(AppUsersAuth appUsersAuth) {
            return appUsersAuthMapper.insertAppUsersAuth(appUsersAuth);
    }

    /**
     * 修改主播认证
     *
     * @param appUsersAuth 主播认证
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateAppUsersAuth(AppUsersAuth appUsersAuth) {
        return appUsersAuthMapper.updateAppUsersAuth(appUsersAuth);
    }

    /**
     * 批量删除主播认证
     *
     * @param uids 需要删除的主播认证主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUsersAuthByUids(Long[] uids) {
        return appUsersAuthMapper.deleteAppUsersAuthByUids(uids);
    }

    /**
     * 删除主播认证信息
     *
     * @param uid 主播认证主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUsersAuthByUid(Long uid) {
        return appUsersAuthMapper.deleteAppUsersAuthByUid(uid);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<AppAnchorStarVo> selectAnchorStar() {
        return appUsersAuthMapper.selectAnchorStar();
    }
}