// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package service import ( "context" "gd_service/apis" "gd_service/consts" "gd_service/errors" "gd_service/impl/thirdparty_impl" "gd_service/impl/thirdparty_impl/dybd" "gd_service/utils" dutils "gd_service/utils" gutils "gd_service/common.in/utils" ) // 学历 func X002(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error { reqData := req.Data.(map[string]interface{}) certificateid := dutils.GetStringParams(reqData, "education_id") name := dutils.GetStringParams(reqData, "name") if certificateid == "" || name == "" { return errors.ArgsError } err := errors.NoRecord var ret string respData := make(map[string]string) reply.Data = respData for groupNum, group := range req.ProviderGroup { rangeNo := groupNum + 1 for _, v := range group { tReq := &apis.ThirdpartRequest{ Ctx: ctx, ProviderApiCode: v, ProviderMap: req.ProviderMap, RangeNo: rangeNo, Req: req, Reply: reply, } switch v { case utils.ADMX02: tReq.Params = map[string]string{ "education_id": certificateid, "name": name, } ret, err = thirdparty_impl.CallThirdparty(tReq) if err != nil { continue } gutils.Convertion(respData, ret) return nil // 学位证 case utils.DYXL: tReq.Params = map[string]string{ consts.DyBdX002P1: certificateid, consts.DyBdX002P2: name, } ret, err = thirdparty_impl.CallThirdparty(tReq) if err != nil { continue } dybd.GetDybdX002Data(ret,respData) return nil } } } return err }