const { request_wxrlxf, wx_rlxf } = require("../func/request");

const base_url = wx_rlxf ? 'https://tx.hz-hanghui.com:8088/yx-fyzd/alipay/api/v1/open/iotvsp/' : 'http://192.168.11.11:9100/yx-fyzd/alipay/api/v1/open/iotvsp/'

const isvPid = '2088721034139660'
const orgOutId = 'xinchengshidaiguangchang'
const componentOutId = 'common_verify_import'

// 录入机构用户信息，获取操作流水号unique_id
const userCreate = data => {
    return request_wxrlxf({
        url: `${base_url}userwithvid/create`,
        method: "post",
        type: "application/json",
        data: {
          componentOutId: componentOutId,
          isvPid: isvPid,
          orgOutId: orgOutId,
          userInfoList: [data]
        }
    })
}

// 校验用户是否在库
const checkVid = () => {
  return request_wxrlxf({
      url: `${base_url}user/check`,
      method: "post",
      type: "application/json",
      data: {
        isvPid: isvPid,
        orgOutId: orgOutId
      }
  })
}

module.exports = {
  userCreate,
  checkVid,
  isvPid,
  orgOutId,
  componentOutId
}
