package com.zhiqiyun.open.router.config;

import com.dliyun.oap.framework.security.AppSecretManager;
import com.zhiqiyun.open.core.models.app.AppKeyInfo;
import com.zhiqiyun.open.core.service.AppKeyInfoService;
import org.springframework.beans.factory.annotation.Autowired;

public class DbBaseAppSecretManager implements AppSecretManager {

    @Autowired
    private AppKeyInfoService appKeyInfoService;

    @Override
    public boolean isValidAppKey(String appKey) {
        AppKeyInfo appKeyInfo = this.appKeyInfoService.findByAppKey(appKey);
        return appKeyInfo != null;
    }
}
