package jnpf.certificate.fallback;

import jnpf.base.ActionResult;
import jnpf.certificate.CertificateManageApi;
import jnpf.model.certificate.vo.CertificateOrganizeBusinessLicenseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 组织营业执照接口降级实现。
 */
@Slf4j
@Component
public class CertificateManageFallbackApi implements CertificateManageApi {

    @Override
    public ActionResult<CertificateOrganizeBusinessLicenseVO> queryBusinessLicense(String organizeId) {
        log.error("queryBusinessLicense调用失败，organizeId={}", organizeId);
        return ActionResult.success(null);
    }

    @Override
    public ActionResult<List<CertificateOrganizeBusinessLicenseVO>> queryBusinessLicenseBatch(Collection<String> organizeIds) {
        log.error("queryBusinessLicenseBatch调用失败，organizeIds={}", organizeIds);
        return ActionResult.success(Collections.emptyList());
    }

    @Override
    public ActionResult<Void> saveBusinessLicense(CertificateOrganizeBusinessLicenseVO req) {
        log.error("saveBusinessLicense调用失败，req={}", req);
        return ActionResult.success();
    }

    @Override
    public ActionResult<Void> deleteBusinessLicense(String organizeId, String loginUserId) {
        log.error("deleteBusinessLicense failed, organizeId={}.loginUserId={}", organizeId,loginUserId);
        return ActionResult.success();
    }

}
