package com.xhpc.user.service.impl;

import com.xhpc.user.domain.AuthSetToken;
import com.xhpc.user.mapper.AuthSetTokenMapper;
import com.xhpc.user.service.IAuthSetTokenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class AuthSetTokenServiceImpl implements IAuthSetTokenService {

    @Resource
    AuthSetTokenMapper authSetTokenMapper;
    @Override
    public List<Map<String, Object>> getList(String name, String tenantId) {
        return authSetTokenMapper.getList(name,tenantId);
    }

    @Override
    public Map<String, Object> getById(Long id) {
        Map<String, Object> byId = authSetTokenMapper.getById(id);
        return byId;
    }

    @Override
    public void insertAuthSetToken(AuthSetToken authSetToken) {
        if(authSetToken.getId() !=null){
            authSetTokenMapper.updateAuthSetToken(authSetToken);
        }else{
            authSetTokenMapper.insertAuthSetToken(authSetToken);
        }
    }

    @Override
    public void updateAuthSetToken(AuthSetToken authSetToken) {
        authSetTokenMapper.updateAuthSetToken(authSetToken);
    }
}
