/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @Title: MemberClientFallbackFactory
 * @Package cn.freemud.hystrix
 * @Description:
 * @author: liming.guo
 * @date: 2018/6/25 16:39
 * @version V1.0
 * @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
package cn.freemud.hystrix;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
public class MemberClientFallbackFactory {

//    @Override
//    public GetMemberInfoResponseDto getUserInfo(GetMemberInfoDto memberInfoDto) {
//        return getDefaultFallbackBean(GetMemberInfoResponseDto::new,"getUserInfo");
//    }
//
//    @Override
//    public GetMemberInfoResponseDto getUserInfoByMemberId(GetMemberInfoByMemberIdDto getMemberInfoByMemberIdDto) {
//        return getDefaultFallbackBean(GetMemberInfoResponseDto::new,"getUserInfoByMemberId");
//    }
//
//    @Override
//    public UserRegisterResponse registerbychannel(MemberRegisterDto memberRegisterDto) {
//        return getDefaultFallbackBean(UserRegisterResponse::new,"registerbychannel");
//    }
//
//    @Override
//    public JSONObject editUserInfo(EditMemberInfo editMemberInfo) {
////        return getDefaultFallbackBean(UserRegisterResponse::new,"registerbychannel");
//        return null;
//    }
//
//    private static <T> T getDefaultFallbackBean(Supplier<T> supplier,String methodName) {
//        T target = supplier.get();
//        Class clazz = target.getClass();
//        Map<String, String> map = Maps.newTreeMap();
//        map.put("code", ResponseResult.SYSTEM_BUSINESS_ERROR.getCode());
//        map.put("message",methodName+ "请求服务异常");
//        return new Gson().fromJson(new Gson().toJson(map), (Class<T>) clazz);
//    }

}
