package com.muyu.data.mart.service.impl;

import com.muyu.data.mart.common.BasicApi;
import com.muyu.data.mart.domain.juhe.JuHeResult;
import com.muyu.data.mart.domain.realname.RealNameReq;
import com.muyu.data.mart.domain.realname.RealNameResp;
import com.muyu.data.mart.domain.realname.juhe.JuHeRealNameReq;
import com.muyu.data.mart.domain.realname.juhe.JuHeRealNameResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author：chaiyapeng
 * @Package：com.muyu.data.mart.service.impl
 * @Project：cloud-port
 * @name：RealNameServiceImpl
 * @Date：2024/9/6 10:23
 *
 *聚合数据接口对接
 */
@Service("juhe-real-name")
public class RealNameServiceImpl implements BasicApi<RealNameReq, RealNameResp> {

    /**
     * 请求
     * @param realNameReq
     * @return
     */
    @Override
    public RealNameResp send(RealNameReq realNameReq) {
        JuHeRealNameReq juHeRealNameReq = JuHeRealNameReq.realNameReqBuilder(realNameReq);
        JuHeResult<JuHeRealNameResp> juHeRealNameRespJuHeResult = sendApi(juHeRealNameReq);


        return RealNameResp.builder().build();
    }

    public JuHeResult<JuHeRealNameResp> sendApi(JuHeRealNameReq juHeRealNameReq){

        return new JuHeResult<JuHeRealNameResp>(){{
           setErrorCode(0);
           setReason("成功");
           setResult(
                   JuHeRealNameResp.builder()
                           .realName(juHeRealNameReq.getRealName())
                           .idCard(juHeRealNameReq.getIdCard())
                           .res(0)
                           .build()
           );
        }};

    }
}
