package com.diagbot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diagbot.entity.ServiceToken;
import com.diagbot.mapper.ServiceTokenMapper;
import com.diagbot.service.ServiceTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 服务令牌表 服务实现类
 * </p>
 *
 * @author zhaops
 * @since 2018-09-17
 */
@Service
public class ServiceTokenServiceImpl extends ServiceImpl<ServiceTokenMapper, ServiceToken> implements ServiceTokenService {

    @Autowired
    ServiceTokenMapper serviceTokenMapper;

    @Override
    public ServiceToken getServiceToken(Map<String, Object> paramMap) {
        return serviceTokenMapper.getServiceToken(paramMap);
    }

    public ServiceToken getByProductServiceId(Long productServiceId) {
        return baseMapper.getByProductServiceId(productServiceId);
    }

    public Integer deleteByProductServiceId(Long productServiceId) {
        return baseMapper.deleteByProductServiceId(productServiceId);
    }

    public Integer enableToken(Long productServiceId) {
        return baseMapper.enableToken(productServiceId);
    }

    public Integer disableToken(Long productServiceId) {
        return baseMapper.disableToken(productServiceId);
    }
}
