1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- // 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 X003(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error {
- reqData := req.Data.(map[string]interface{})
- idCard := dutils.GetStringParams(reqData, "id_card")
- name := dutils.GetStringParams(reqData, "name")
- if idCard == "" || name == "" {
- return errors.ArgsError
- }
- var err error
- var ret string
- respData := make(map[string]interface{})
- 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.ADMX03:
- tReq.Params = map[string]string{
- "id_card": idCard,
- "name": name,
- }
- ret, err = thirdparty_impl.CallThirdparty(tReq)
- if err != nil {
- continue
- }
- respData["list"] = gutils.ConvertionSlice(ret)
- return nil
- case utils.DYXLALL:
- tReq.Params = map[string]string{
- consts.DyBdX003P1: idCard,
- consts.DyBdX003P2: name,
- "type":"education",
- "code":"JxeBPTiyZY",
- }
- ret, err = thirdparty_impl.CallThirdparty(tReq)
- if err != nil {
- continue
- }
- respData["list"] = dybd.GetDybdX003Data(ret)
- return nil
- }
- }
- }
- return err
- }
- //cb87881b6fa5ee9dfb4b0828d22e5fa9
|