package com.springboot.cloud.auth.authentication.provider;

import com.springboot.cloud.auth.authentication.entity.License;
import com.springboot.cloud.auth.authentication.entity.Popedom;
import com.springboot.cloud.common.core.entity.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Component
@Slf4j
public class PopedomProviderFallback implements PopedomProvider {

    @Override
    public Result<List<Popedom>> popedoms() {
        log.error("认证服务启动时加载资源异常！未加载到资源!");
        return Result.fail();
    }

    @Override
    public Result<List<Popedom>> popedoms(String companyId, String username) {
        log.error("认证服务查询用户异常！查询用户资源为空！");
        return Result.success(new ArrayList<Popedom>());
    }

    @Override
    public Result<License> license(String companyId, String applicationCode) {
        log.error("认证服务查询企业应用有效期异常！企业应用过期！");
        return Result.success(new License());
    }

}
