成全在线观看免费完整版下载|成全在线观看免费完整版电影|成全在线观看免费完整版第6|成全在线观看免费完整|成全在线观看高清完整版免费动漫|成全在线电影在线观看

小程序網(wǎng)絡(luò)請求轉(zhuǎn)發(fā)服務(wù)

該接口用于小程序中進行業(yè)務(wù)數(shù)據(jù)前后端交互 。

由于小程序是在宿主App中的一個模塊, 小程序中網(wǎng)絡(luò)請求需要經(jīng)過宿主App和宿主App后端服務(wù)進行請求轉(zhuǎn)發(fā),以實現(xiàn)App對小程序管控能力。 使用該接口的必須要先在小程序管理平臺配置可訪問的接口或者域名, 配置后才可訪問成功,不在白名單中的域名或者api是無法通過小程序進行業(yè)務(wù)數(shù)據(jù)請求。

接口說明

接口名稱:httpProxy

Dubbo調(diào)用:msHttpProxyService

接口描述:小程序網(wǎng)絡(luò)請求轉(zhuǎn)發(fā)服務(wù)。

header通用參數(shù)

參考header通用參數(shù)

業(yè)務(wù)參數(shù)

字段名稱 字段類型 字段描述 是否必須
api String 轉(zhuǎn)發(fā)請求api, 該api必須通過進行轉(zhuǎn)發(fā)請求白名單配置
data Object 請求參數(shù)
method String 請求轉(zhuǎn)發(fā)方式,POST, GET
dataType String text,只支持text方式
encrypted String 加密方式, 暫無業(yè)務(wù)需要
responseType String 返回格式, json/text, 根據(jù)請求網(wǎng)站返回數(shù)據(jù),請求網(wǎng)站header中Content-Type如果是application/json, 返回數(shù)據(jù)是json,其他都是string
miniAppCode String 小程序碼

出參

字段名稱 字段類型 字段描述 是否必須
response Object 返回數(shù)據(jù)
code String AAAAAA, 成功,其他 錯誤
msg String

response

字段名稱 字段類型 字段描述 是否必須
statusCode int 標(biāo)準(zhǔn)http狀態(tài)碼, 200請求成功
returnCode Object 后臺請求狀態(tài)對象
data Object 請求數(shù)據(jù)
header Object 請求header

樣例

dubbo協(xié)議接入:

請求url

http://localhost:9102/gw/hk_e_app/msHttpProxyService.do

請求數(shù)據(jù)格式:

{
  "request":{
      "header": {
          "appId": "3",
          "appVersion": "1.0",
          "ffVersion": "4.0",
          "transId": "httpProxy",
          "appExt": "1",
          "custType": "100",
          "signedMicroFlag": "0",
          "net": {
              "ip": "127.0.0.1",
              "netType": "WIFI_oa-test",
              "isp": "中國移動",
              "ssid": "oa-test",
              "lac": "4203",
              "cid": "10732931"
          },
          "device": {
              "osType": "03",
              "osVersion": "8.0.0",
              "brand": "samsung",
              "model": "SM-G9500",
              "uuid": "2e2bc2402301ea3e1e021362dd6b7a1e",
              "imei": "357052091333047",
              "mac": "00:9D:6B:32:00:24",
              "nfc": "1",
              "isRoot": "0",
              "imsi": "8986003915187a258429"
          },
          "reqSeq": "0"
      },
      "body": {
          "api":"http://127.0.01:8080/gw/hk_e_web/ShowMainBoard.do",
          "method":"POST",
          "data":{

          },
          "header":{

          },
          "responseType":"text",
          "encrypted":"false",
          "miniAppCode": "qHwgaSkXKx6tO4jc"
      }
  }
}

http協(xié)議接入:

請求url: http://localhost:8080/ffpaas/miniapp/httpProxy.json

請求數(shù)據(jù)格式:

{
     "request":{
        "header": {
            "appId": "3",
            "appVersion": "1.0",
            "ffVersion": "4.0",
            "transId": "httpProxy",
            "appExt": "1",
            "custType": "100",
            "signedMicroFlag": "0",
            "net": {
                "ip": "127.0.0.1",
                "netType": "WIFI_oa-test",
                "isp": "中國移動",
                "ssid": "oa-test",
                "lac": "4203",
                "cid": "10732931"
            },
            "device": {
                "osType": "03",
                "osVersion": "8.0.0",
                "brand": "samsung",
                "model": "SM-G9500",
                "uuid": "2e2bc2402301ea3e1e021362dd6b7a1e",
                "imei": "357052091333047",
                "mac": "00:9D:6B:32:00:24",
                "nfc": "1",
                "isRoot": "0",
                "imsi": "8986003915187a258429"
            },
            "reqSeq": "0"
        },
        "body": {
            "api":"http://127.0.01:8080/gw/hk_e_web/ShowMainBoard.do",
            "method":"POST",
            "data":{

            },
            "header":{

            },
            "responseType":"text",
            "encrypted":"false",
            "miniAppCode": "qHwgaSkXKx6tO4jc"
        }
    }
}

dsdl配置

節(jié)點配置

msHttpProxyService$applicationName,true

說明:

applicationName修改為應(yīng)用

xml參數(shù)配置

  • 創(chuàng)建節(jié)點,節(jié)點名稱為interface-mapping
  • 添加配置參數(shù)信息,如下
<?xml version="1.0" encoding="UTF-8"?>

<interface name="msHttpProxyService" description="http代理服務(wù)" auth="false">
    <configs>
        <config key="accessLog" value="false"/>
        <config key="transDataRecordMode" value="on"/>
        <config key="productId" value="ECommon"/>
    </configs>
    <input>
        <param name="api" description="請求地址" type="String" optional="false"/>
        <param name="method" description="請求方式" type="String" optional="false"/>
        <param name="data" description="數(shù)據(jù)" type="Map" optional="true"/>
        <param name="header" description="header" type="Map" optional="true"/>
        <param name="responseType" description="響應(yīng)數(shù)據(jù)類型" type="String" optional="true"/>
        <param name="encrypted" description="是否加密" type="String" optional="true"/>
        <param name="miniAppCode" description="miniAppCode" type="String" optional="true"/>
    </input>
    <output>
        <param name="returnCode" description="處理結(jié)果" type="Map" optional="false">
            <param name="code" description="返回碼" type="String" optional="false"/>
            <param name="message" description="返回信息" type="String"/>
            <param name="type" description="處理結(jié)果類型" type="String" optional="false"/>
        </param>
        <param name="data" type="Object"/>
        <param name="statusCode" type="int"/>
        <param name="header" type="Map"/>
    </output>
</interface>
廉江市| 扎赉特旗| 连城县| 永安市| 镇雄县| 石城县| 伊吾县| 招远市| 宜川县| 原平市| 灵璧县| 衡阳市| 门源| 大丰市| 吴川市| 天等县| 改则县| 南郑县| 昂仁县| 正宁县| 龙岩市| 莱西市| 渑池县| 黎川县| 麻城市| 山阴县| 阜平县| 基隆市| 惠安县| 奉贤区| 瓮安县| 嘉祥县| 横山县| 临西县| 湖北省| 义乌市| 景泰县| 安化县| 时尚| 清丰县| 铜陵市|