package com.ruoyi.ss.access.service.impl;

import com.ruoyi.ss.access.domain.Access;
import com.ruoyi.ss.access.service.AccessService;
import com.ruoyi.ss.access.service.AccessValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wjh
 * 2024/8/8
 */
@Service
public class AccessValidatorImpl implements AccessValidator {

    @Autowired
    private AccessService accessService;

    /**
     * 秘钥是否属于用户
     */
    @Override
    public boolean isBelong(Access access, Long userId) {
        return access != null && access.getUserId() != null && access.getUserId().equals(userId);
    }
}
