M3D / M3D / Utility / HttpMessageHandler
Class: HttpMessageHandler
M3D.Utility.HttpMessageHandler
Http通信接口
Table of contents
Constructors
Methods
- deleteView
- download
- downloadByContent
- get
- getAddress
- getByParameters
- getConfig
- getDataBySingle
- getElement
- getElementList
- getMeshBlockByLodLevel
- getMeshBlockList
- getStrategy
- openModel
- post
- requestFileInfo
- saveConfig
- saveView
- streamHttp
- updateView
Constructors
constructor
• new HttpMessageHandler(): HttpMessageHandler
Returns
Methods
deleteView
▸ deleteView(fileid
, viewid
, uniqueid
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
fileid | any | 源文件id,根据此id实现批量删除,与viewid不能同时为空 |
viewid | any | 需要删除的viewid(数据库 中的id),与fileid不能同时为空 |
uniqueid | any | 唯一号(可传用户id) |
Returns
Promise
<string
| ArrayBuffer
>
Description
删除视图
download
▸ download(fileUrl
, async
, requestParameters
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
fileUrl | string | |
async | boolean | 是否异步 |
requestParameters | any | 附加参数 |
Returns
Promise
<string
| ArrayBuffer
>
Description
发起下载请求
downloadByContent
▸ downloadByContent(async
, content
, relatedPath
, requestParameters
): Promise
<string
| ArrayBuffer
>
根据文件content,拼接文件下载路径,获取文件详细信息
Parameters
Name | Type | Description |
---|---|---|
async | any | 是否同步、异步 |
content | any | 文件请求路径获取的内容,多个中间用英文逗号隔开 获取所有:all 获取子文件: fileinfo,Info,bom,lod,animation,pmi,mesh,model,view,lod, |
relatedPath | any | 文件相对路径 |
requestParameters | any | - |
Returns
Promise
<string
| ArrayBuffer
>
接口数据返回
get
▸ get(url
, async
, requestParameters
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
url | string | url |
async | boolean | 是否异步 |
requestParameters | any | 附加参数 |
Returns
Promise
<string
| ArrayBuffer
>
Description
发起get请求
getAddress
▸ getAddress(): Promise
<string
| ArrayBuffer
>
Returns
Promise
<string
| ArrayBuffer
>
IP地址及ws链接地址
Description
获取Http链接地址及websocket链接地址
getByParameters
▸ getByParameters(url
, async
, requestParameters
, responseType
, onProcess?
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
url | string | url |
async | boolean | 是否异步 |
requestParameters | any | 附加参数 |
responseType | string | - |
onProcess? | any | - |
Returns
Promise
<string
| ArrayBuffer
>
Description
发起get请求,传送参数
getConfig
▸ getConfig(uniqueid
, filelid
, type
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | any | 唯一号(可传用户id) |
filelid | any | 模型id |
type | any | 配置类型:1:系统配置 2:文档配置 |
Returns
Promise
<string
| ArrayBuffer
>
Description
获取文档配置
getDataBySingle
▸ getDataBySingle(uniqueid
, content
, relativepath?
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | any | 模型id |
content | any | 需要获取的文件后缀 |
relativepath? | string | 其他资源文件的相对路径 |
Returns
Promise
<string
| ArrayBuffer
>
Description
根据类型获得单个文件
getElement
▸ getElement(uniqueid
, type
, typeids
, geoid
, range
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | any | - |
type | any | 内容类型 |
typeids | any | 根据type类型,传递不同类型的id,用英文逗号隔开 |
geoid | any | 几何要素id |
range | any | 元素获取范围 |
Returns
Promise
<string
| ArrayBuffer
>
Description
返回相关元素内容,(例:视图内容)
getElementList
▸ getElementList(uniqueid
, splitconfig
, type
, modelid
, range
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | any | |
splitconfig | any | |
type | any | 内容类型 |
modelid | any | 文件内部模型ID |
range | any | 元素获取范围 |
Returns
Promise
<string
| ArrayBuffer
>
Description
获取元素列表
getMeshBlockByLodLevel
▸ getMeshBlockByLodLevel(uniqueid
, modelLodMap
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type |
---|---|
uniqueid | any |
modelLodMap | Map <number , number > |
Returns
Promise
<string
| ArrayBuffer
>
Description
根据LOD级别获取mesh数据
getMeshBlockList
▸ getMeshBlockList(uniqueid
, cameradata?
, viewportaspect?
, viewportheight?
, viewportwidth?
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type |
---|---|
uniqueid | any |
cameradata? | any |
viewportaspect? | any |
viewportheight? | any |
viewportwidth? | any |
Returns
Promise
<string
| ArrayBuffer
>
Description
获取流模式全部的数据,info/bom/lod/material/mesh块列表
getStrategy
▸ getStrategy(uniqueid
, strategy
, envconfig?
, viewconfig?
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type |
---|---|
uniqueid | any |
strategy | any |
envconfig? | any |
viewconfig? | any |
Returns
Promise
<string
| ArrayBuffer
>
Description
获取客户选择的加载设置,设置到服务器 。并获取模型最终加载方式
openModel
▸ openModel(uniqueid
, userid
, usernickname
, splitconfig?
): boolean
| Exception
Parameters
Name | Type | Description |
---|---|---|
uniqueid | string | 模型id |
userid | any | 登录id |
usernickname | any | 用户昵称 |
splitconfig? | any | - |
Returns
boolean
| Exception
Description
打开模型
post
▸ post(url
, async
, requestParameters
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
url | string | url |
async | boolean | 是否异步 |
requestParameters | any | 附加参数 |
Returns
Promise
<string
| ArrayBuffer
>
Description
发起post请求
requestFileInfo
▸ requestFileInfo(uniqueid
, userid
, usernickname
, splitconfig?
): Promise
<any
>
Parameters
Name | Type |
---|---|
uniqueid | string |
userid | any |
usernickname | any |
splitconfig? | any |
Returns
Promise
<any
>
Description
请求文件信息
Static
saveConfig
▸ saveConfig(uniqueid
, content
, filelid
, type
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | any | 唯一号(可传用户id) |
content | any | 配置内容json串 |
filelid | any | 模型id |
type | any | 配置类型:1:系统配置 2:文档配置 |
Returns
Promise
<string
| ArrayBuffer
>
Description
保存文档配置
saveView
▸ saveView(id
, uniqueid
, content
, creator
, name
, modelid
, modelviewid
, isactivated
, contentfile?
, image1?
, image2?
, boardimage?
, boardName?
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type |
---|---|
id | any |
uniqueid | any |
content | any |
creator | any |
name | any |
modelid | any |
modelviewid | any |
isactivated | any |
contentfile? | any |
image1? | any |
image2? | any |
boardimage? | any |
boardName? | any |
Returns
Promise
<string
| ArrayBuffer
>
Description
保存视图
Static
streamHttp
▸ streamHttp(uniqueid
, userid
, usernickname
, splitconfig?
): Promise
<unknown
>
Parameters
Name | Type | Description |
---|---|---|
uniqueid | string | 模型id |
userid | any | 用户id |
usernickname | any | 用户名称 |
splitconfig? | any | - |
Returns
Promise
<unknown
>
true/error
Description
SVLStreamService2.0 Http 通信打开模型/设置获取加载策略
updateView
▸ updateView(uniqueid
, viewid
, name
, isactivated
, type
): Promise
<string
| ArrayBuffer
>
Parameters
Name | Type |
---|---|
uniqueid | any |
viewid | any |
name | any |
isactivated | any |
type | any |
Returns
Promise
<string
| ArrayBuffer
>
Description
更新视图(设置默认视图)