package com.game.business.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;

import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;
import com.game.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.game.business.mapper.AppUserMapper;
import com.game.business.domain.AppUser;
import com.game.business.service.IAppUserService;

/**
 * app用户Service业务层处理
 *
 * @author game
 * @date 2024-06-18
 */
@Service
@DS("slave")
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements IAppUserService {
    @Autowired
    private AppUserMapper appUserMapper;

    /**
     * 查询app用户
     *
     * @param userid app用户主键
     * @return app用户
     */
    @Override
    public AppUser selectAppUserByUserid(Long userid) {
        return appUserMapper.selectAppUserByUserid(userid);
    }

    /**
     * 查询app用户列表
     *
     * @param appUser app用户
     * @return app用户
     */
    @Override
    public List<AppUser> selectAppUserList(AppUser appUser) {
        return appUserMapper.selectAppUserList(appUser);
    }

    /**
     * 新增app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    @Override
    public int insertAppUser(AppUser appUser) {
                appUser.setCreateTime(DateUtils.getNowDate());
            return appUserMapper.insertAppUser(appUser);
    }

    /**
     * 修改app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    @Override
    public int updateAppUser(AppUser appUser) {
        return appUserMapper.updateAppUser(appUser);
    }

    /**
     * 批量删除app用户
     *
     * @param userids 需要删除的app用户主键
     * @return 结果
     */
    @Override
    public int deleteAppUserByUserids(Long[] userids) {
        return appUserMapper.deleteAppUserByUserids(userids);
    }

    /**
     * 删除app用户信息
     *
     * @param userid app用户主键
     * @return 结果
     */
    @Override
    public int deleteAppUserByUserid(Long userid) {
        return appUserMapper.deleteAppUserByUserid(userid);
    }
}