/*
 * Copyright (c) 2023 codvision.com All Rights Reserved.
 */

package com.codvision.authcore.remote.fallback;

import com.codvision.authcore.bean.PageData;
import com.codvision.authcore.bean.SysMenuBean;
import com.codvision.authcore.bean.SysUserBean;
import com.codvision.authcore.remote.RemoteAuthService;
import com.codvision.commoncore.common.ResponseEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 认证服务调用反馈
 *
 * @author lingee
 * @date 2023/7/19
 */
@Service
@Slf4j
public class RemoteAuthServiceFallback implements RemoteAuthService {


    private ResponseEntity failResponse() {
        ResponseEntity response = new ResponseEntity();
        response.error(990000).message("认证服务调用失败");
        log.error(response.getMessage());
        return response;
    }

    @Override
    public ResponseEntity<SysUserBean> getUserInfo(String token) {
        return failResponse();
    }

    @Override
    public ResponseEntity<PageData<SysMenuBean>> getUserMenus(String token, int page, int size) {
        return failResponse();
    }

}
